/* ============================================================
   📁 File: broadcast/static/broadcast/css/channel_directory.css
   Purpose:
   - Channel provisioning / create-channel page styling.
   - Public users see clean paid checkout.
   - Authenticated users see scoped existing channels.
   - Supports both current template class names:
     .channel-directory...
   - Also preserves older class names:
     .channel-page / .channel-shell / .channel-grid...
   ============================================================ */

/* ============================================================
   PAGE SHELL
============================================================ */

.channel-directory,
.channel-page {
    min-height: 100vh;
    box-sizing: border-box;
    padding: 78px 24px 48px;
    background:
        radial-gradient(circle at top left, rgba(134, 231, 255, 0.16), transparent 32%),
        linear-gradient(180deg, #071118 0%, #020608 100%);
    color: #f3f7fb;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.channel-shell {
    width: min(1180px, 100%);
    margin: 0 auto;
}

/* ============================================================
   HEADER / HERO
============================================================ */

.channel-directory-header,
.channel-hero {
    width: min(1180px, 100%);
    margin: 0 auto 28px;
}

.channel-hero {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-end;
}

.channel-directory-kicker,
.channel-kicker {
    margin: 0 0 8px;
    color: #86e7ff;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-family:
        ui-monospace,
        SFMono-Regular,
        Menlo,
        Monaco,
        Consolas,
        monospace;
    font-size: 12px;
    font-weight: 900;
}

.channel-directory-header h1,
.channel-title {
    margin: 0;
    color: #f3f7fb;
    font-size: clamp(40px, 5vw, 72px);
    line-height: 0.95;
    letter-spacing: -0.045em;
}

.channel-directory-header p:not(.channel-directory-kicker),
.channel-subtitle {
    margin: 16px 0 0;
    max-width: 720px;
    color: #b6d3de;
    font-size: 17px;
    line-height: 1.55;
}

/* ============================================================
   MAIN GRID
============================================================ */

.channel-directory-grid,
.channel-grid {
    width: min(1180px, 100%);
    margin: 0 auto;

    display: grid;
    grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

/* ============================================================
   CARDS
============================================================ */

.channel-card {
    box-sizing: border-box;
    border: 1px solid rgba(134, 231, 255, 0.18);
    border-radius: 22px;
    background: rgba(12, 18, 25, 0.92);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}

.channel-checkout-card,
.channel-existing-card {
    padding: 22px;
}

.channel-card-inner {
    padding: 22px;
}

.channel-card h2 {
    margin: 0 0 18px;
    color: #f3f7fb;
    font-size: 22px;
    line-height: 1.1;
    letter-spacing: -0.025em;
}

/* ============================================================
   FORM
============================================================ */

.channel-checkout-form,
.channel-form {
    display: grid;
    gap: 15px;
}

.channel-checkout-form label {
    display: grid;
    gap: 7px;
}

.channel-form label {
    display: block;
    margin: 0 0 6px;
    color: #c8d7e5;
    font-size: 13px;
}

.channel-checkout-form label span {
    color: #d9f5ff;
    font-size: 13px;
    font-weight: 800;
}

.channel-checkout-form input,
.channel-checkout-form textarea,
.channel-form input,
.channel-form textarea {
    box-sizing: border-box;
    width: 100%;
    min-height: 44px;
    padding: 11px 13px;

    border: 1px solid rgba(134, 231, 255, 0.22);
    border-radius: 13px;

    color: #f3f7fb;
    background: rgba(1, 5, 9, 0.86);

    font-size: 15px;
    outline: none;
}

.channel-form input,
.channel-form textarea {
    margin-bottom: 14px;
}

.channel-checkout-form textarea,
.channel-form textarea {
    min-height: 108px;
    resize: vertical;
}

.channel-checkout-form input:focus,
.channel-checkout-form textarea:focus,
.channel-form input:focus,
.channel-form textarea:focus {
    border-color: rgba(134, 231, 255, 0.72);
    box-shadow: 0 0 0 3px rgba(134, 231, 255, 0.1);
}

/* ============================================================
   BUTTONS / STATUS
============================================================ */

#channel-checkout-submit,
.channel-button {
    width: 100%;
    min-height: 48px;
    margin-top: 4px;
    padding: 0 16px;

    border: 0;
    border-radius: 15px;

    color: #001018;
    background: #86e7ff;

    font-size: 15px;
    font-weight: 950;
    cursor: pointer;
}

#channel-checkout-submit:hover,
.channel-button:hover {
    filter: brightness(1.08);
}

#channel-checkout-submit:disabled,
.channel-button:disabled {
    cursor: wait;
    opacity: 0.66;
}

.channel-checkout-status {
    min-height: 18px;
    margin: 0;
    color: #b6d3de;
    font-size: 13px;
}

.channel-error {
    display: none;
    margin-bottom: 14px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 80, 80, 0.14);
    border: 1px solid rgba(255, 80, 80, 0.32);
    color: #ffb8b8;
}

.channel-error.is-visible {
    display: block;
}

/* ============================================================
   CHANNEL LIST
============================================================ */

.channel-list {
    display: grid;
    gap: 12px;
}

.channel-empty {
    margin: 0;
    padding: 16px;
    border: 1px dashed rgba(134, 231, 255, 0.22);
    border-radius: 15px;
    color: #9dafbf;
}

.channel-row,
.channel-item,
.channel-list-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;

    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 17px;

    background: rgba(255, 255, 255, 0.035);
}

.channel-row:hover,
.channel-item:hover,
.channel-list-item:hover {
    border-color: rgba(134, 231, 255, 0.34);
    background: rgba(134, 231, 255, 0.055);
}

.channel-name,
.channel-row h3,
.channel-item h3,
.channel-list-item h3 {
    margin: 0;
    color: #f3f7fb;
    font-size: 18px;
    line-height: 1.15;
}

.channel-meta,
.channel-row p,
.channel-item p,
.channel-list-item p {
    margin: 6px 0 0;
    color: #9dafbf;
    font-size: 13px;
    line-height: 1.35;
}

.channel-badge,
.channel-pill {
    display: inline-flex;
    align-items: center;
    height: 20px;
    padding: 0 8px;
    margin-left: 6px;

    border-radius: 999px;
    color: #86e7ff;
    background: rgba(134, 231, 255, 0.12);

    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.channel-actions,
.channel-row-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.channel-link,
.channel-actions a,
.channel-row-actions a,
.channel-list a.button,
.channel-list button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 84px;
    min-height: 40px;
    padding: 0 13px;

    border: 1px solid rgba(134, 231, 255, 0.24);
    border-radius: 13px;

    color: #f3f7fb;
    background: rgba(134, 231, 255, 0.07);

    font-weight: 850;
    text-decoration: none;
    cursor: pointer;
}

.channel-link:hover,
.channel-actions a:hover,
.channel-row-actions a:hover,
.channel-list a.button:hover,
.channel-list button:hover {
    border-color: rgba(134, 231, 255, 0.72);
    background: rgba(134, 231, 255, 0.12);
}

/* ============================================================
   RESPONSIVE
============================================================ */

@media (max-width: 920px) {
    .channel-directory,
    .channel-page {
        padding: 76px 14px 36px;
    }

    .channel-directory-grid,
    .channel-grid {
        grid-template-columns: 1fr;
    }

    .channel-hero {
        display: block;
    }
}

@media (max-width: 620px) {
    .channel-directory-header h1,
    .channel-title {
        font-size: 44px;
    }

    .channel-row,
    .channel-item,
    .channel-list-item {
        grid-template-columns: 1fr;
    }

    .channel-actions,
    .channel-row-actions {
        justify-content: flex-start;
    }
}