/* ========================================
   DramaMe - Modern Responsive Stylesheet
   Mobile-First Design with Enhanced Visuals
======================================== */

/* ============ CSS Variables ============ */
:root {
    /* Colors */
    --primary-500: #3b82f6;
    --primary-600: #2563eb;
    --primary-700: #1d4ed8;
    --cyan-400: #22d3ee;
    --cyan-500: #06b6d4;
    --cyan-600: #0891b2;
    
    --purple-500: #8b5cf6;
    --pink-500: #ec4899;
    --emerald-500: #10b981;
    --teal-500: #14b8a6;
    --red-500: #ef4444;
    --red-600: #dc2626;
    
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: 4rem;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.16, 1, 0.3, 1);
    --transition-normal: 300ms cubic-bezier(0.16, 1, 0.3, 1);
    --transition-slow: 500ms cubic-bezier(0.16, 1, 0.3, 1);
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;
}

/* ============ Global Reset & Base ============ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, 'Helvetica Neue', Arial, sans-serif;
    background:
        radial-gradient(1200px 600px at 10% -10%, rgba(59, 130, 246, 0.18), transparent 60%),
        radial-gradient(900px 500px at 90% -20%, rgba(6, 182, 212, 0.18), transparent 55%),
        linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--gray-800);
    line-height: 1.6;
    letter-spacing: 0.1px;
    opacity: 0;
    animation: pageFadeIn 300ms ease-out forwards;
}

@keyframes pageFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

:focus-visible {
    outline: 3px solid var(--cyan-500);
    outline-offset: 2px;
}

/* ============ Typography ============ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--gray-900);
}

h1 { font-size: clamp(1.75rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); }

/* ============ Header ============ */
.header {
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--cyan-500) 50%, var(--primary-600) 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.header h1 {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    font-weight: 800;
    background: linear-gradient(to right, #fff, #e0f2fe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.025em;
}

.header nav {
    display: flex;
    gap: var(--spacing-lg);
    flex-wrap: wrap;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.theme-toggle {
    position: relative;
    width: 64px;
    height: 32px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.15);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
    transition: all var(--transition-normal);
}

.theme-toggle .icon {
    font-size: 0.9rem;
    color: #fff;
    opacity: 0.9;
}

.theme-toggle::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    left: 4px;
    transition: transform var(--transition-normal);
    box-shadow: var(--shadow-md);
}

.dark-theme .theme-toggle::after {
    transform: translateX(28px);
}

.lang-switch select {
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.12);
    color: white;
    outline: none;
    font-weight: 600;
}

/* Dark theme color overrides - biru muda menjadi biru gelap */
.dark-theme {
    --primary-500: #1e40af;  /* biru gelap (dari #3b82f6) */
    --primary-600: #1e3a8a;  /* biru lebih gelap (dari #2563eb) */
    --primary-700: #1e3a8a;  /* biru paling gelap (dari #1d4ed8) */
    --cyan-400: #0e7490;     /* cyan gelap (dari #22d3ee) */
    --cyan-500: #0891b2;     /* cyan gelap (dari #06b6d4) */
    --cyan-600: #0e7490;     /* cyan lebih gelap (dari #0891b2) */
}

.dark-theme body {
    background:
        radial-gradient(1200px 600px at 10% -10%, rgba(30, 64, 175, 0.12), transparent 60%),
        radial-gradient(900px 500px at 90% -20%, rgba(14, 116, 144, 0.12), transparent 55%),
        linear-gradient(180deg, #0b1220 0%, #0f172a 100%);
    color: #e5e7eb;
}

.dark-theme .card,
.dark-theme .admin-nav,
.dark-theme .site-footer,
.dark-theme .modal-card,
.dark-theme table {
    background: rgba(15, 23, 42, 0.92);
    border-color: rgba(148, 163, 184, 0.15);
}

.dark-theme .drama-card,
.dark-theme .banner-item {
    background: #0f172a;
}

.dark-theme .drama-title,
.dark-theme .section-header h2,
.dark-theme .footer-brand,
.dark-theme h1,
.dark-theme h2,
.dark-theme h3 {
    color: #f8fafc;
}

.dark-theme .section-header p,
.dark-theme .footer-desc,
.dark-theme .footer-links,
.dark-theme .drama-stats,
.dark-theme .highlight-desc,
.dark-theme .tag {
    color: #cbd5f5;
}

.dark-theme .tag {
    background: rgba(148, 163, 184, 0.15);
    border-color: rgba(148, 163, 184, 0.2);
}

.dark-theme .search-bar input,
.dark-theme .form-group input,
.dark-theme .form-group textarea,
.dark-theme .form-group select {
    background: #0f172a;
    color: #e5e7eb;
    border-color: rgba(148, 163, 184, 0.2);
}

.dark-theme .search-bar input::placeholder {
    color: #94a3b8;
}

.lang-switch option {
    color: #111827;
}

.header a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: all var(--transition-fast);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    position: relative;
}

.nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    padding: 0;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    transition: all var(--transition-normal);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.icon-svg {
    width: 26px;
    height: 26px;
    fill: #fff;
    transition: transform var(--transition-normal);
}

.header a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: white;
    transform: translateX(-50%);
    transition: width var(--transition-fast);
}

.header a:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.header a:hover .icon-svg {
    transform: scale(1.1);
}

.header a:hover::after {
    width: 70%;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

/* ============ Hero Section ============ */
.hero {
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--cyan-500) 50%, var(--primary-500) 100%);
    color: white;
    padding: clamp(2rem, 8vw, 5rem) 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-grid {
    display: grid;
    gap: clamp(1.5rem, 4vw, 3rem);
    align-items: center;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.hero-content {
    text-align: left;
}

.hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.9rem;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.hero-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.hero-card {
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-2xl);
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    text-align: left;
}

.hero-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.hero-card-subtitle {
    opacity: 0.9;
    margin-bottom: 1rem;
}

.hero-card-meta {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    font-size: 0.9rem;
    opacity: 0.95;
}

.hero::before,
.hero::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    opacity: 0.15;
    animation: float 6s ease-in-out infinite;
}

.hero::before {
    top: -10%;
    left: -5%;
    width: 40%;
    height: 80%;
    background: radial-gradient(circle, rgba(255,255,255,0.4) 0%, transparent 70%);
    animation-delay: 0s;
}

.hero::after {
    bottom: -10%;
    right: -5%;
    width: 50%;
    height: 90%;
    background: radial-gradient(circle, rgba(6,182,212,0.5) 0%, transparent 70%);
    animation-delay: 3s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(20px, 20px) scale(1.05); }
}

.hero .container {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: clamp(2rem, 6vw, 3.5rem);
    font-weight: 900;
    margin-bottom: var(--spacing-md);
    color: white;
    text-shadow: 0 4px 12px rgba(0,0,0,0.2);
    letter-spacing: -0.025em;
}

.hero p {
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto;
    text-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* ============ Container ============ */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.page-section {
    padding: clamp(1.5rem, 4vw, 3rem) var(--spacing-md);
}

/* ============ Card ============ */
.card {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
    padding: clamp(1rem, 3vw, 2rem);
    margin-bottom: var(--spacing-xl);
    border: 1px solid rgba(219, 234, 254, 0.5);
    transition: all var(--transition-normal);
}

.section-card {
    border: 1px solid rgba(59, 130, 246, 0.1);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.section-header h2 {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    margin-bottom: 0.25rem;
}

.section-header p {
    color: var(--gray-600);
    font-size: 0.95rem;
}

.tag-sections {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.tag-section {
    padding-top: 0.5rem;
}

.tag-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.tag-section-header h3 {
    font-size: clamp(1.05rem, 2.5vw, 1.35rem);
    color: var(--gray-900);
}

.tag-section-header a {
    color: var(--primary-500);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.tag-section-header a:hover {
    color: var(--cyan-500);
}

.load-more-wrap {
    display: flex;
    justify-content: center;
    margin-top: 1.25rem;
}

.pagination {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 1.25rem;
}

.pagination .btn {
    padding: 0.5rem 0.9rem;
    font-size: 0.85rem;
}

.card:hover {
    box-shadow: var(--shadow-2xl);
    transform: translateY(-4px);
}

/* ============ Drama Grid ============ */
.drama-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: clamp(1rem, 2.5vw, 1.5rem);
    margin-top: var(--spacing-lg);
}

.highlight-grid {
    display: grid;
    gap: clamp(0.75rem, 2vw, 1.25rem);
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    margin-bottom: var(--spacing-xl);
}

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

.banner-item {
    background: white;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    text-decoration: none;
    color: inherit;
    transition: all var(--transition-normal);
    border: 1px solid rgba(59, 130, 246, 0.1);
}

.banner-item img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
}

.banner-title {
    padding: 0.75rem 1rem;
    font-weight: 600;
}

.banner-text {
    padding: 0 1rem 0.9rem;
    color: var(--gray-600);
    font-size: 0.9rem;
}

.banner-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    backdrop-filter: blur(4px);
}

.modal-card {
    background: white;
    border-radius: var(--radius-2xl);
    padding: 0.75rem;
    max-width: 560px;
    width: 100%;
    box-shadow: var(--shadow-2xl);
    position: relative;
}

.modal-card img {
    width: 100%;
    height: auto;
    border-radius: var(--radius-xl);
    display: block;
}

.banner-popup-text {
    margin-top: 0.75rem;
    color: var(--gray-700);
    font-size: 0.95rem;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 14px;
    border: none;
    background: rgba(0, 0, 0, 0.4);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.6);
}

.highlight-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--radius-xl);
    padding: 1.25rem;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(59, 130, 246, 0.12);
    transition: all var(--transition-normal);
}

.highlight-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.highlight-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.highlight-title {
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.highlight-desc {
    color: var(--gray-600);
    font-size: 0.95rem;
}

/* ============ Drama Card ============ */
.drama-card {
    cursor: pointer;
    transition: all var(--transition-normal);
    border-radius: var(--radius-xl);
    overflow: hidden;
    background: white;
    box-shadow: var(--shadow-md);
    position: relative;
}

.drama-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary-500), var(--cyan-500));
    opacity: 0;
    transition: opacity var(--transition-normal);
    z-index: -1;
}

.drama-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 18px 40px rgba(59, 130, 246, 0.22);
}

.drama-card:hover::before {
    opacity: 0.05;
}

.drama-card img {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

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

.drama-info {
    padding: clamp(0.75rem, 1.8vw, 1.1rem);
}

.drama-title {
    font-weight: 600;
    font-size: clamp(0.75rem, 1.5vw, 0.9rem);
    color: var(--gray-900);
    margin-bottom: var(--spacing-sm);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.drama-stats {
    display: flex;
    justify-content: space-between;
    font-size: clamp(0.7rem, 1.2vw, 0.8rem);
    color: var(--gray-500);
    margin-top: var(--spacing-sm);
}

.corner-badge {
    position: absolute;
    top: var(--spacing-sm);
    right: var(--spacing-sm);
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-md);
    font-size: clamp(0.6rem, 1vw, 0.7rem);
    font-weight: 700;
    color: white;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ============ Tags ============ */
.drama-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-sm);
}

.tag {
    background: linear-gradient(135deg, #dbeafe 0%, #cffafe 100%);
    color: #0369a1;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: clamp(0.65rem, 1vw, 0.75rem);
    font-weight: 600;
    transition: all var(--transition-fast);
    border: 1px solid rgba(3, 105, 161, 0.1);
}

.tag:hover {
    background: linear-gradient(135deg, #bfdbfe 0%, #a5f3fc 100%);
    transform: scale(1.05);
}

/* ============ Trending Keywords ============ */
.trending-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.keyword-badge {
    background: linear-gradient(135deg, #dbeafe 0%, #cffafe 100%);
    color: #0369a1;
    padding: clamp(0.5rem, 1.5vw, 0.75rem) clamp(1rem, 2vw, 1.25rem);
    border-radius: var(--radius-full);
    font-size: clamp(0.8rem, 1.5vw, 0.95rem);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-md);
    border: 2px solid transparent;
}

.keyword-badge:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 12px 24px rgba(3, 105, 161, 0.2);
    background: linear-gradient(135deg, #bfdbfe 0%, #a5f3fc 100%);
    border-color: rgba(3, 105, 161, 0.3);
}

.keyword-badge:active {
    transform: translateY(-2px) scale(1.02);
}

/* ============ Loading ============ */
.loading {
    text-align: center;
    padding: clamp(2rem, 5vw, 4rem);
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--primary-500);
    font-weight: 600;
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* ============ Search Bar ============ */
.search-bar {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.search-bar input {
    flex: 1;
    padding: clamp(0.75rem, 2vw, 1rem);
    border: 2px solid #dbeafe;
    border-radius: var(--radius-xl);
    font-size: clamp(0.9rem, 1.5vw, 1rem);
    outline: none;
    transition: all var(--transition-normal);
    background: white;
    box-shadow: var(--shadow-sm);
}

.search-bar input:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1), var(--shadow-md);
    transform: translateY(-2px);
}

.search-bar button {
    padding: clamp(0.75rem, 2vw, 1rem) clamp(1.5rem, 3vw, 2rem);
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--cyan-500) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-xl);
    font-weight: 700;
    font-size: clamp(0.9rem, 1.5vw, 1rem);
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: 0 12px 28px rgba(59, 130, 246, 0.35);
}

.search-bar button:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(59, 130, 246, 0.4);
}

.search-bar button:active {
    transform: translateY(-1px);
}

/* ============ Button ============ */
.btn {
    padding: clamp(0.65rem, 1.5vw, 0.85rem) clamp(1.25rem, 2.5vw, 1.75rem);
    border-radius: var(--radius-xl);
    font-weight: 600;
    font-size: clamp(0.85rem, 1.2vw, 0.95rem);
    cursor: pointer;
    border: none;
    transition: all var(--transition-normal);
    display: inline-block;
    text-align: center;
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.12);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: none;
}

.btn-ghost:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.18);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--cyan-500) 100%);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(59, 130, 246, 0.35);
}

.dark-theme .btn-primary:hover {
    box-shadow: 0 14px 30px rgba(30, 64, 175, 0.35);
}

.btn-primary:active {
    transform: translateY(-1px);
}

.btn-disabled,
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    background: var(--gray-400);
    border-color: var(--gray-400);
    color: var(--gray-600);
}

.btn-disabled:hover,
.btn:disabled:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
}

.btn-danger {
    background: linear-gradient(135deg, var(--red-500) 0%, var(--red-600) 100%);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-danger:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(239, 68, 68, 0.35);
}

/* ============ Episode List ============ */
.episode-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.episode-item {
    background: white;
    border: 2px solid #dbeafe;
    border-radius: var(--radius-xl);
    padding: var(--spacing-md);
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.episode-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary-500), var(--cyan-500));
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.episode-item:hover {
    border-color: var(--primary-500);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.episode-item:hover::before {
    opacity: 0.05;
}

.episode-item.active {
    background: linear-gradient(135deg, #dbeafe 0%, #cffafe 100%);
    border-color: var(--primary-500);
    box-shadow: var(--shadow-md);
}

.episode-item.active::before {
    opacity: 0;
}

/* ============ Video Player ============ */
.video-player {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-2xl);
}

.video-player iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-player video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    background: #000;
}

.episode-controls {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.episode-controls .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ============ Admin Styles ============ */
.admin-nav {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    padding: var(--spacing-md);
    border-bottom: 2px solid #dbeafe;
    margin-bottom: var(--spacing-xl);
    box-shadow: var(--shadow-sm);
}

.site-footer {
    margin-top: var(--spacing-2xl);
    background: rgba(255, 255, 255, 0.92);
    border-top: 1px solid rgba(59, 130, 246, 0.12);
    backdrop-filter: blur(12px);
}

.footer-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    padding: clamp(1.5rem, 4vw, 2.5rem) 0;
}

.footer-brand {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.footer-desc {
    color: var(--gray-600);
    font-size: 0.95rem;
}

.footer-title {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    color: var(--gray-600);
    font-size: 0.95rem;
}

.footer-links a {
    color: var(--gray-700);
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--primary-500);
}

.footer-bottom {
    text-align: center;
    padding: 0.75rem 1rem 1.25rem;
    color: var(--gray-500);
    font-size: 0.85rem;
}

.admin-nav a {
    color: var(--primary-500);
    text-decoration: none;
    margin-right: var(--spacing-lg);
    font-weight: 500;
    transition: all var(--transition-fast);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    display: inline-block;
}

.admin-nav a:hover {
    background: #dbeafe;
    color: var(--cyan-500);
    transform: translateY(-2px);
}

/* ============ Form Styles ============ */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-group label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: 600;
    color: var(--gray-700);
    font-size: clamp(0.85rem, 1.2vw, 0.95rem);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: clamp(0.65rem, 1.5vw, 0.85rem);
    border: 2px solid #dbeafe;
    border-radius: var(--radius-xl);
    font-size: clamp(0.85rem, 1.2vw, 0.95rem);
    outline: none;
    transition: all var(--transition-normal);
    background: white;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

/* ============ Table ============ */
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

table th {
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--cyan-500) 100%);
    color: white;
    padding: var(--spacing-md);
    text-align: left;
    font-weight: 700;
    font-size: clamp(0.8rem, 1.2vw, 0.9rem);
}

table td {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--gray-200);
    font-size: clamp(0.8rem, 1.2vw, 0.9rem);
}

table tr:last-child td {
    border-bottom: none;
}

table tr:hover {
    background: var(--gray-50);
}

/* ============ Image Loading ============ */
img[data-src] {
    opacity: 0;
    transition: opacity var(--transition-normal);
}

img.loaded {
    opacity: 1;
}

.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton 1.5s ease-in-out infinite;
}

@keyframes skeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============ Responsive Breakpoints ============ */

/* Mobile First - Base Styles (up to 639px) */
@media (max-width: 639px) {
    .mobile-menu-toggle {
        display: block;
    }
    
    .header .container {
        flex-wrap: wrap;
        padding: 0.75rem 1rem;
    }
    
    .header h1 {
        font-size: clamp(1.1rem, 4vw, 1.5rem);
    }
    
    .header nav {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: var(--spacing-sm);
        order: 3;
        margin-top: 0.5rem;
    }
    
    .header nav.active {
        display: flex;
    }

    .header-actions {
        order: 2;
        gap: 0.5rem;
    }

    .nav-icon {
        width: 44px;
        height: 44px;
    }

    .icon-svg {
        width: 22px;
        height: 22px;
    }

    .theme-toggle {
        width: 56px;
        height: 28px;
    }

    .lang-switch {
        width: 100%;
        margin-top: 0.5rem;
        order: 4;
    }

    .lang-switch select {
        width: 100%;
        font-size: 0.875rem;
        padding: 0.4rem 0.6rem;
    }
    
    .header a {
        width: 100%;
        text-align: center;
    }
    
    .container {
        padding: 1rem 0.75rem;
    }

    .page-section {
        padding: 1.5rem 0.75rem;
    }
    
    .drama-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .episode-list {
        grid-template-columns: repeat(1, 1fr);
        gap: 0.75rem;
    }
    
    .hero {
        padding: 2rem 0.75rem;
    }

    .hero h1 {
        font-size: clamp(1.5rem, 6vw, 2rem);
    }
    
    .hero p {
        font-size: clamp(0.9rem, 3vw, 1rem);
    }

    .hero-content {
        text-align: center;
    }

    .hero-actions {
        justify-content: center;
        flex-direction: column;
        gap: 0.75rem;
    }

    .hero-actions .btn {
        width: 100%;
    }
    
    .card {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .section-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }

    .section-header h2 {
        font-size: clamp(1.1rem, 4vw, 1.5rem);
    }

    .banner-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .tag-section {
        margin-bottom: 1.5rem;
    }

    .tag-section-header {
        flex-direction: column;
        gap: 0.5rem;
    }

    .pagination {
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: center;
    }

    .pagination .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
    
    .admin-nav {
        flex-direction: column;
    }
    
    .admin-nav a {
        display: block;
        margin: var(--spacing-xs) 0;
        padding: 0.75rem;
    }
    
    table {
        font-size: 0.75rem;
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    table th,
    table td {
        padding: 0.5rem;
    }

    .search-bar {
        flex-direction: column;
        gap: 0.75rem;
    }

    .search-bar input {
        width: 100%;
    }

    .search-bar button {
        width: 100%;
    }

    .video-player {
        margin: 0 -0.75rem;
    }

    .video-player video {
        width: 100%;
        height: auto;
    }

    .episode-controls {
        flex-direction: column;
        gap: 0.75rem;
    }

    .episode-controls .btn {
        width: 100%;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        text-align: center;
    }

    .modal-card {
        width: 95%;
        max-width: 95%;
        margin: 1rem;
        padding: 1.5rem;
    }
}

/* Small Tablets & Large Phones (640px - 767px) */
@media (min-width: 640px) and (max-width: 767px) {
    .drama-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
    
    .search-bar {
        flex-direction: row;
    }
    
    .search-bar button {
        min-width: 120px;
    }

    .episode-list {
        grid-template-columns: repeat(2, 1fr);
    }

    .banner-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-actions {
        flex-direction: row;
    }

    .hero-actions .btn {
        width: auto;
    }
}

/* Tablets (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .drama-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1.25rem;
    }
    
    .episode-list {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .banner-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .container {
        padding: 1.5rem 1.25rem;
    }

    .page-section {
        padding: 2rem 1.25rem;
    }

    .hero {
        padding: 3rem 1.25rem;
    }

    .nav-icon {
        width: 48px;
        height: 48px;
    }

    .icon-svg {
        width: 24px;
        height: 24px;
    }
}

/* Small Desktops (1024px - 1279px) */
@media (min-width: 1024px) and (max-width: 1279px) {
    .drama-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 1.5rem;
    }

    .container {
        padding: 2rem 1.5rem;
    }

    .page-section {
        padding: 2.5rem 1.5rem;
    }

    .hero {
        padding: 4rem 1.5rem;
    }
}

/* Medium Desktops (1280px - 1535px) */
@media (min-width: 1280px) and (max-width: 1535px) {
    .drama-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 1.5rem;
    }

    .container {
        max-width: 1200px;
        margin: 0 auto;
        padding: 2rem 2rem;
    }
}

/* Large Desktops (1536px and up) */
@media (min-width: 1536px) {
    .drama-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 2rem;
    }

    .container {
        max-width: 1400px;
        margin: 0 auto;
        padding: 2.5rem 2rem;
    }

    .page-section {
        padding: 3rem 2rem;
    }
}

/* Very Small Screens (up to 375px) */
@media (max-width: 375px) {
    .drama-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .nav-icon {
        width: 40px;
        height: 40px;
    }

    .icon-svg {
        width: 20px;
        height: 20px;
    }

    .theme-toggle {
        width: 52px;
        height: 26px;
    }

    .header h1 {
        font-size: 1rem;
    }

    .card {
        padding: 0.75rem;
    }

    .hero {
        padding: 1.5rem 0.5rem;
    }
}

/* Landscape Mobile */
@media (max-width: 767px) and (orientation: landscape) {
    .hero {
        padding: 1.5rem 0.75rem;
    }

    .hero h1 {
        font-size: clamp(1.25rem, 4vw, 1.75rem);
    }

    .drama-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn, .drama-card, .episode-item, .nav-icon {
        -webkit-tap-highlight-color: rgba(59, 130, 246, 0.2);
        tap-highlight-color: rgba(59, 130, 246, 0.2);
    }

    .drama-card:active {
        transform: scale(0.98);
    }

    .btn:active {
        transform: scale(0.97);
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .icon-svg {
        shape-rendering: geometricPrecision;
    }
}

/* Accessibility - Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
    
    body {
        opacity: 1;
    }
}

/* Dark Mode Media Query Support */
@media (prefers-color-scheme: dark) {
    :root:not(.dark-theme):not(.light-theme) {
        /* Auto dark mode jika user belum set preference */
    }
}

/* ============ Utility Classes ============ */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-md); }
.gap-lg { gap: var(--spacing-lg); }

.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }
.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }

.p-sm { padding: var(--spacing-sm); }
.p-md { padding: var(--spacing-md); }
.p-lg { padding: var(--spacing-lg); }

/* ============ Print Styles ============ */
@media print {
    .header, .admin-nav, .btn, button { display: none; }
    body { background: white; }
    .card { box-shadow: none; border: 1px solid #ccc; }
}