:root {
    /* Light Theme (Default) */
    --bg-main: #f8fafc;
    --bg-secondary: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --header-bg: rgba(255, 255, 255, 0.85);
    --card-bg: #ffffff;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --glass-border: rgba(255, 255, 255, 0.4);
}

[data-theme="dark"] {
    /* Dark Theme */
    --bg-main: #0f172a;
    --bg-secondary: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #ef4444; /* OTT red accent */
    --accent-hover: #dc2626;
    --header-bg: rgba(15, 23, 42, 0.85);
    --card-bg: #1e293b;
    --border: #334155;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --glass-border: rgba(255, 255, 255, 0.1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    line-height: 1.5;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Header & Glassmorphism */
header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    transition: background 0.3s ease;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--accent);
}

/* Theme Toggle */
.theme-toggle {
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background 0.2s;
}
.theme-toggle:hover {
    background: var(--bg-secondary);
}

/* Main Layout */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Card Styles */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 2rem;
}

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

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.card-img {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    background: var(--bg-secondary);
}

.card-content {
    padding: 1rem;
}

.card-title {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-meta {
    font-size: 0.875rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
}

/* Details Page */
.hero-banner {
    position: relative;
    width: 100%;
    height: 60vh;
    min-height: 400px;
    background-size: cover;
    background-position: center;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, var(--bg-main) 10%, transparent 100%),
                linear-gradient(to top, var(--bg-main) 0%, transparent 100%);
}

[data-theme="dark"] .hero-overlay {
    background: linear-gradient(to right, var(--bg-main) 10%, rgba(15,23,42,0.4) 100%),
                linear-gradient(to top, var(--bg-main) 0%, transparent 100%);
}

.details-content {
    position: relative;
    z-index: 10;
    display: flex;
    gap: 3rem;
    max-width: 1400px;
    margin: -150px auto 0;
    padding: 0 2rem;
}

.poster-wrapper {
    flex-shrink: 0;
    width: 300px;
}

.poster-img {
    width: 100%;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--glass-border);
}

.info-wrapper {
    flex: 1;
    padding-top: 150px;
}

h1.title {
    font-size: 3rem;
    font-weight: 800;
    margin: 0 0 0.5rem 0;
    line-height: 1.1;
}

.tagline {
    font-size: 1.25rem;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 1.5rem;
}

.overview {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

/* Utilities */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}
.btn:hover {
    background: var(--accent-hover);
}

/* Responsive */
@media (max-width: 768px) {
    .details-content {
        flex-direction: column;
        margin-top: -50px;
    }
    .poster-wrapper {
        width: 200px;
        margin: 0 auto;
    }
    .info-wrapper {
        padding-top: 2rem;
        text-align: center;
    }
    .nav-links {
        display: none; /* Mobile menu needed */
    }
}
