/* Root Premium Netflix-Style Color Variables */
:root {
    --bg-color: #141414;
    --navbar-color: #0c0c0c;
    --primary-color: #e50914;
    --primary-hover: #b80710;
    --text-color: #ffffff;
    --text-secondary: #aaaaaa;
    --accent-glow: rgba(229, 9, 20, 0.4);
    --border-soft: rgba(255, 255, 255, 0.08);
}

/* Global Reset & Core Font Family */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

/* Custom Web Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #141414;
}
::-webkit-scrollbar-thumb {
    background: #333333;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Navbar Style */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--navbar-color);
    padding: 15px 4%;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    border-bottom: 1px solid var(--border-soft);
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    transition: background-color 0.3s;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-red {
    font-size: 24px;
    font-weight: 900;
    color: var(--primary-color);
    letter-spacing: -0.5px;
    text-shadow: 0 0 10px var(--accent-glow);
}

.badge {
    background-color: var(--primary-color);
    color: var(--text-color);
    font-size: 10px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.search-box {
    display: flex;
    align-items: center;
    background-color: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 6px 15px;
    width: 35%;
    min-width: 250px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.search-box:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 8px var(--accent-glow);
}

.search-icon {
    color: var(--text-secondary);
    margin-right: 8px;
}

#searchInput {
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 14px;
    outline: none;
    width: 100%;
}

.profile-area {
    display: flex;
    align-items: center;
}

.profile-avatar {
    width: 35px;
    height: 35px;
    background-image: linear-gradient(135deg, #e50914, #7a0010);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: white;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(229, 9, 20, 0.3);
}

/* Hero Spotlight Billboard */
.hero-spotlight {
    position: relative;
    height: 80vh;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    padding: 0 6%;
    margin-top: 60px;
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to right, rgba(20,20,20,0.9) 30%, rgba(20,20,20,0.2) 70%, rgba(20,20,20,0.9) 100%),
                linear-gradient(to top, rgba(20,20,20,1) 0%, rgba(20,20,20,0) 50%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 650px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

.hero-title {
    font-size: 48px;
    font-weight: 900;
    margin-bottom: 15px;
    line-height: 1.1;
    letter-spacing: -1px;
}

.hero-info {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.rating {
    color: #4cd137;
    font-weight: bold;
}

.hero-overview {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 25px;
    max-height: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
}

.hero-actions {
    display: flex;
    gap: 12px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 700;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
}

.btn:active {
    transform: scale(0.96);
}

.btn-play {
    background-color: var(--primary-color);
    color: var(--text-color);
}

.btn-play:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 0 15px var(--accent-glow);
}

.btn-info {
    background-color: rgba(255,255,255,0.12);
    color: var(--text-color);
    backdrop-filter: blur(5px);
}

.btn-info:hover {
    background-color: rgba(255,255,255,0.25);
}

/* Main Content Containers */
.content-container {
    padding: 40px 4% 80px 4%;
    position: relative;
    z-index: 5;
    margin-top: -80px;
}

.media-section {
    margin-bottom: 50px;
}

.section-title {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 18px;
    color: var(--text-color);
    letter-spacing: -0.2px;
    border-left: 4px solid var(--primary-color);
    padding-left: 10px;
}

/* Responsive Media Grids */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

/* Movie/Show Cards styling */
.media-card {
    background-color: rgba(255,255,255,0.02);
    border-radius: 8px;
    border: 1px solid var(--border-soft);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
    position: relative;
    display: flex;
    flex-direction: column;
}

.media-card:hover {
    transform: translateY(-8px);
    border-color: rgba(229, 9, 20, 0.5);
    box-shadow: 0 10px 20px rgba(0,0,0,0.5), 0 0 15px rgba(229, 9, 20, 0.2);
}

.card-img-container {
    position: relative;
    aspect-ratio: 2/3;
    width: 100%;
    background-color: #222222;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-rating {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: rgba(0,0,0,0.85);
    color: #4cd137;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 6px;
    border-radius: 4px;
}

.card-info {
    padding: 12px;
}

.card-title {
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.card-meta {
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
}

/* Detail Modal Style (Sliding overlay drawer) */
.detail-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 2000;
    display: flex;
    justify-content: flex-end;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.75);
    backdrop-filter: blur(4px);
}

.modal-body {
    position: relative;
    width: 50%;
    min-width: 500px;
    max-width: 800px;
    height: 100%;
    background-color: var(--bg-color);
    box-shadow: -10px 0 30px rgba(0,0,0,0.8);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    animation: slideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(0,0,0,0.6);
    border: 1px solid rgba(255,255,255,0.15);
    color: var(--text-color);
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.close-btn:hover {
    background-color: var(--primary-color);
    border-color: transparent;
}

.modal-header-banner {
    position: relative;
    height: 300px;
    background-size: cover;
    background-position: center;
    width: 100%;
}

.banner-gradient {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, var(--bg-color) 0%, rgba(20,20,20,0) 80%);
}

.modal-details {
    padding: 30px;
    display: flex;
    gap: 25px;
}

.details-left {
    flex: 2;
}

.details-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.modal-meta {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.modal-description {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 25px;
}

.btn-play-large {
    background-color: var(--primary-color);
    color: var(--text-color);
    border: none;
    border-radius: 6px;
    padding: 15px;
    width: 100%;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(229, 9, 20, 0.4);
    transition: background-color 0.2s, transform 0.2s;
}

.btn-play-large:hover {
    background-color: var(--primary-hover);
    transform: scale(1.03);
}

.details-cast {
    font-size: 12px;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-soft);
    padding-top: 15px;
}

/* TV Episodes Selector styling */
.tv-selector-container {
    margin-top: 20px;
    border-top: 1px solid var(--border-soft);
    padding-top: 20px;
}

.custom-select {
    background-color: #222;
    border: 1px solid var(--border-soft);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    outline: none;
    width: 100%;
    margin-top: 8px;
    margin-bottom: 20px;
    font-weight: bold;
}

.episodes-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
}

.episodes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
    max-height: 250px;
    overflow-y: auto;
    padding-right: 5px;
}

.episode-btn {
    background-color: rgba(255,255,255,0.05);
    border: 1px solid var(--border-soft);
    color: white;
    padding: 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.2s, border-color 0.2s;
}

.episode-btn:hover {
    background-color: rgba(255,255,255,0.15);
    border-color: var(--primary-color);
}

/* Cinema Web Player Overlay Frame */
.player-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: black;
    z-index: 3000;
    display: flex;
    flex-direction: column;
}

.player-header {
    background-color: rgba(10,10,10,0.9);
    padding: 15px 4%;
    display: flex;
    align-items: center;
    gap: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.btn-back {
    background: transparent;
    border: none;
    color: white;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.player-title {
    font-size: 16px;
    font-weight: bold;
    color: var(--text-secondary);
}

.player-container {
    flex: 1;
    width: 100%;
    height: 100%;
    position: relative;
}

#videoIframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Utilities */
.hidden {
    display: none !important;
}

/* Responsive layout breakpoints for Mobile and Tablets */
@media (max-width: 1024px) {
    .modal-body {
        width: 80%;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 15px 20px;
    }
    .search-box {
        display: none; /* Hide wide search on small mobile; simplified flow */
    }
    .hero-title {
        font-size: 32px;
    }
    .modal-body {
        width: 100%;
        min-width: 100%;
    }
    .modal-details {
        flex-direction: column;
    }
}
