/**
 * POPiNTV Community styles — notice board (klotterplank) and relay script.
 *
 * @package POPiNTV
 * @version 3.4.0
 */

/* Shared */

.popintv-hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.popintv-container--narrow {
    max-width: 820px;
}

/* Notice board */

.popintv-board-header {
    margin: 2rem 0 1.5rem;
}

.popintv-board-header__title {
    font-family: var(--popintv-font-heading, inherit);
    font-size: 2rem;
    margin: 0 0 0.5rem;
    color: var(--popintv-text, inherit);
}

.popintv-board-header__intro {
    color: var(--popintv-text-secondary, inherit);
    max-width: 640px;
}

.popintv-note-form-card,
.popintv-relay-form-card {
    background: var(--popintv-surface, #1a1a1a);
    border: 1px solid var(--popintv-border-subtle, #2a2a2a);
    border-radius: var(--popintv-radius, 12px);
    padding: 1.5rem;
    margin-bottom: 2.5rem;
}

.popintv-note-form-card h2,
.popintv-relay-form-card h2 {
    margin: 0 0 0.5rem;
    font-size: 1.25rem;
    color: var(--popintv-text, inherit);
}

.popintv-note-form-card__hint,
.popintv-relay-form-card__hint {
    font-size: 0.9rem;
    color: var(--popintv-text-secondary, inherit);
    margin: 0 0 1rem;
}

.popintv-note-form__row {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.popintv-note-form-card input[type="text"],
.popintv-note-form-card textarea,
.popintv-relay-form-card input[type="text"],
.popintv-relay-form-card textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 0.65rem 0.8rem;
    background: var(--popintv-background, #0f0f0f);
    border: 1px solid var(--popintv-border, #333);
    border-radius: var(--popintv-radius-sm, 8px);
    color: var(--popintv-text, #f5f5f5);
    font-size: 1rem;
    font-family: inherit;
}

.popintv-note-form-card input:focus,
.popintv-note-form-card textarea:focus,
.popintv-relay-form-card input:focus,
.popintv-relay-form-card textarea:focus {
    outline: 2px solid var(--popintv-primary, #e63946);
    outline-offset: 1px;
}

.popintv-note-form__colors {
    border: none;
    padding: 0;
    margin: 0 0 1rem;
    display: flex;
    gap: 0.5rem;
}

.popintv-color-chip {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    display: inline-block;
    position: relative;
}

.popintv-color-chip input {
    position: absolute;
    opacity: 0;
    inset: 0;
    margin: 0;
    cursor: pointer;
}

.popintv-color-chip:has(input:checked) {
    border-color: var(--popintv-text, #f5f5f5);
}

.popintv-color-chip--yellow { background: #f5d76e; }
.popintv-color-chip--pink { background: #f7a8b8; }
.popintv-color-chip--blue { background: #9ec9f0; }
.popintv-color-chip--green { background: #a8ddb5; }
.popintv-color-chip--orange { background: #f5b87a; }
.popintv-color-chip--purple { background: #cdb4f0; }

.popintv-note-form__actions,
.popintv-relay-form__actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.popintv-note-form__status,
.popintv-relay-form__status {
    font-size: 0.9rem;
}

.popintv-note-board {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
    padding-bottom: 3rem;
}

.popintv-note-board__empty {
    grid-column: 1 / -1;
    color: var(--popintv-text-secondary, inherit);
    font-style: italic;
}

.popintv-note {
    padding: 1rem 1rem 0.75rem;
    border-radius: 4px 4px 12px 4px;
    transform: rotate(var(--popintv-note-tilt, 0deg));
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    word-wrap: break-word;
}

.popintv-note:hover {
    transform: rotate(0deg) scale(1.02);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45);
}

.popintv-note--new {
    animation: popintv-note-in 0.35s ease-out;
}

@keyframes popintv-note-in {
    from { opacity: 0; transform: rotate(var(--popintv-note-tilt, 0deg)) translateY(10px); }
    to { opacity: 1; transform: rotate(var(--popintv-note-tilt, 0deg)) translateY(0); }
}

.popintv-note--yellow { background: #f5d76e; color: #222; }
.popintv-note--pink { background: #f7a8b8; color: #3a1a22; }
.popintv-note--blue { background: #9ec9f0; color: #12263a; }
.popintv-note--green { background: #a8ddb5; color: #12301c; }
.popintv-note--orange { background: #f5b87a; color: #3a2410; }
.popintv-note--purple { background: #cdb4f0; color: #241436; }

.popintv-note__text {
    margin: 0 0 0.75rem;
    white-space: pre-wrap;
    font-size: 0.95rem;
    line-height: 1.45;
}

.popintv-note__meta {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.75rem;
    opacity: 0.75;
    border-top: 1px dashed rgba(0, 0, 0, 0.25);
    padding-top: 0.4rem;
}

/* Relay script */

.popintv-relay-header {
    margin: 2rem 0 1.5rem;
}

.popintv-relay-header--story {
    margin-top: 1.5rem;
}

/* Story picker — cards for every published relay script so several
   stories can run at once. */
.popintv-relay-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    margin: 0 0 1.5rem;
}

.popintv-relay-picker__card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1rem 1.25rem;
    background: var(--popintv-surface, #1a1a1a);
    border: 1px solid var(--popintv-border-subtle, #2a2a2a);
    border-radius: var(--popintv-radius-md, 8px);
    color: var(--popintv-text, inherit);
    text-decoration: none;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.popintv-relay-picker__card:hover {
    border-color: var(--popintv-primary, #e63946);
    transform: translateY(-2px);
}

.popintv-relay-picker__card.is-active {
    border-color: var(--popintv-primary, #e63946);
    box-shadow: 0 0 12px var(--popintv-primary-glow, rgba(230, 57, 70, 0.25));
}

.popintv-relay-picker__title {
    font-family: var(--popintv-font-heading, inherit);
    font-weight: 700;
    font-size: 1.05rem;
}

.popintv-relay-picker__intro {
    font-size: 0.85rem;
    color: var(--popintv-text-secondary, inherit);
    line-height: 1.5;
}

.popintv-relay-picker__count {
    font-size: 0.8rem;
    color: var(--popintv-text-secondary, inherit);
}

.popintv-relay-picker__card.is-active .popintv-relay-picker__count {
    color: var(--popintv-primary, #e63946);
    font-weight: 700;
}

.popintv-relay-header__title {
    font-family: var(--popintv-font-heading, inherit);
    font-size: 2rem;
    margin: 0 0 0.75rem;
    color: var(--popintv-text, inherit);
}

.popintv-relay-intro {
    color: var(--popintv-text-secondary, inherit);
    line-height: 1.6;
}

.popintv-relay-header__stats {
    font-size: 0.9rem;
    color: var(--popintv-text-secondary, inherit);
    margin-top: 0.5rem;
}

.popintv-relay-header__actions {
    margin-top: 1rem;
}

/* Shared button base for the community pages (the frontend had no generic
   .popintv-button — the relay form's submit button relied on these classes). */
.popintv-button {
    display: inline-block;
    padding: 0.6rem 1.4rem;
    border-radius: var(--popintv-radius-md, 10px);
    border: 1px solid transparent;
    font: inherit;
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.popintv-button--primary {
    background: var(--popintv-primary, #e63946);
    color: #fff;
}

.popintv-button--primary:hover {
    background: var(--popintv-primary-hover, #d32f3c);
    color: #fff;
}

.popintv-button--secondary {
    background: transparent;
    color: var(--popintv-text, inherit);
    border-color: var(--popintv-border, #3a3a46);
}

.popintv-button--secondary:hover {
    border-color: var(--popintv-primary, #e63946);
    color: var(--popintv-primary, #e63946);
}

.popintv-relay-script {
    margin-bottom: 2.5rem;
}

.popintv-relay-script__empty {
    font-style: italic;
    color: var(--popintv-text-secondary, inherit);
}

.popintv-relay-section {
    position: relative;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
    background: var(--popintv-surface, #1a1a1a);
    border: 1px solid var(--popintv-border-subtle, #2a2a2a);
    border-left: 3px solid var(--popintv-border-subtle, #2a2a2a);
    border-radius: var(--popintv-radius-sm, 8px);
}

.popintv-relay-section--mine {
    border-left-color: var(--popintv-primary, #e63946);
}

.popintv-relay-section--new {
    animation: popintv-note-in 0.35s ease-out;
}

.popintv-relay-section__heading {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--popintv-text-secondary, inherit);
    margin: 0 0 0.5rem;
}

.popintv-relay-section__text {
    line-height: 1.65;
    color: var(--popintv-text, inherit);
}

.popintv-relay-section__text p {
    margin: 0 0 0.75rem;
}

.popintv-relay-section__meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--popintv-text-secondary, inherit);
    margin-top: 0.5rem;
}

.popintv-relay-form__counter {
    font-size: 0.8rem;
    color: var(--popintv-text-secondary, inherit);
    text-align: right;
    margin: 0.25rem 0 1rem;
}

/* Responsive */
@media (max-width: 600px) {
    .popintv-note-board {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
}

@media (max-width: 420px) {
    .popintv-note-board {
        grid-template-columns: 1fr;
    }
}
