:root {
    /* Brand Colors - Production Ready */
    --primary: #e50914;
    --primary-dark: #b20710;
    --primary-light: #ff2a34;
    
    /* Background */
    --bg-dark: #0a0a0a;
    --bg-card: #141414;
    --bg-card-hover: #1a1a1a;
    
    /* Text */
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --text-muted: #808080;
    
    /* Border */
    --border: #2a2a2a;
    --border-light: #333333;
    
    /* Shadow */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.6);
    
    /* Radius */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* Layout */
    --container-width: 1400px;
    --spacing: 1.5rem;
    
    /* Transition */
    --transition: 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 62.5%;
    scroll-behavior: smooth;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.6rem;
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(180deg, #050505 0%, var(--bg-dark) 100%);
    min-height: 100vh;
}

a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--primary-light);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Prevent horizontal scroll on mobile */
.nav-wrap,
.hero-banner,
.card-grid,
.episode-grid,
.watch-layout,
.detail-shell {
    max-width: 100%;
    overflow-x: hidden;
}

.container {
    max-width: var(--container-width);
    width: 100%;
    margin: 0 auto;
    padding: 0 var(--spacing);
    overflow-x: hidden;
}

/* HEADER */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
}

.nav-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing);
    padding: 1rem 0;
    min-height: 70px;
}

.brand {
    display: flex;
    align-items: center;
    font-size: 1.8rem;
    font-weight: 700;
    transition: transform 0.2s;
    white-space: nowrap;
}

.brand:hover {
    transform: scale(1.05);
    color: var(--text-primary);
}

.brand-badge {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 20px rgba(229, 9, 20, 0.5);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.nav-links {
    display: flex;
    gap: var(--spacing);
}

.nav-links a {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 0.8rem 1.2rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.nav-links a:hover {
    color: var(--primary-light);
    background: rgba(229, 9, 20, 0.1);
}

.nav-links a.active {
    color: var(--primary);
    background: rgba(229, 9, 20, 0.15);
}

.search-box {
    display: flex;
    gap: 0.8rem;
    margin: 0;
}

.search-box input {
    margin: 0;
    min-width: 280px;
    height: 42px;
    padding: 0 1.6rem;
    background: #1c1c1c;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1.4rem;
    transition: all var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.1);
}

.button,
button,
input[type="submit"] {
    padding: 1.1rem 2rem;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: var(--shadow-sm);
}

.button:hover,
button:hover,
input[type="submit"]:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border-light);
}

.btn-outline:hover {
    border-color: var(--primary);
    background: rgba(229, 9, 20, 0.1);
    color: var(--primary-light);
}

.badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: rgba(229, 9, 20, 0.15);
    border: 1px solid rgba(229, 9, 20, 0.3);
    border-radius: 999px;
    color: #ff6b6b;
    font-size: 1.2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* HERO */
.hero {
    padding: 2rem 0;
}

.hero-banner {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 2rem;
    background: linear-gradient(135deg, var(--bg-card), #0a0a0a);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.hero-copy h1 {
    font-size: 4.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin: 1rem 0;
}

.hero-copy p {
    font-size: 1.8rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.hero-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, rgba(229, 9, 20, 0.1), rgba(0, 0, 0, 0.5));
}

.hero-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.hero-thumb:hover img {
    transform: scale(1.05);
}

.hero-thumb-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    height: 100%;
    padding: 2rem;
    color: var(--text-muted);
}

.hero-label {
    position: absolute;
    top: 1rem;
    left: 1rem;
    padding: 0.6rem 1.4rem;
    background: var(--primary);
    border-radius: 999px;
    font-size: 1.2rem;
    font-weight: 700;
    text-transform: uppercase;
    box-shadow: var(--shadow-md);
}

/* CONTINUE WATCHING */
.continue-watch-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing);
    padding: var(--spacing) 2rem;
    background: linear-gradient(90deg, rgba(229, 9, 20, 0.15), rgba(229, 9, 20, 0.05));
    border: 1px solid rgba(229, 9, 20, 0.3);
    border-radius: var(--radius-lg);
    margin: 2rem 0;
}

.continue-watch-content h3 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.continue-watch-content p {
    font-size: 1.4rem;
    color: var(--text-secondary);
}

.continue-watch-actions {
    display: flex;
    gap: 1rem;
}

/* SECTIONS */
.section {
    padding: 3rem 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 2.8rem;
    font-weight: 700;
}

.section-header a {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary);
}

/* CARDS */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: var(--spacing);
}

.drama-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition);
    box-shadow: var(--shadow-sm);
}

.drama-card:hover {
    transform: translateY(-8px);
    border-color: rgba(229, 9, 20, 0.5);
    box-shadow: var(--shadow-lg);
}

.thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 9/11;
    background: linear-gradient(135deg, rgba(229, 9, 20, 0.1), rgba(0, 0, 0, 0.5));
    overflow: hidden;
}

.thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.drama-card:hover .thumb img {
    transform: scale(1.1);
}

.thumb-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    height: 100%;
    padding: var(--spacing);
    color: var(--text-muted);
}

.card-body {
    padding: var(--spacing);
}

.card-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
    min-height: 4rem;
}

.card-meta {
    font-size: 1.3rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.5;
    min-height: 3.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
}

.card-body .button {
    width: 100%;
    padding: 0.9rem;
    font-size: 1.4rem;
}

/* DETAIL PAGE */
.hero-detail {
    padding: 3rem 0;
}

.detail-shell {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
}

.poster-box {
    width: 100%;
    aspect-ratio: 2/3;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-md);
}

.poster-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.poster-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    height: 100%;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(229, 9, 20, 0.1), rgba(0, 0, 0, 0.5));
    color: var(--text-muted);
}

.detail-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing);
}

.detail-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin: 0.5rem 0;
}

.detail-meta {
    font-size: 1.5rem;
    color: var(--text-secondary);
    padding-bottom: 1rem;
    border-bottom: 1px solid #1f1f1f;
}

.detail-desc {
    font-size: 1.6rem;
    line-height: 1.7;
    color: var(--text-secondary);
    max-height: 300px;
    overflow-y: auto;
}

.detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem 0;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: var(--spacing);
}

.info-card {
    padding: 1rem 1.5rem;
    background: #0a0a0a;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.info-label {
    display: block;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.info-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 600;
}

/* EPISODES */
.section-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.section-title {
    font-size: 2.4rem;
    font-weight: 700;
    margin-bottom: 2rem;
}

.episode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

.episode-card {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    padding: var(--spacing);
    background: #0a0a0a;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all var(--transition);
}

.episode-card:hover {
    border-color: var(--primary);
    background: var(--bg-card-hover);
    transform: translateX(4px);
}

.episode-card.active {
    border-color: var(--primary);
    background: rgba(229, 9, 20, 0.1);
}

.episode-number {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
}

.episode-title {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.4;
}

.episode-subtitle,
.episode-action {
    font-size: 1.2rem;
    color: var(--text-muted);
}

/* WATCH PAGE */
.watch-page {
    padding: 2rem 0;
}

.watch-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 2rem;
}

.player-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

.player-title {
    font-size: 2.6rem;
    font-weight: 700;
    margin: 1rem 0;
}

.player-meta {
    font-size: 1.4rem;
    color: var(--text-secondary);
}

.video-frame {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin: var(--spacing) 0;
    box-shadow: var(--shadow-lg);
}

.video-frame video,
.video-frame iframe,
.video-frame img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.player-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    height: 100%;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(229, 9, 20, 0.1), #000);
    color: var(--text-muted);
}

.player-actions {
    display: flex;
    gap: 1rem;
    margin-top: var(--spacing);
}

.right-column {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.info-panel,
.side-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--spacing);
    box-shadow: var(--shadow-md);
}

.drama-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0.5rem 0;
}

.drama-desc {
    font-size: 1.4rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: var(--spacing);
    max-height: 150px;
    overflow-y: auto;
}

.meta-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.meta-chip {
    padding: 0.6rem 1.2rem;
    background: #0a0a0a;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.episode-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 600px;
    overflow-y: auto;
}

/* SEARCH PAGE */
.search-page {
    padding: 2rem 0;
}

.search-hero {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
}

.search-title {
    font-size: 3rem;
    font-weight: 700;
    margin: 1rem 0;
}

.search-subtitle {
    font-size: 1.6rem;
    color: var(--text-secondary);
}

.result-count {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(229, 9, 20, 0.1);
    border: 1px solid rgba(229, 9, 20, 0.3);
    border-radius: var(--radius-md);
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--primary);
}

/* EMPTY STATE */
.empty-state {
    padding: 3rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.6rem;
}

/* FOOTER */
.site-footer {
    padding: 3rem 0;
    margin-top: 3rem;
    border-top: 1px solid #1f1f1f;
    text-align: center;
    color: var(--text-muted);
    font-size: 1.4rem;
}

/* SCROLLBAR */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #0a0a0a;
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-dim);
}

/* RESPONSIVE */
@media (max-width: 1200px) {
    .watch-layout {
        grid-template-columns: 1fr 320px;
    }
}

@media (max-width: 991px) {
    .hero-banner {
        grid-template-columns: 1fr;
    }
    
    .nav-links {
        display: none;
    }
    
    .search-box {
        width: 100%;
    }
    
    .search-box input {
        min-width: 0;
        width: 100%;
    }
    
    .nav-wrap {
        flex-wrap: wrap;
    }
    
    .detail-shell {
        grid-template-columns: 1fr;
    }
    
    .poster-box {
        max-width: 300px;
        margin: 0 auto;
    }
    
    .watch-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0 1rem;
    }
    
    .hero-copy h1 {
        font-size: 3.2rem;
    }
    
    .hero-copy p {
        font-size: 1.6rem;
    }
    
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .continue-watch-box {
        flex-direction: column;
        text-align: center;
    }
    
    .episode-grid {
        grid-template-columns: 1fr;
    }
}

/* LOADING */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s ease-out;
}

.page-loader.hidden {
    opacity: 0;
    pointer-events: none;
}

.page-loader .spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.page-loader .loading-text {
    margin-top: 2rem;
    color: var(--text-secondary);
    font-size: 1.6rem;
    font-weight: 500;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.watch-page {
    animation: fadeIn 0.4s ease-out;
}
