/* ═══════════════════════════════════════════
   Anime Portal — Dark Neon Theme
   ═══════════════════════════════════════════ */

:root {
    --bg-deep: #0d0b1a;
    --bg-dark: #151030;
    --bg-card: #1e1845;
    --bg-card-hover: #261e55;
    --bg-input: #1a1440;
    --border: #2d2560;
    --border-glow: #6c2bd9;

    --text: #e0d8f0;
    --text-muted: #8a7aaa;
    --text-bright: #ffffff;

    --accent-primary: #a855f7;
    --accent-secondary: #e040a0;
    --accent-gradient: linear-gradient(135deg, #6c2bd9, #e040a0);
    --accent-gradient-hover: linear-gradient(135deg, #7c3be9, #f050b0);
    --accent-glow: rgba(168, 85, 247, 0.4);
    --accent-glow-strong: rgba(168, 85, 247, 0.6);

    --success: #34d399;
    --error: #f87171;
    --free-badge: #38bdf8;
    --premium-badge: #fbbf24;

    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 30px rgba(168, 85, 247, 0.15);

    --font: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ── Reset & Base ─────────────────────────── */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg-deep);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--accent-secondary);
}

/* ── Animated Background Particles ────────── */

.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    border-radius: 50%;
    background: var(--accent-primary);
    opacity: 0;
    animation: float-up linear infinite;
}

@keyframes float-up {
    0% {
        opacity: 0;
        transform: translateY(100vh) scale(0);
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.2;
    }
    100% {
        opacity: 0;
        transform: translateY(-10vh) scale(1);
    }
}

/* ── Navbar ───────────────────────────────── */

.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: rgba(13, 11, 26, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.navbar-brand {
    font-size: 1.4rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.navbar-links {
    display: flex;
    align-items: center;
    gap: 12px;
}

.navbar-user {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ── Buttons ──────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.25s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent-gradient);
    color: #fff;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-primary:hover {
    background: var(--accent-gradient-hover);
    box-shadow: 0 6px 25px var(--accent-glow-strong);
    transform: translateY(-1px);
    color: #fff;
}

.btn-outline {
    background: transparent;
    color: var(--accent-primary);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    border-color: var(--accent-primary);
    background: rgba(168, 85, 247, 0.1);
    color: var(--accent-primary);
}

.btn-sm {
    padding: 6px 16px;
    font-size: 0.85rem;
}

.btn-block {
    width: 100%;
    padding: 14px;
    font-size: 1rem;
}

/* ── Badges ───────────────────────────────── */

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-premium {
    background: linear-gradient(135deg, var(--premium-badge), #f59e0b);
    color: #1a1030;
}

.badge-free {
    background: var(--free-badge);
    color: #0c2d48;
}

/* ── Flash Messages ───────────────────────── */

.flash {
    max-width: 600px;
    margin: 16px auto;
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    text-align: center;
    position: relative;
    z-index: 10;
    animation: flash-in 0.3s ease;
}

@keyframes flash-in {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.flash-success {
    background: rgba(52, 211, 153, 0.15);
    border: 1px solid rgba(52, 211, 153, 0.3);
    color: var(--success);
}

.flash-error {
    background: rgba(248, 113, 113, 0.15);
    border: 1px solid rgba(248, 113, 113, 0.3);
    color: var(--error);
}

/* ── Container ────────────────────────────── */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px;
    position: relative;
    z-index: 1;
}

/* ── Auth Forms ───────────────────────────── */

.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 40px 32px;
    box-shadow: var(--shadow), var(--shadow-glow);
    border: 1px solid var(--border);
}

.auth-title {
    font-size: 1.8rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 4px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 28px;
}

.auth-footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 24px;
}

/* ── Form Elements ────────────────────────── */

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.form-input::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

.form-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    font-size: 0.85rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    accent-color: var(--accent-primary);
}

.link-muted {
    color: var(--text-muted);
}

.link-muted:hover {
    color: var(--accent-primary);
}

.link-accent {
    color: var(--accent-primary);
    font-weight: 600;
}

/* ── Catalog ──────────────────────────────── */

.catalog-header {
    text-align: center;
    margin-bottom: 40px;
}

.catalog-title {
    font-size: 2.2rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.catalog-subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    margin-top: 8px;
}

/* ── Video Grid ───────────────────────────── */

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.video-card {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.video-card:hover {
    transform: translateY(-6px) scale(1.02);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow), 0 0 40px var(--accent-glow);
}

.video-card__link {
    position: absolute;
    inset: 0;
    z-index: 2;
}

.video-card__thumbnail {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--bg-dark);
    overflow: hidden;
}

.video-card__thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.video-card:hover .video-card__thumbnail img {
    transform: scale(1.08);
}

.video-card__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 3rem;
    color: var(--accent-primary);
    background: linear-gradient(135deg, var(--bg-dark), var(--bg-card));
}

.video-card__thumbnail .badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1;
}

.video-card__duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.video-card__body {
    padding: 16px;
}

.video-card__title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-bright);
    margin-bottom: 6px;
    line-height: 1.4;
}

.video-card__desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 8px;
}

.video-card__category {
    display: inline-block;
    font-size: 0.7rem;
    color: var(--accent-primary);
    background: rgba(168, 85, 247, 0.1);
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 600;
}

/* ── Watch Page ───────────────────────────── */

.watch-page {
    max-width: 900px;
    margin: 0 auto;
}

.player-container {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow), 0 0 60px var(--accent-glow);
    border: 1px solid var(--border);
    margin-bottom: 24px;
}

.video-player {
    width: 100%;
    display: block;
    background: #000;
}

.video-info {
    margin-bottom: 24px;
}

.video-info__title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-bright);
    margin-bottom: 10px;
}

.video-info__desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-top: 12px;
}

.btn-back {
    margin-top: 16px;
}

/* ── Empty State ──────────────────────────── */

.empty-state {
    text-align: center;
    padding: 80px 20px;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 16px;
}

.empty-state h2 {
    font-size: 1.5rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-muted);
    opacity: 0.7;
}

/* ── Error Page ───────────────────────────── */

.error-page {
    text-align: center;
    padding: 100px 20px;
}

.error-page h1 {
    font-size: 1.8rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* ── Footer ───────────────────────────────── */

.footer {
    text-align: center;
    padding: 32px 24px;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
    margin-top: 60px;
    position: relative;
    z-index: 1;
}

/* ── Responsive ───────────────────────────── */

@media (max-width: 768px) {
    .navbar {
        padding: 12px 16px;
    }

    .navbar-brand {
        font-size: 1.2rem;
    }

    .navbar-links {
        gap: 8px;
    }

    .navbar-user {
        display: none;
    }

    .container {
        padding: 20px 16px;
    }

    .catalog-title {
        font-size: 1.6rem;
    }

    .video-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .auth-card {
        padding: 28px 20px;
    }

    .auth-title {
        font-size: 1.4rem;
    }

    .video-info__title {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .video-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}
