:root {
    --primary: #ff3e3e;
    --primary-hover: #ff1a1a;
    --bg-dark: #0a0a0b;
    --card-bg: #161618;
    --text-main: #ffffff;
    --text-dim: #a0a0a0;
    --glass: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Header */
header {
    background: rgba(10, 10, 11, 0.8);
    backdrop-filter: blur(20px);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(45deg, var(--primary), #ffb800);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
}

/* Navigation Switcher */
.nav-switcher {
    display: flex;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    padding: 4px;
    gap: 4px;
}

.switch-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    border-radius: 40px;
    text-decoration: none;
    color: var(--text-dim);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.switch-item i {
    font-size: 1rem;
}

.switch-item:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.switch-item.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 62, 62, 0.3);
}

/* Search Form */
.search-form {
    display: flex;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    padding: 5px 15px;
    align-items: center;
    transition: all 0.3s;
}

.search-form:focus-within {
    border-color: var(--primary);
}

.search-form input {
    background: none;
    border: none;
    color: white;
    padding: 8px;
    outline: none;
    width: 200px;
    font-size: 0.9rem;
}

.search-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 1rem;
    transition: color 0.3s;
}

.search-btn:hover {
    color: var(--primary);
}

/* Hero Section */
.hero {
    padding: 120px 5% 40px;
    background: radial-gradient(circle at 80% 20%, rgba(255, 62, 62, 0.15), transparent);
    text-align: center;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    max-width: 800px;
}

.hero p {
    color: var(--text-dim);
    font-size: 1.2rem;
    max-width: 600px;
}

/* Section Styling */
section {
    padding: 40px 5%;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Horizontal Scroll Container */
.drama-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

/* Drama Card */
.drama-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid var(--glass-border);
    text-decoration: none;
}

.drama-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.5);
    border-color: var(--primary);
}

.card-img {
    aspect-ratio: 3/4;
    width: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.drama-card:hover .card-img {
    transform: scale(1.05);
}

.card-info {
    padding: 12px;
}

.card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.8rem;
    margin-bottom: 8px;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-dim);
}

.heat-score {
    color: var(--primary);
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 3px;
}

.new-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: bold;
    z-index: 2;
}

.label-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
}

.label-tag {
    background: var(--glass);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    color: var(--text-dim);
}

/* Footer */
footer {
    padding: 60px 5%;
    background: #050505;
    border-top: 1px solid var(--glass-border);
    text-align: center;
    color: var(--text-dim);
}

.footer-links {
    margin-bottom: 1.5rem;
}

.footer-links a {
    color: var(--text-dim);
    margin: 0 15px;
    text-decoration: none;
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--text-main);
}

/* Play Page Layout */
.play-container {
    padding: 100px 5% 40px;
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
    min-height: calc(100vh - 200px);
}

.video-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.video-player {
    width: 100%;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.video-player video {
    width: 100%;
    max-height: 70vh;
    display: block;
}

.drama-info-bar h1 {
    font-size: 1.8rem;
    margin-bottom: 12px;
}

.drama-meta-large {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    color: var(--text-dim);
    font-size: 0.9rem;
}

.drama-meta-large i {
    color: var(--primary);
    margin-right: 5px;
}

.drama-description {
    color: var(--text-dim);
    margin-bottom: 20px;
    font-size: 1rem;
    max-width: 900px;
}

/* Sidebar */
.episode-sidebar {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    max-height: 85vh;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.episode-list {
    overflow-y: auto;
    padding: 10px;
}

.episode-item {
    display: flex;
    gap: 12px;
    padding: 10px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-main);
    transition: background 0.3s;
    margin-bottom: 8px;
}

.episode-item:hover {
    background: var(--glass);
}

.episode-item.active {
    background: rgba(255, 62, 62, 0.15);
    border: 1px solid rgba(255, 62, 62, 0.3);
}

.ep-img-container {
    position: relative;
    min-width: 100px;
    height: 56px;
    border-radius: 4px;
    overflow: hidden;
}

.ep-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ep-no {
    position: absolute;
    bottom: 2px;
    right: 4px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 0.65rem;
    padding: 1px 4px;
    border-radius: 2px;
}

.ep-detail {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ep-name {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.ep-stats {
    font-size: 0.75rem;
    color: var(--text-dim);
}

/* Responsive */
@media (max-width: 1024px) {
    .play-container {
        grid-template-columns: 1fr;
        padding-top: 90px;
    }

    .episode-sidebar {
        max-height: 500px;
    }
}

@media (max-width: 768px) {
    header {
        padding: 0.8rem 15px;
        display: grid;
        grid-template-columns: auto 1fr;
        grid-template-areas:
            "logo actions"
            "nav nav";
        gap: 12px;
        height: auto;
    }

    .logo {
        grid-area: logo;
        font-size: 1.5rem;
    }

    .header-actions {
        grid-area: actions;
        display: flex;
        justify-content: flex-end;
    }

    .search-form {
        max-width: 180px;
        padding: 2px 10px;
    }

    .search-form input {
        width: 100%;
        height: 30px;
        font-size: 0.85rem;
    }

    .nav-switcher {
        grid-area: nav;
        width: 100%;
        margin-top: 5px;
    }

    .switch-item {
        flex: 1;
        justify-content: center;
        padding: 8px 5px;
        font-size: 0.8rem;
    }

    .switch-item i {
        font-size: 0.9rem;
    }

    .hero {
        padding: 160px 15px 30px;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .section-title {
        font-size: 1.25rem;
        margin-bottom: 1.2rem;
    }

    .drama-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .card-info {
        padding: 10px;
    }

    .card-title {
        font-size: 0.85rem;
        height: 2.6rem;
    }

    .video-player video {
        max-height: 55vh;
    }

    .drama-info-bar h1 {
        font-size: 1.3rem;
    }

    .drama-meta-large {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
    }

    .footer-links a {
        display: inline-block;
        margin: 5px 10px;
    }
}

@media (max-width: 480px) {
    .drama-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero h1 {
        font-size: 1.7rem;
    }
}