/* ===== RESET & BASE ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --bg-card: #222222;
    --bg-hover: #2a2a2a;
    --text-primary: #ffffff;
    --text-secondary: #aaaaaa;
    --accent: #e50914;
    --accent-hover: #ff1a25;
    --accent-green: #46d369;
    --accent-yellow: #f5c518;
    --border: #333333;
    --radius: 8px;
    --shadow: 0 4px 20px rgba(0,0,0,0.5);
    --transition: 0.3s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition);
}

button {
    cursor: pointer;
    border: none;
    font-family: inherit;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== HEADER ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: linear-gradient(180deg, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.7) 70%, transparent 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: background var(--transition);
}

.header.scrolled {
    background: rgba(15, 15, 15, 0.95);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    height: 64px;
    gap: 32px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 24px;
    font-weight: 800;
}

.logo-icon {
    color: var(--accent);
}

.logo-text {
    color: var(--text-primary);
}

.logo-highlight {
    color: var(--accent);
}

.nav {
    display: flex;
    gap: 24px;
    flex: 1;
}

.nav-link {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    position: relative;
    padding: 4px 0;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent);
    border-radius: 1px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.search-box {
    position: relative;
}

.search-input {
    background: rgba(255,255,255,0.1);
    border: 1px solid transparent;
    border-radius: 20px;
    padding: 8px 16px 8px 36px;
    color: var(--text-primary);
    font-size: 14px;
    width: 220px;
    transition: all var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255,255,255,0.15);
    width: 280px;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.btn-login {
    background: var(--accent);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    transition: all var(--transition);
}

.btn-login:hover {
    background: var(--accent-hover);
    transform: scale(1.05);
}

.btn-search-mobile {
    display: none;
    background: none;
    color: var(--text-primary);
    padding: 8px;
    border-radius: 50%;
    transition: all var(--transition);
}

.btn-search-mobile:hover {
    background: rgba(255,255,255,0.1);
}

/* ===== HERO ===== */
.hero {
    position: relative;
    height: 80vh;
    min-height: 500px;
    max-height: 800px;
    overflow: hidden;
}

.hero-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center top;
    background-color: #1a1a2e;
}

.hero-slide[style*="url('#')"] {
    background-image: none !important;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

.hero-slide::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 50%, rgba(0,0,0,0.2) 100%),
                linear-gradient(0deg, var(--bg-primary) 0%, transparent 30%);
}

.hero-content {
    position: absolute;
    bottom: 15%;
    left: 24px;
    max-width: 600px;
    z-index: 2;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--accent);
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hero-title {
    font-size: 56px;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 16px;
    text-shadow: 0 2px 20px rgba(0,0,0,0.5);
}

.hero-desc {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-actions {
    display: flex;
    gap: 12px;
}

.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    transition: all var(--transition);
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: scale(1.05);
}

.btn-secondary {
    background: rgba(255,255,255,0.15);
    color: white;
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.25);
    transform: scale(1.05);
}

/* ===== SECTIONS ===== */
.section {
    padding: 48px 0;
}

.section-dark {
    background: var(--bg-secondary);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
}

.see-all {
    color: var(--accent);
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.see-all:hover {
    color: var(--accent-hover);
}

/* ===== DORAMA GRID ===== */
.dorama-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 24px;
}

.dorama-card {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-card);
    transition: all var(--transition);
    cursor: pointer;
}

.dorama-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow);
}

.dorama-card:hover .card-overlay {
    opacity: 1;
}

.card-image {
    position: relative;
    aspect-ratio: 2/3;
    overflow: hidden;
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-hover) 100%);
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition);
}

.card-image img[src="#"],
.card-image img[src=""] {
    display: none;
}

.card-image::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    z-index: 0;
}

.card-image::after {
    content: '\1F3AC';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 40px;
    opacity: 0.15;
    z-index: 1;
}

.dorama-card:hover .card-image img {
    transform: scale(1.1);
}

.card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition);
}

.card-play-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: transform var(--transition);
}

.card-play-btn svg {
    width: 24px;
    height: 24px;
}

.dorama-card:hover .card-play-btn {
    transform: scale(1.1);
}

.card-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--accent);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    z-index: 2;
}

.card-badge svg {
    width: 12px;
    height: 12px;
}

.card-badge.new {
    background: var(--accent-green);
    color: #000;
}

.card-badge.episode {
    background: var(--accent-yellow);
    color: #000;
}

.card-rating {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0,0,0,0.7);
    color: var(--accent-yellow);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 2;
}

.card-rating svg {
    width: 12px;
    height: 12px;
}

.card-info {
    padding: 12px;
}

.card-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-meta {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
}

/* ===== POPULAR LIST ===== */
.dorama-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dorama-list-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px;
    background: var(--bg-card);
    border-radius: var(--radius);
    transition: all var(--transition);
    cursor: pointer;
}

.dorama-list-item:hover {
    background: var(--bg-hover);
    transform: translateX(8px);
}

.list-rank {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-secondary);
    min-width: 40px;
    text-align: center;
}

.list-rank.top {
    color: var(--accent);
}

.list-image {
    width: 60px;
    height: 80px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    position: relative;
}

.list-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.list-image img[src="#"],
.list-image img[src=""] {
    display: none;
}

.list-image::after {
    content: '\1F3AC';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    opacity: 0.15;
}

.list-info {
    flex: 1;
    min-width: 0;
}

.list-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-meta {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.list-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.list-meta svg {
    width: 14px;
    height: 14px;
}

.list-rating {
    color: var(--accent-yellow);
}

.list-views {
    color: var(--text-secondary);
}

/* ===== FOOTER ===== */
.footer {
    background: var(--bg-secondary);
    padding: 48px 0 24px;
    border-top: 1px solid var(--border);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 32px;
}

.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 12px;
}

.footer-logo svg {
    color: var(--accent);
}

.footer-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.footer-col h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

.footer-col a {
    display: block;
    font-size: 14px;
    color: var(--text-secondary);
    padding: 4px 0;
}

.footer-col a:hover {
    color: var(--text-primary);
}

.footer-bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-secondary);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .hero-title {
        font-size: 42px;
    }
    
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }
}

@media (max-width: 768px) {
    .header-container {
        gap: 0 !important;
        padding: 0 12px !important;
        justify-content: space-between !important;
        overflow: hidden !important;
        height: 56px !important;
    }
    
    .nav {
        display: none !important;
    }
    
    .search-box {
        display: none !important;
    }
    
    .btn-search-mobile {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        flex-shrink: 0;
    }
    
    .header-actions {
        gap: 8px !important;
        flex-shrink: 0 !important;
    }
    
    .btn-login {
        padding: 6px 12px !important;
        font-size: 12px !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
    }
    
    .logo {
        font-size: 18px !important;
        flex-shrink: 0 !important;
    }
    
    .logo-icon {
        width: 22px !important;
        height: 22px !important;
    }
    
    .hero {
        height: 60vh;
    }
    
    .hero-title {
        font-size: 32px;
    }
    
    .hero-desc {
        font-size: 14px;
    }
    
    .hero-content {
        left: 16px;
        right: 16px;
        max-width: none;
    }
    
    .section-title {
        font-size: 20px;
    }
    
    .dorama-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 16px;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

@media (max-width: 480px) {
    .dorama-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .btn-primary,
    .btn-secondary {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #444;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.dorama-card {
    animation: fadeIn 0.5s ease forwards;
}

.dorama-card:nth-child(1) { animation-delay: 0.05s; }
.dorama-card:nth-child(2) { animation-delay: 0.1s; }
.dorama-card:nth-child(3) { animation-delay: 0.15s; }
.dorama-card:nth-child(4) { animation-delay: 0.2s; }
.dorama-card:nth-child(5) { animation-delay: 0.25s; }
.dorama-card:nth-child(6) { animation-delay: 0.3s; }
.dorama-card:nth-child(7) { animation-delay: 0.35s; }
.dorama-card:nth-child(8) { animation-delay: 0.4s; }
