:root {
    --bg-color: #141414;
    --card-bg: #1f1f1f;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --accent: #e50914;
    --header-height: 60px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.5;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

a:hover {
    color: var(--text-secondary);
}

/* Header */
header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 20px;
    background-color: rgba(0, 0, 0, 0.7);
    /* More transparent */
    backdrop-filter: blur(12px);
    /* Glassmorphism */
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-color 0.3s;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    /* Bolder */
    color: var(--accent);
    margin-right: auto;
    letter-spacing: -0.5px;
}

.nav-links a {
    margin-left: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    position: relative;
    padding: 5px 0;
}

.nav-links a:hover {
    color: var(--text-primary);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background-color: var(--accent);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

h1,
h2,
h3 {
    margin-bottom: 20px;
    font-weight: 600;
}

/* Grid */
.drama-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

/* Drama Card Enhancements */
.drama-card {
    background-color: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    aspect-ratio: 2/3;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.drama-card:hover {
    transform: scale(1.03) translateY(-5px);
    z-index: 10;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.drama-card:hover .play-overlay {
    opacity: 1;
}

.drama-poster {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background-color: #333;
    transition: transform 0.3s;
}

.drama-card:hover .drama-poster {
    transform: scale(1.1);
}

/* Aspect ratio hack for lazy loading placeholder */
.drama-poster.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    font-size: 0.8rem;
}

.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 5;
    backdrop-filter: blur(2px);
}

.card-play-btn {
    width: 50px;
    height: 50px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(229, 9, 20, 0.6);
    transform: scale(0.8);
    transition: transform 0.2s;
}

.drama-card:hover .card-play-btn {
    transform: scale(1);
}

.episode-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 6;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.drama-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.8) 60%, transparent 100%);
    padding: 40px 10px 15px;
    z-index: 6;
}

.drama-title {
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.drama-meta {
    font-size: 0.75rem;
    color: #ccc;
    display: flex;
    justify-content: space-between;
}

.drama-description {
    font-size: 0.75rem;
    color: #bbb;
    margin-top: 6px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Tags */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.tag-badge {
    background-color: #333;
    color: var(--text-secondary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
}

.tag-badge:hover {
    background-color: #555;
    color: var(--text-primary);
}

/* Detail Page */
.detail-header {
    display: flex;
    gap: 30px;
    margin-bottom: 40px;
}

.detail-poster {
    width: 200px;
    border-radius: 8px;
    flex-shrink: 0;
}

.detail-content {
    flex: 1;
}

.detail-title {
    font-size: 2rem;
    margin-bottom: 10px;
}

.detail-meta {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.episode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 10px;
}

.episode-link {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #333;
    border-radius: 4px;
    padding: 10px;
    font-size: 0.9rem;
    color: white;
}

.episode-link:hover {
    background: var(--accent);
}

/* Player */
.player-container {
    max-width: 500px;
    margin: 0 auto;
    position: relative;
}

.aspect-wrapper {
    position: relative;
    padding-top: 177.77%;
    /* 9:16 Aspect Ratio */
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.fake-player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(45deg, #1a1a1a, #2a2a2a);
}

.play-button {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    margin-bottom: 20px;
}

.play-icon {
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 10px 0 10px 18px;
    border-color: transparent transparent transparent white;
    margin-left: 4px;
}

.player-ui-top {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), transparent);
    display: flex;
    justify-content: space-between;
}

.player-ui-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.5), transparent);
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    margin-bottom: 10px;
}

.progress-fill {
    width: 30%;
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
}

.controls {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
}

.nav-episodes {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
}

.btn {
    padding: 10px 20px;
    background: #333;
    border-radius: 4px;
    font-size: 0.9rem;
}

.btn:hover {
    background: #555;
}

/* Footer */
footer {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-top: 1px solid #333;
    margin-top: 60px;
}

@media (max-width: 600px) {
    .detail-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .detail-poster {
        width: 150px;
    }

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

    .drama-title {
        font-size: 0.7rem;
    }
}