/* ============================================================
   frontend.css — User-facing pages styles
   Dlstream streaming platform
   ============================================================ */

/* ── CSS Variables (overridden inline by PHP with DB values) ── */
@import url('https://fonts.googleapis.com/css2?family=Parkinsans:wght@300..800&family=Salsa&display=swap');

:root {
    --primary-color: #7c3aed;
    --accent-color: #a855f7;
    --rich-grad-1: #0a0a0c;
    --rich-grad-2: #1a0f14;
    --rich-grad-3: #140d1f;
    --rich-grad-4: #10232f;
    --grid-line: rgba(255,255,255,0.055);
}

/* ── Body & Background ── */
body {
    color: #e2e8f0;
    font-family: 'Parkinsans', system-ui, sans-serif;
    background:
        radial-gradient(1200px 600px at 12% 8%, rgba(255,69,58,0.12), transparent 60%),
        radial-gradient(900px 540px at 92% 16%, rgba(56,189,248,0.12), transparent 58%),
        linear-gradient(140deg, var(--rich-grad-1), var(--rich-grad-2), var(--rich-grad-3), var(--rich-grad-4));
    background-size: 160% 160%;
    animation: bodyShift 22s ease-in-out infinite;
    position: relative;
    min-height: 100vh;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 48px 48px;
    opacity: 0.35;
    pointer-events: none;
    z-index: -2;
}

body::after {
    content: '';
    position: fixed;
    inset: -25%;
    background: conic-gradient(
        from 0deg,
        rgba(255,46,99,0.18),
        rgba(14,165,233,0.16),
        rgba(251,146,60,0.18),
        rgba(168,85,247,0.12),
        rgba(255,46,99,0.18)
    );
    filter: blur(85px);
    pointer-events: none;
    z-index: -3;
}

@keyframes auroraSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #1a1a2e; }
::-webkit-scrollbar-thumb { background: #4a4a6a; border-radius: 3px; }
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }
.scrollbar-hide::-webkit-scrollbar { display: none; }

/* ── Utility ── */
.gradient-text {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.glass      { background: rgba(30,30,50,0.85);  border: 1px solid rgba(255,255,255,0.1); }
.glass-dark { background: rgba(15,15,25,0.92);  border: 1px solid rgba(255,255,255,0.08); }

/* ── Toggle checkbox ── */
.toggle-checkbox:checked { right: 0; border-color: var(--primary-color); }
.toggle-checkbox:checked + .toggle-label { background-color: var(--primary-color); }

/* ── Nav dropdown ── */
.nav-dropdown { display: none; }
.nav-item:hover .nav-dropdown { display: block; }

/* ── Content card overlay ── */
.content-card:hover .overlay { opacity: 1; }
.overlay { opacity: 0; transition: opacity 0.3s; background: linear-gradient(to top, rgba(0,0,0,0.9), transparent); }

/* ── Poster card ── */
.card-hover { transition: transform 0.3s, border-color 0.3s; }
.card-hover:hover { transform: translateY(-4px); box-shadow: none; }

.poster-card {
    border-radius: 12px;
    overflow: hidden;
    background: #1d1d1f;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 16px 30px rgba(0,0,0,0.35);
    transition: border-color 0.25s ease;
}
.card-hover:hover .poster-card {
    border-color: color-mix(in srgb, var(--accent-color) 72%, white 8%);
}
.poster-card .poster-image { aspect-ratio: 2/3; width: 100%; object-fit: cover; display: block; }
.poster-score {
    position: absolute; top: 10px; left: 10px;
    width: 34px; height: 34px; border-radius: 999px;
    border: 2px solid #34d399;
    background: linear-gradient(to bottom, rgba(0,0,0,0.78) 0%, rgba(0,0,0,0.78) 50%, rgba(0,0,0,0.36) 50%, rgba(0,0,0,0.36) 100%);
    text-shadow: 0 1px 1px rgba(0,0,0,0.85);
    color: #f8fafc; font-size: 12px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
.poster-card .poster-body  { padding: 0.875rem; }
.poster-card .poster-title {
    font-size: 1rem; line-height: 1.15; font-weight: 700; color: #f3f4f6;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.poster-card .poster-meta {
    margin-top: 0.625rem; display: flex; align-items: center;
    justify-content: space-between; gap: 0.625rem; font-size: 0.95rem; color: #9ca3af;
}
.poster-card .poster-badge {
    padding: 0.25rem 0.625rem; border-radius: 0.625rem;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: white; font-size: 0.75rem; font-weight: 700;
}

/* ── Gradient card ── */
.gradient-card {
    background: linear-gradient(150deg, rgba(32,18,26,0.88), rgba(18,20,36,0.88));
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 16px;
    box-shadow: 0 18px 38px rgba(0,0,0,0.32);
    backdrop-filter: blur(4px);
}

/* ── Neon button ── */
.neon-btn {
    background: linear-gradient(135deg, #080808 0%, #19090d 45%, #310d14 100%);
    border: 1px solid rgba(255,82,105,0.55);
    color: #f8fafc;
    box-shadow: 0 0 0 1px rgba(255,68,96,0.22), 0 0 16px rgba(255,47,85,0.35);
    transition: transform 0.2s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.neon-btn:hover {
    border-color: rgba(255,108,129,0.9);
    box-shadow: 0 0 0 1px rgba(255,108,129,0.4), 0 0 28px rgba(255,47,85,0.45);
    transform: translateY(-1px);
}
.neon-btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }

/* ── Footer ── */
.rich-footer {
    position: relative; width: 100%;
    background: linear-gradient(135deg, rgba(9,9,11,0.98), rgba(39,12,20,0.96), rgba(14,22,42,0.95), rgba(42,16,28,0.95));
    border-top: 1px solid rgba(255,255,255,0.15);
    overflow: hidden;
}
.rich-footer::before {
    content: ''; position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px);
    background-size: 44px 44px; opacity: 0.24; pointer-events: none;
}
.rich-footer::after {
    content: ''; position: absolute;
    width: 460px; height: 460px; right: -170px; top: -220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(244,63,94,0.25), transparent 68%);
    filter: blur(8px); pointer-events: none;
}

/* ── Hero slider ── */
.hero-slider .slide { transition: opacity 0.8s ease; }

/* ── Mobile nav ── */
@media (max-width: 767px) { body { padding-bottom: 5rem; } }
.mob-nav-item { transition: color 0.15s; }

/* ── Back to top ── */
#back-to-top { opacity: 0; pointer-events: none; transition: opacity 0.3s, transform 0.3s; transform: translateY(8px); }
#back-to-top.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }

/* ── JS toggle panels ── */
.js-toggle-panel { display: none; }
.js-toggle-panel.is-active { display: block; }
@media (min-width: 768px) { .js-mobile-panel { display: none !important; } }

/* ── Download chip ── */
.download-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px; border-radius: 999px;
    font-size: 12px; font-weight: 600; color: #fff;
    background: linear-gradient(135deg, #000000, #1a0000, #ff0000);
    background-size: 200% 200%;
    transition: all 0.3s ease;
    box-shadow: 0 0 8px rgba(255,0,0,0.3);
}
.download-chip:hover {
    background-position: right center;
    box-shadow: 0 0 12px rgba(255,0,0,0.7);
    transform: translateY(-2px) scale(1.05);
}

/* ── Show/Movie detail page ── */
.page-shell { max-width: 1320px; }
.player-wrap {
    position: relative; width: 100%; aspect-ratio: 16/9;
    border-radius: 0; overflow: hidden; border: 0; background: #000;
}
.player-wrap iframe, .player-wrap video {
    position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
}
.player-toolbar {
    position: absolute; top: 12px; left: 12px; right: 12px;
    display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; z-index: 2;
}
.toolbar-group { display: flex; flex-wrap: wrap; gap: 8px; }
.toolbar-select, .player-select {
    background: #16a34a; border: 0; color: #fff;
    font-size: 12px; padding: 7px 10px; border-radius: 4px; outline: none;
}
.toolbar-select option, .player-select option { background: #111827; color: #fff; }
.control-strip {
    display: flex; justify-content: space-between; align-items: center;
    gap: 12px; flex-wrap: wrap; padding: 10px 4px 0;
}
.control-inline { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.server-select {
    min-width: 220px;
    background: linear-gradient(135deg, #070707, #21090f);
    border: 1px solid rgba(255,94,114,0.55);
    box-shadow: 0 0 0 1px rgba(255,71,102,0.25), 0 0 18px rgba(255,71,102,0.2);
    color: #f3f4f6; padding: 0.65rem 0.9rem; border-radius: 0.75rem; outline: none;
}
.server-select option { background: #111827; color: #f9fafb; }
.download-strip {
    background: #242424; border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px; padding: 16px;
}
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.88);
    z-index: 9999; display: flex; align-items: center; justify-content: center;
    padding: 1rem; overflow-y: auto;
}
.modal-overlay.hidden { display: none !important; }
.detail-row {
    display: flex; gap: 0.5rem; padding: 0.65rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.06); font-size: 0.875rem;
}
.detail-row:last-child { border-bottom: none; }
.section-card {
    background: linear-gradient(150deg, rgba(36,18,24,0.85), rgba(16,20,34,0.9));
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 14px; box-shadow: 0 14px 30px rgba(0,0,0,0.3);
}
.server-pill {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.65rem 0.95rem; border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04); font-size: 0.82rem; transition: 0.2s;
}
.server-pill.active {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff; border-color: transparent;
}
.meta-poster { width: 96px; border-radius: 14px; border: 1px solid rgba(255,255,255,0.08); flex-shrink: 0; }
.cast-strip { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 4px; }
.cast-item {
    min-width: 190px; display: flex; align-items: center; gap: 12px;
    padding: 12px; border-radius: 14px;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
}
.similar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); gap: 14px; }
.similar-card {
    display: block; border-radius: 14px; overflow: hidden;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.07); transition: 0.2s;
}
.similar-card:hover { transform: translateY(-3px); border-color: rgba(124,58,237,0.45); }
.action-row { display: flex; flex-wrap: wrap; gap: 12px; }
.share-btn { display: inline-flex; align-items: center; gap: 0.5rem; }
.ep-thumb {
    width: 110px; height: 62px; object-fit: cover; border-radius: 8px;
    flex-shrink: 0; border: 1px solid rgba(255,255,255,0.1); background: #1a1a2e;
}
.accordion-shell { background: #1d1d1d; border: 1px solid rgba(255,255,255,0.06); border-radius: 14px; padding: 10px; }
.season-head { border-radius: 10px; }
.season-item { background: #202020; border: 1px solid rgba(255,255,255,0.08); border-radius: 10px; }
.season-item.active { border-color: #7c3aed; box-shadow: 0 0 0 1px rgba(124,58,237,0.4); }

/* ── Live sports page ── */
.live-dot {
    display: inline-block; width: 8px; height: 8px;
    border-radius: 50%; background: #ef4444;
    animation: blink 1.2s ease-in-out infinite;
}
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }
.channel-card { transition: transform 0.2s, box-shadow 0.2s; }
.channel-card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(139,92,246,0.25); }

/* ── Responsive ── */
@media (max-width: 768px) {
    .meta-poster { width: 80px; }
    .player-toolbar { position: static; padding: 12px 12px 0; }
    .control-strip { padding: 12px 0 0; }
    .server-select { width: 100%; min-width: 0; }
    .similar-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 480px) {
    .similar-grid { grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); }
}
