/* Global Styles & Variables */
:root {
    --bg-color: #050505;
    --surface-color: rgba(20, 20, 20, 0.8);
    --primary-color: #e50914;
    --accent-color: #ff9d00;
    --text-main: #ffffff;
    --text-dim: #b3b3b3;
    --glass: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.8);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Navigation */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 40px;
    position: sticky;
    top: 0;
    backdrop-filter: blur(20px);
    background: rgba(5, 5, 5, 0.8);
    border-bottom: 1px solid var(--glass-border);
    z-index: 1000;
}

.logo {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.search-container {
    position: relative;
    width: 400px;
}

.search-input {
    width: 100%;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    padding: 12px 20px;
    border-radius: 30px;
    color: white;
    font-size: 1rem;
    transition: var(--transition);
    outline: none;
}

.search-input:focus {
    border-color: var(--primary-color);
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-dim);
    padding: 8px 20px;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    border-radius: 20px;
}

.nav-btn.active {
    color: white;
    background: var(--primary-color);
}

/* Sections */
.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.hero {
    height: 500px;
    border-radius: 24px;
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
    margin-bottom: 40px;
    display: flex;
    align-items: flex-end;
    padding: 60px;
    box-shadow: var(--shadow);
}

.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0) 60%);
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 3.5rem;
    margin-bottom: 10px;
}

.hero-meta {
    color: var(--text-dim);
    margin-bottom: 20px;
    display: flex;
    gap: 15px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    margin-top: 40px;
}

.section-title {
    font-size: 1.5rem;
    border-left: 4px solid var(--primary-color);
    padding-left: 15px;
}

.movie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 25px;
}

.movie-card {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
}

.movie-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary-color);
}

.card-poster {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
}

.card-info {
    padding: 15px;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-meta {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-top: 5px;
    display: flex;
    justify-content: space-between;
}

.rating-tag {
    background: rgba(255, 157, 0, 0.2);
    color: var(--accent-color);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: bold;
}

/* Detail View */
.detail-view {
    position: relative;
    min-height: 100vh;
    margin-top: -100px;
    padding-top: 140px;
    animation: fadeIn 0.5s ease;
}

.detail-bg {
    position: fixed;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: blur(40px) brightness(0.3);
    z-index: -1;
    transform: scale(1.1);
}

.detail-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(to top, var(--bg-color) 0%, rgba(5, 5, 5, 0.4) 100%);
    z-index: -1;
}

.detail-header {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 60px;
}

.detail-poster {
    width: 100%;
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.detail-info h1 {
    font-size: 3.5rem;
    margin-bottom: 15px;
}

.detail-tags {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
}

.tag {
    background: var(--glass);
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    border: 1px solid var(--glass-border);
}

.plot {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-dim);
    margin-bottom: 30px;
}

/* Cast */
.cast-grid {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding-bottom: 20px;
    scrollbar-width: none;
}

.actor-card {
    flex: 0 0 100px;
    text-align: center;
}

.actor-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 10px;
    border: 2px solid var(--primary-color);
}

.actor-name {
    font-size: 0.8rem;
    color: var(--text-dim);
}

/* Episodes */
.season-selector {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.season-btn {
    padding: 10px 25px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: white;
    cursor: pointer;
}

.season-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

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

.episode-card {
    background: var(--glass);
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.episode-card:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Player */
.player-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: black;
    z-index: 2000;
    flex-direction: column;
}

.player-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.back-btn {
    background: var(--glass);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
}

#video-iframe {
    flex: 1;
    width: 100%;
    height: 100%;
    border: none;
}

.continue-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.continue-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease;
    background: var(--glass);
    border: 1px solid var(--glass-border);
}

.continue-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
}

.continue-card-content {
    cursor: pointer;
}

.remove-continue {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 59, 48, 0.2);
    border: 1px solid rgba(255, 59, 48, 0.4);
    color: #ff3b30;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(5px);
    z-index: 10;
}

.remove-continue:hover {
    background: rgba(255, 59, 48, 0.8);
    color: white;
    transform: scale(1.1);
}

.progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    background: var(--primary-color);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .detail-header {
        grid-template-columns: 1fr;
    }

    .search-container {
        width: 200px;
    }

    .hero {
        height: 400px;
    }

    .hero-title {
        font-size: 2rem;
    }
}