:root {
    --bg-dark: #0f1014;
    --bg-card: #181a20;
    --primary: #e50914;
    --text-main: #ffffff;
    --text-muted: #a3a3a3;
    --nav-height: 120px;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
}

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

/* Navbar */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(15, 16, 20, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #2a2a2a;
    padding-top: 1rem;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
}
.logo span { color: var(--primary); }

.search-bar {
    position: relative;
    flex: 1;
    max-width: 400px;
    margin: 0 1rem;
}

.search-bar input {
    width: 100%;
    padding: 10px 40px 10px 15px;
    border-radius: 20px;
    border: 1px solid #333;
    background: #222;
    color: #fff;
    outline: none;
}
.search-bar input:focus { border-color: var(--primary); }

.categories-wrapper {
    overflow-x: auto;
    padding-bottom: 1rem;
    scrollbar-width: none; /* Firefox */
}
.categories-wrapper::-webkit-scrollbar { display: none; }

.categories {
    display: flex;
    gap: 1rem;
    list-style: none;
    white-space: nowrap;
}

.categories li {
    padding: 0.5rem 1rem;
    background: #222;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: 0.3s;
    border: 1px solid transparent;
}

.categories li.active, .categories li:hover {
    background: var(--primary);
    color: white;
}

/* Hero Section */
.hero-slider {
    margin-top: 1rem;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    min-height: 300px;
}

.hero-content {
    position: relative;
    height: 400px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
}

.hero-overlay {
    background: linear-gradient(to top, #0f1014, transparent);
    width: 100%;
    padding: 2rem;
}

/* Grid Layout */
.grid-layout {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Mobile default */
    gap: 1rem;
    margin-top: 1.5rem;
}

@media (min-width: 768px) {
    .grid-layout { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1024px) {
    .grid-layout { grid-template-columns: repeat(4, 1fr); }
}

/* Movie Card */
.movie-card {
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s;
    cursor: pointer;
    position: relative;
}

.movie-card:hover { transform: translateY(-5px); }

.poster-wrapper {
    position: relative;
    padding-top: 150%; /* Aspect Ratio 2:3 */
}

.poster-wrapper img {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
}

.rating-badge {
    position: absolute;
    top: 10px; right: 10px;
    background: rgba(0,0,0,0.7);
    color: #ffd700;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
}

.card-info { padding: 10px; }
.card-title { font-size: 0.95rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.card-meta { font-size: 0.8rem; color: var(--text-muted); display: flex; justify-content: space-between; }

/* Detail Page */
.hidden { display: none; }

.detail-header {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 2rem;
}

@media(min-width: 768px) {
    .detail-header { flex-direction: row; }
}

.detail-poster {
    width: 100%;
    max-width: 300px;
    border-radius: 12px;
}

.detail-info h1 { margin-bottom: 0.5rem; font-size: 2rem; }
.detail-meta { display: flex; gap: 1rem; color: var(--text-muted); margin-bottom: 1rem; }
.detail-desc { line-height: 1.6; color: #ccc; margin-bottom: 2rem; }

.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    margin-top: 2rem;
}

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

.episode-list {
    margin-top: 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.5rem;
}

.episode-btn {
    padding: 10px;
    background: #222;
    border: 1px solid #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    cursor: pointer;
}
.episode-btn:hover { background: var(--primary); border-color: var(--primary); }

/* Skeleton Loading */
.skeleton {
    background: #222;
    background: linear-gradient(90deg, #222 25%, #2a2a2a 50%, #222 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

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

.loading-more { text-align: center; padding: 2rem; color: var(--text-muted); }
.back-btn { background: none; border: none; color: white; cursor: pointer; margin-bottom: 1rem; font-size: 1rem; }
