/* ==========================================================================
   Fam.DeadMojo — Liquid Glass design system
   Frosted, translucent panels that let content/imagery bleed through from
   behind, per Apple's Liquid Glass material guidance: "clear" variant for
   panels over rich imagery (login), "regular" variant for panels over plain
   content (dashboard, admin) where legibility matters more.
   ========================================================================== */

:root {
    --bg-base: #08080c;
    --bg-base-2: #101018;

    --glass-bg-clear: rgba(255, 255, 255, 0.055);
    --glass-bg-regular: rgba(255, 255, 255, 0.09);
    --glass-bg-strong: rgba(255, 255, 255, 0.13);
    --glass-border: rgba(255, 255, 255, 0.16);
    --glass-border-strong: rgba(255, 255, 255, 0.24);
    --glass-highlight: rgba(255, 255, 255, 0.4);
    --glass-blur: 26px;

    --accent: #8b5cf6;
    --accent-2: #6366f1;
    --accent-soft: rgba(139, 92, 246, 0.35);

    --success: #34d399;
    --warning: #fbbf24;
    --danger: #f87171;
    --info: #60a5fa;

    --text-primary: #f5f5f7;
    --text-secondary: rgba(245, 245, 247, 0.68);
    --text-tertiary: rgba(245, 245, 247, 0.45);

    --radius-xl: 32px;
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 10px;

    --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.09);
    --shadow-glass-lg: 0 20px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);

    --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }

/* ---- Base glass panel ---------------------------------------------- */

.glass {
    position: relative;
    background: var(--glass-bg-regular);
    backdrop-filter: blur(var(--glass-blur)) saturate(180%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-glass);
}

.glass::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(180deg, var(--glass-highlight), transparent 40%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0.5;
}

/* "Clear" variant — for use over rich photographic backgrounds (login) */
.glass-clear {
    background: var(--glass-bg-clear);
    backdrop-filter: blur(34px) saturate(220%) brightness(1.1);
    -webkit-backdrop-filter: blur(34px) saturate(220%) brightness(1.1);
    border-color: rgba(255, 255, 255, 0.28);
    box-shadow: var(--shadow-glass-lg);
}

/* "Strong" variant — higher opacity, for elements needing max legibility */
.glass-strong {
    background: var(--glass-bg-strong);
    border-color: var(--glass-border-strong);
}

/* ---- Buttons ---------------------------------------------------------- */

.btn-glass {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.75rem;
    border-radius: 999px;
    border: 1px solid var(--glass-border-strong);
    background: var(--glass-bg-strong);
    backdrop-filter: blur(var(--glass-blur)) saturate(180%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.btn-glass:hover { background: rgba(255, 255, 255, 0.18); transform: translateY(-1px); }
.btn-glass:active { transform: translateY(0); }

.btn-accent {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 8px 24px var(--accent-soft), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn-accent:hover { box-shadow: 0 10px 30px var(--accent-soft), inset 0 1px 0 rgba(255, 255, 255, 0.3); }

.btn-danger {
    background: rgba(248, 113, 113, 0.18);
    border-color: rgba(248, 113, 113, 0.4);
    color: #ffd6d6;
}

.btn-sm { padding: 0.5rem 1.1rem; font-size: 0.85rem; }

/* ---- Form inputs -------------------------------------------------------- */

.input-glass {
    width: 100%;
    padding: 0.9rem 1.1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: var(--font-sans);
    outline: none;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.input-glass::placeholder { color: var(--text-tertiary); }
.input-glass:focus { border-color: var(--accent); background: rgba(255, 255, 255, 0.09); }

/* ---- Layout shell for logged-in pages ---------------------------------- */

.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.5rem;
    background: rgba(10, 10, 15, 0.55);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-bottom: 1px solid var(--glass-border);
}

.app-topbar .brand { display: flex; align-items: center; gap: 0.6rem; font-weight: 700; font-size: 1.1rem; }
.app-topbar .brand img { width: 28px; height: 28px; border-radius: 8px; }

.app-nav { display: flex; align-items: center; gap: 0.4rem; }

.app-nav a {
    padding: 0.55rem 1rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: background 0.15s ease, color 0.15s ease;
}

.app-nav a:hover { background: rgba(255, 255, 255, 0.08); color: var(--text-primary); }
.app-nav a.active { background: var(--glass-bg-strong); color: var(--text-primary); border: 1px solid var(--glass-border); }
.app-nav a.admin-link { color: var(--warning); }

.app-main {
    flex: 1;
    padding: 2rem 1.5rem 3rem;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

/* ---- Dashboard grid ----------------------------------------------------- */

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.25rem;
}

.grid-span-2 { grid-column: span 2; }

@media (max-width: 900px) {
    .grid-span-2 { grid-column: span 1; }
}

.card {
    padding: 1.5rem;
}

.card h2 {
    margin: 0 0 1rem;
    font-size: 1.05rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card h2 .dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.media-list-item {
    display: flex;
    gap: 0.85rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.media-list-item:last-child { border-bottom: none; }

.media-poster {
    width: 46px;
    height: 68px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.media-info { min-width: 0; font-size: 0.88rem; }
.media-info strong { display: block; font-size: 0.92rem; margin-bottom: 0.15rem; }
.media-info .meta { color: var(--text-tertiary); font-size: 0.8rem; }

.status-pill {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.2rem;
}

.progress-track {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
    margin: 0.5rem 0;
}

.progress-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transition: width 0.4s ease;
}

.download-item { padding: 0.75rem 0; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.download-item:last-child { border-bottom: none; }
.download-item .row { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; }
.download-item .title { font-size: 0.9rem; font-weight: 600; }
.download-item .pct { font-size: 0.85rem; color: var(--success); font-weight: 700; }

.empty-note { color: var(--text-tertiary); font-size: 0.88rem; padding: 0.5rem 0; }
.error-note { color: var(--danger); font-size: 0.85rem; }

/* ---- Coming soon panel --------------------------------------------------- */

.coming-soon-list { display: flex; flex-direction: column; gap: 0.75rem; }

.coming-soon-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.04);
    border: 1px dashed rgba(255, 255, 255, 0.15);
}

.coming-soon-item .icon { font-size: 1.3rem; }
.coming-soon-item .label { font-weight: 600; font-size: 0.92rem; }
.coming-soon-item .sub { font-size: 0.78rem; color: var(--text-tertiary); }
.coming-soon-item .badge {
    margin-left: auto;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: rgba(139, 92, 246, 0.2);
    color: #c4b5fd;
}

/* ---- Login page --------------------------------------------------------- */

.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 1.5rem;
}

.poster-bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; }

.poster-bg .poster-layer {
    position: absolute;
    inset: -5%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 2.5s ease-in-out;
    filter: saturate(1.1);
}

.poster-bg .poster-layer.active { opacity: 1; }

.poster-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at center, rgba(8, 8, 12, 0.25) 0%, rgba(8, 8, 12, 0.6) 78%),
        linear-gradient(180deg, rgba(8,8,12,0.15), rgba(8,8,12,0.45));
}

.login-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 400px;
    padding: 2.5rem 2.25rem;
    text-align: center;
}

.login-card .brand-mark { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; margin-bottom: 1.75rem; }
.login-card .brand-mark img { width: 64px; height: 64px; border-radius: 18px; box-shadow: 0 8px 24px rgba(0,0,0,0.4); }
.login-card .brand-mark h1 { margin: 0; font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }
.login-card .brand-mark p { margin: 0; color: var(--text-secondary); font-size: 0.88rem; }

.login-form { display: flex; flex-direction: column; gap: 0.85rem; }
.login-error {
    background: rgba(248, 113, 113, 0.15);
    border: 1px solid rgba(248, 113, 113, 0.35);
    color: #ffd6d6;
    padding: 0.65rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.login-card .btn-glass { width: 100%; margin-top: 0.4rem; }

.login-footnote { margin-top: 1.5rem; font-size: 0.78rem; color: var(--text-tertiary); }

/* ---- Requests paused page ------------------------------------------------ */

.notice-screen {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
}

.notice-card {
    max-width: 520px;
    padding: 2.5rem;
    text-align: center;
}

.notice-card .icon-badge {
    width: 64px; height: 64px;
    border-radius: 20px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem;
    margin: 0 auto 1.25rem;
    background: rgba(251, 191, 36, 0.15);
    border: 1px solid rgba(251, 191, 36, 0.35);
}

.notice-card h1 { font-size: 1.4rem; margin: 0 0 0.75rem; }
.notice-card p { color: var(--text-secondary); line-height: 1.6; margin: 0 0 0.5rem; }

/* ---- Admin -------------------------------------------------------------- */

.admin-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.admin-row:last-child { border-bottom: none; }
.admin-row .label { font-weight: 600; font-size: 0.95rem; }
.admin-row .desc { font-size: 0.82rem; color: var(--text-tertiary); margin-top: 0.15rem; }

.toggle-switch {
    position: relative;
    width: 52px;
    height: 30px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid var(--glass-border);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s ease;
}

.toggle-switch.on { background: var(--accent); }

.toggle-switch .knob {
    position: absolute;
    top: 2px; left: 2px;
    width: 24px; height: 24px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    transition: transform 0.2s ease;
}

.toggle-switch.on .knob { transform: translateX(22px); }

.admin-textarea {
    width: 100%;
    min-height: 90px;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    resize: vertical;
}

.page-title { font-size: 1.6rem; font-weight: 800; margin: 0 0 0.35rem; letter-spacing: -0.02em; }
.page-subtitle { color: var(--text-secondary); font-size: 0.92rem; margin: 0 0 1.75rem; }

@media (max-width: 700px) {
    .app-topbar { flex-wrap: wrap; gap: 0.5rem; padding: 0.75rem 1rem; }
    .app-nav { gap: 0.15rem; order: 3; width: 100%; overflow-x: auto; }
    .app-main { padding: 1.25rem 1rem 2rem; }
}
