/* Reset and Basic Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: #141414;
    color: #fff;
    overflow-x: hidden;
}

/* --- BACKGROUND TRAILER LAYER --- */
.background-trailer {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: #000 center / cover no-repeat;
    opacity: 0;
    transition: opacity 250ms ease-in-out;
    pointer-events: none;
}
.background-trailer.active {
    opacity: 0.45;
}

/* When trailer is active, remove hero background image so trailer is visible */
body.trailer-active .hero-section {
    background-image: linear-gradient(to right, rgba(20,20,20,0.85) 30%, transparent 80%);
}

/* --- ANIMATIONS --- */

/* Profile Select Flash Animation */
.profile-select-animation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    z-index: 10000;
    opacity: 0;
    pointer-events: none; /* Allows clicks to go through */
    display: none; /* Hidden by default */
}

.profile-select-animation-overlay.active {
    display: block;
    animation: flash 0.5s ease-out forwards;
}

@keyframes flash {
    0% { opacity: 0; }
    50% { opacity: 0.8; }
    100% { opacity: 0; }
}

/* Netflix Intro Loader */
.netflix-intro {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.5s ease-out;
}

.intro-logo-container {
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
    font-size: 10vw;
    color: #e50914;
    transform: scale(0.5);
    opacity: 0;
    animation: netflixIntroAnimation 2.5s forwards 0.5s;
    text-shadow: 0 0 10px rgba(0,0,0,0.7);
}

.intro-letter {
    display: inline-block;
    text-shadow: 0 0 5px rgba(0,0,0,0.5);
}

@keyframes netflixIntroAnimation {
    0% { transform: scale(0.5) skewX(-15deg); opacity: 0; }
    40% { transform: scale(1.2) skewX(0deg); opacity: 1; }
    100% { transform: scale(1) skewX(0deg); opacity: 1; }
}


/* --- "WHO'S WATCHING?" SECTION --- */
.whos-watching-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    text-align: center;
    padding: 20px;
    position: relative;
    z-index: 2; /* above background trailer */
}

.whos-watching-container h1 {
    font-family: 'Oswald', sans-serif;
    font-size: 3rem;
    color: #fff;
    margin-bottom: 40px;
    font-weight: 500;
}

.profiles {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
}

.profile {
    cursor: pointer;
    text-align: center;
    color: #aaa;
    transition: transform 0.2s ease-in-out, color 0.2s ease-in-out;
    width: 150px;
}

.profile img {
    border-radius: 8px;
    width: 120px;
    height: 120px;
    margin-bottom: 10px;
    border: 3px solid transparent;
    transition: border-color 0.2s ease-in-out;
}

/* keep profile tiles crisp over trailer (no fading of profile area) */
.profile:hover img { border-color: #fff; }
.profile:hover p { color: #fff; }

.profile p {
    font-size: 1.2rem;
    font-weight: 500;
}

/* --- MAIN CONTENT AREA --- */
.main-content {
    padding-top: 80px;
    display: none; /* Hidden until a profile is selected */
}

header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 40px;
    background: linear-gradient(to bottom, rgba(20, 20, 20, 0.9) 0%, rgba(20, 20, 20, 0) 100%);
    z-index: 1000;
    transition: background-color 0.3s ease;
}
header.scrolled {
    background-color: #141414;
}

.logo-main {
    cursor: pointer;
}
.logo-main img {
    height: 35px;
}

.profile-indicator-container {
    position: relative;
}

.profile-indicator {
    height: 40px;
    width: 40px;
    border-radius: 4px;
    cursor: pointer;
}

.profile-dropdown {
    position: absolute;
    top: 55px;
    right: 0;
    background-color: rgba(20, 20, 20, 0.9);
    border: 1px solid rgba(128, 128, 128, 0.3);
    border-radius: 4px;
    width: 200px;
    overflow: hidden;
    display: none; /* will be toggled via JS */
    flex-direction: column;
}


.dropdown-link {
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    cursor: pointer;
}
.dropdown-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}
.dropdown-link i {
    font-size: 1.2rem;
    width: 20px;
    text-align: center;
}


/* --- HERO SECTION --- */
.hero-section {
    height: 85vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-left: 40px;
    background-size: cover;
    background-position: center;
    background-image: linear-gradient(to right, rgba(20,20,20,0.9) 30%, transparent 80%), url('images/grey.png');
    margin-bottom: 30px;
}

.hero-section h1 {
    font-family: 'Oswald', sans-serif;
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    max-width: 60%;
}

.hero-section h2 {
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 25px;
    color: #ccc;
    max-width: 50%;
}

.hero-buttons .hero-btn {
    background-color: rgba(109, 109, 110, 0.7);
    color: #fff;
    border: none;
    padding: 12px 24px;
    margin-right: 15px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    text-decoration: none;
}

.hero-buttons .hero-btn i {
    margin-right: 10px;
}

.hero-buttons .hero-btn.primary {
    background-color: #fff;
    color: #000;
}
.hero-buttons .hero-btn.primary:hover {
    background-color: rgba(255, 255, 255, 0.8);
}
.hero-buttons .hero-btn:hover {
    background-color: rgba(109, 109, 110, 0.4);
}


/* --- CAROUSEL STYLES --- */
.carousel-container {
    padding: 0 40px;
}

.carousel {
    margin-bottom: 40px;
}

.carousel h2 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.carousel-track {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 15px;
    gap: 10px;
    scrollbar-width: none; /* Firefox */
}
.carousel-track::-webkit-scrollbar {
    display: none; /* Webkit */
}

.carousel-item {
    min-width: 250px;
    height: 140px;
    background-color: #2a2a2a;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s ease-in-out;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: flex-end; /* Align text to bottom */
    justify-content: center;
    padding: 10px;
}
.carousel-item:hover {
    transform: scale(1.05);
    z-index: 10;
}

.carousel-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    transition: opacity 0.2s ease;
}
.carousel-item:hover img {
    opacity: 0.3;
}

.carousel-item h3 {
    position: relative;
    z-index: 2;
    font-size: 1.1rem;
    color: #fff;
    text-shadow: 1px 1px 4px #000;
}


/* --- MODAL STYLES --- */
.modal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: none; /* Hidden by default */
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 20px;
}

.modal-content {
    background-color: #181818;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    animation: fadeInModal 0.3s ease;
}

@keyframes fadeInModal {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.close-modal-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 2rem;
    color: #fff;
    background-color: #181818;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
    z-index: 10;
}
.close-modal-btn:hover {
    background-color: #333;
}

.modal-media {
    width: 100%;
    max-height: 450px;
    object-fit: cover;
    display: block;
    background-color: #000;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}
.modal-body-content {
    padding: 25px 30px;
}

.modal-body-content h3 {
    font-family: 'Oswald', sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 5px;
}
.modal-body-content h4 {
    font-size: 1.1rem;
    color: #ccc;
    margin-bottom: 20px;
    font-weight: 400;
}
.modal-body-content p {
    font-size: 1rem;
    line-height: 1.6;
    color: #d1d1d1;
    margin-bottom: 20px;
}

.tech-list {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #333;
}
.tech-list strong {
    color: #fff;
    font-size: 1.1rem;
    margin-bottom: 10px;
    display: block;
}
.tech-list span {
    display: inline-block;
    background-color: #333;
    color: #ddd;
    padding: 5px 12px;
    border-radius: 15px;
    margin: 0 8px 8px 0;
    font-size: 0.9rem;
}


/* --- FOOTER --- */
footer {
    text-align: center;
    padding: 30px 20px;
    color: #777;
    font-size: 0.9rem;
    border-top: 1px solid #222;
    margin-top: 50px;
}

/* --- RESPONSIVE ADJUSTMENTS --- */
@media (max-width: 768px) {
    .whos-watching-container h1 { font-size: 2.5rem; }
    .profile { width: 100px; }
    .profile img { width: 80px; height: 80px; }

    header { padding: 10px 20px; }
    
    .hero-section { height: 70vh; padding-left: 20px; }
    .hero-section h1 { font-size: 2.5rem; max-width: 90%; }
    .hero-section h2 { font-size: 1.2rem; max-width: 80%; }
    
    .carousel-container { padding: 0 20px; }
    .carousel-item { min-width: 200px; height: 112px; }
    .modal-content { width: 95%; }
    .modal-body-content { padding: 20px; }
    .modal-body-content h3 { font-size: 1.8rem; }
}