/* ==========================================================================
   StreamFree shared design system
   Design tokens + reusable components used across 2+ templates (buttons,
   cards, form inputs, copy-fields, modals). Loaded once from base.html, so
   every page inherits it automatically.

   Keep page-specific layout here OUT of this file — hero carousels, the
   player chrome, the Live TV sidebar, etc. belong in their own template's
   <style> block. Only put something here once it's genuinely duplicated
   (near-verbatim) across multiple pages.
   ========================================================================== */

:root {
    --bg-primary: #0a0a0b;
    --bg-secondary: #0f0f10;
    --bg-tertiary: #131314;
    --text-primary: #f4f4f5;
    --text-secondary: rgba(255, 255, 255, 0.5);
    --text3: rgba(255, 255, 255, 0.3);
    --border-color: rgba(255, 255, 255, 0.07);
    --border-color-strong: rgba(255, 255, 255, 0.15);
    --accent-color: #9146ff;
    --accent-rgb: 145, 70, 255;
    --gold: #f5c542;
    --gold-2: #e8a000;
    --surface: #18181e;
    --border: rgba(255, 255, 255, 0.07);
    --live: #ff3b30;
}

/* ========== LAYOUT HELPERS ========== */

/* Centers a single card both ways in the content area below the navbar.
   Used by auth/account/vip — any page whose whole content is "one card". */
.page-center-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 200px);
    padding: 48px 16px;
}

/* ========== CARD ========== */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.5);
}

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 20px;
    border-radius: 12px;
    border: 1px solid transparent;
    font-family: 'Hanken Grotesk', sans-serif;
    font-size: 14.5px;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background .18s ease, border-color .18s ease, color .18s ease,
                transform .15s ease, box-shadow .15s ease;
}
.btn:hover { text-decoration: none; }
.btn:disabled, .btn.disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }

.btn-block { display: flex; width: 100%; }
/* Caps a block button's width and centers it — the VIP page's CTAs sit
   narrower than the (wider) card that contains them. */
.btn-narrow { max-width: 340px; margin: 0 auto; }

.btn-sm { padding: 8px 16px; font-size: 13px; font-weight: 600; border-radius: 10px; }

.btn-primary { background: var(--accent-color); color: #fff; }
.btn-primary:hover { background: #7d3be6; }

.btn-gold {
    background: linear-gradient(135deg, var(--gold), var(--gold-2));
    color: #241a00;
}
.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(245, 197, 66, 0.3);
    color: #241a00;
}

.btn-ghost {
    background: transparent;
    border-color: var(--border-color-strong);
    color: var(--text-primary);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.06); color: var(--text-primary); }

/* Neutral secondary action — also the standard "logout" treatment site-wide.
   Deliberately grey, not red/purple: logging out isn't a destructive action
   and selected/secondary state should read as neutral, not alarming. */
.btn-neutral {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border-color);
    color: var(--text-secondary);
}
.btn-neutral:hover { background: rgba(255, 255, 255, 0.08); color: var(--text-primary); }

/* Small "Copy" action next to a value (account token, M3U8 URL, crypto address).
   Purple-accented by default so it reads as an actionable affordance; .btn-copy-gold
   swaps to a gold tint for pages already themed gold (VIP checkout). */
.btn-copy {
    flex-shrink: 0;
    height: 32px;
    padding: 0 14px;
    border-radius: 8px;
    border: 1px solid rgba(var(--accent-rgb), 0.3);
    background: rgba(var(--accent-rgb), 0.14);
    color: #b98bff;
    font-family: 'Hanken Grotesk', sans-serif;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease;
}
.btn-copy:hover { background: rgba(var(--accent-rgb), 0.22); }

.btn-copy-gold {
    border-color: rgba(245, 197, 66, 0.3);
    background: rgba(245, 197, 66, 0.12);
    color: var(--gold);
}
.btn-copy-gold:hover { background: rgba(245, 197, 66, 0.2); }

/* ========== FORM INPUT ========== */
.input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: 'Hanken Grotesk', sans-serif;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}
.input:focus { border-color: var(--accent-color); }
.input::placeholder { color: var(--text3); }

/* ========== COPY FIELD (value + Copy button row) ========== */
.copy-field {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px 12px;
}
.copy-field-value {
    flex: 1;
    min-width: 0;
    font-family: ui-monospace, monospace;
    font-size: 12.5px;
    color: var(--text-primary);
    word-break: break-all;
    line-height: 1.5;
    /* lets a click+drag or triple-click select the value manually, same
       fallback affordance as the one-time token reveal box on the auth page */
    user-select: all;
}

/* ========== MODAL ========== */
/* display:none <-> flex (not opacity) so the box's entrance animation replays
   on every open, and the modal is fully out of the a11y/tab-order tree while closed. */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, .72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-overlay.show { display: flex; }

.modal-box {
    position: relative;
    width: 100%;
    max-width: 440px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 28px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .6);
    max-height: 92vh;
    overflow-y: auto;
    animation: modalIn .22s ease;
}
@keyframes modalIn {
    from { opacity: 0; transform: translateY(10px) scale(.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
