/*
| -------------------------------------------------------------------------------
| DRACIN v1 - Professional Dark Theme
| Modern, Elegant, Premium Design
| -------------------------------------------------------------------------------
*/

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ============================================
   CSS VARIABLES - THEMING SYSTEM
   ============================================ */
:root {
    /* Dark Theme (Default) */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a24;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.06);
    --bg-glass: rgba(255, 255, 255, 0.05);

    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-tertiary: rgba(255, 255, 255, 0.5);
    --text-color: #ffffff;
    /* Default for Dark Mode */
    --text-muted: rgba(255, 255, 255, 0.3);

    --tag-bg: #2a2a45;
    /* Default for Dark Mode */

    /* Accent Colors */
    --accent-primary: #ff375f;
    --accent-secondary: #ff6b8a;
    --accent-gradient: linear-gradient(135deg, #ff375f 0%, #ff6b8a 50%, #a855f7 100%);
    --accent-glow: rgba(255, 55, 95, 0.3);

    /* Borders */
    --border-color: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.12);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px var(--accent-glow);

    /* Sizing */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* Typography */
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Light Theme */
[data-theme="light"] {
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e9ecef;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f3f5;
    --bg-glass: rgba(255, 255, 255, 0.95);

    --text-primary: #1a1a2e;
    --text-secondary: #2d3748;
    --text-tertiary: #4a5568;
    --text-color: #2d3748;
    /* Explicit text color for consistency */
    --text-muted: #718096;

    --tag-bg: #e2e8f0;
    /* Light background for tags */

    --border-color: #e2e8f0;
    --border-light: #cbd5e0;

    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

/* ============================================
   BASE STYLES
   ============================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* Background Pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(255, 55, 95, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(168, 85, 247, 0.08) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* ============================================
   HEADER STYLES
   ============================================ */
.dracin-header {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all var(--transition-normal);
}

.dracin-header:hover {
    background: rgba(255, 255, 255, 0.08);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: transform var(--transition-fast);
}

.logo-link:hover {
    transform: scale(1.02);
}

.logo-img {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Navigation */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    padding: 10px 18px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
    background: var(--bg-card-hover);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: var(--accent-primary);
    border-radius: 3px;
}

/* Theme Toggle Button */
.theme-toggle {
    width: 44px;
    height: 44px;
    border: none;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
    font-size: 1.2rem;
}

.theme-toggle:hover {
    background: var(--bg-card-hover);
    color: var(--accent-primary);
    transform: rotate(15deg);
}

/* ============================================
   CARD STYLES
   ============================================ */
.drama-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-normal);
    position: relative;
}

.drama-card:hover {
    transform: translateY(-8px);
    background: var(--bg-card-hover);
    border-color: var(--border-light);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.drama-card-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 2/3;
}

.drama-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.drama-card:hover .drama-card-image img {
    transform: scale(1.08);
}

.drama-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, transparent 60%);
    opacity: 0;
    transition: opacity var(--transition-normal);
    display: flex;
    align-items: flex-end;
    padding: 16px;
}

.drama-card:hover .drama-card-overlay {
    opacity: 1;
}

.drama-card-content {
    padding: 16px;
}

.drama-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.drama-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--text-tertiary);
}

.drama-card-episodes {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--accent-primary);
    color: white;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}

/* Genre Tags */
.genre-tag {
    display: inline-flex;
    padding: 6px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 100px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.genre-tag:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

/* ============================================
   SECTION STYLES
   ============================================ */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 24px;
    background: var(--accent-gradient);
    border-radius: 4px;
}

.section-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all var(--transition-fast);
}

.section-link:hover {
    gap: 10px;
}

/* ============================================
   GRID LAYOUTS
   ============================================ */
.drama-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 24px;
}

@media (min-width: 768px) {
    .drama-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

@media (min-width: 1200px) {
    .drama-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero-section {
    position: relative;
    padding: 60px 24px;
    overflow: hidden;
}

.hero-content {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
}

@media (min-width: 992px) {
    .hero-content {
        grid-template-columns: 1.2fr 1fr;
        align-items: center;
    }
}

.hero-featured {
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.hero-featured img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
}

.hero-featured-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.5) 50%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 32px;
}

.hero-featured-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 12px;
    color: white;
}

.hero-featured-desc {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    font-family: var(--font-main);
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), var(--shadow-glow);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
}

.btn-icon {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: var(--radius-md);
}

/* ============================================
   SEARCH BOX
   ============================================ */
.search-box {
    position: relative;
    max-width: 400px;
}

.search-input {
    width: 100%;
    padding: 14px 20px 14px 50px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 1rem;
    transition: all var(--transition-fast);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* ============================================
   FOOTER
   ============================================ */
.dracin-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 48px 24px 24px;
    margin-top: 80px;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
}

.footer-section h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: var(--text-tertiary);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--accent-primary);
}

.footer-bottom {
    max-width: 1400px;
    margin: 40px auto 0;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ============================================
   CATEGORY PAGE
   ============================================ */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    padding: 24px;
}

.category-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    text-align: center;
    text-decoration: none;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.category-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.category-card:hover::before {
    opacity: 0.1;
}

.category-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    display: block;
}

.category-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    position: relative;
    z-index: 1;
}

.category-count {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    margin-top: 6px;
    position: relative;
    z-index: 1;
}

/* ============================================
   LOADING & ANIMATIONS
   ============================================ */
@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.skeleton {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    position: relative;
    overflow: hidden;
}

.skeleton::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shimmer 1.5s infinite;
}

/* Fade in animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeInUp 0.5s ease forwards;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */
@media (max-width: 768px) {
    .header-container {
        height: 60px;
        padding: 0 16px;
    }

    .logo-text {
        font-size: 1.2rem;
    }

    .nav-menu {
        display: none;
    }

    .section-title {
        font-size: 1.2rem;
    }

    .drama-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }

    .drama-card-content {
        padding: 10px;
    }

    .drama-card-title {
        font-size: 0.85rem;
    }

    .hero-featured-title {
        font-size: 1.4rem;
    }

    .btn {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* ============================================
   UTILITIES
   ============================================ */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

.section {
    padding: 48px 0;
}

.text-gradient {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.glass-effect {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}