/* ========================================
   Setflix Landing Page — Exact Netflix Clone
   TUDUM Animation: Exactly 3 seconds
   ======================================== */

:root {
    /* Netflix Exact Colors */
    --netflix-red: #E50914;
    --netflix-red-hover: #f40612;
    --netflix-black: #141414;
    --netflix-dark: #000000;
    --netflix-gray: #808080;
    --netflix-light-gray: #e5e5e5;
    --netflix-white: #ffffff;
    --netflix-profile-bg: #333;
    
    /* Typography */
    --font-netflix: 'Netflix Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    
    /* Transitions */
    --transition-fast: 0.1s ease;
    --transition-medium: 0.2s ease-out;
    --transition-slow: 0.4s ease-out;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    background: var(--netflix-dark);
    color: var(--netflix-white);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   INTRO OVERLAY - Netflix TUDUM Animation
   EXACTLY 3 SECONDS DURATION
   ======================================== */
.intro-overlay {
    position: fixed;
    inset: 0;
    background: var(--netflix-dark);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.6s ease-out, visibility 0.6s ease-out;
}

.intro-overlay.fade-out {
    opacity: 0;
    visibility: hidden;
}

.intro-overlay.hidden {
    display: none;
}

.setflix-intro {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    position: relative;
}

.setflix-logo-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Netflix-style Ribbon N Animation */
.logo-ribbons {
    position: absolute;
    width: 100px;
    height: 200px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    animation: ribbonFade 3s ease forwards;
    z-index: 1;
}

@keyframes ribbonFade {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(1.5); }
    15% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    25% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
    100% { opacity: 0; }
}

.ribbon {
    position: absolute;
    width: 28px;
    background: var(--netflix-red);
    box-shadow: 
        2px 0 10px rgba(229, 9, 20, 0.6),
        -2px 0 10px rgba(229, 9, 20, 0.6);
}

.ribbon-left {
    left: 10px;
    height: 0;
    top: 0;
    animation: ribbonGrowLeft 3s ease forwards;
}

.ribbon-right {
    right: 10px;
    height: 0;
    top: 0;
    animation: ribbonGrowRight 3s ease forwards;
}

@keyframes ribbonGrowLeft {
    0% { height: 0; }
    10% { height: 100%; }
    25%, 100% { height: 100%; }
}

@keyframes ribbonGrowRight {
    0% { height: 0; top: 100%; }
    10% { height: 100%; top: 0; }
    25%, 100% { height: 100%; top: 0; }
}

/* SETFLIX Text - Main Logo Animation */
.setflix-text {
    font-family: 'Bebas Neue', Impact, sans-serif;
    font-size: 0;
    font-weight: 400;
    letter-spacing: 0.5em;
    color: transparent;
    position: relative;
    z-index: 2;
    animation: netflixLogoAnimation 3s ease-out forwards;
}

/* Netflix Logo Animation - EXACT 3 SECONDS */
@keyframes netflixLogoAnimation {
    0% {
        font-size: 0;
        opacity: 0;
        letter-spacing: 1em;
        text-shadow: none;
    }
    8% {
        opacity: 1;
    }
    20% {
        font-size: clamp(60px, 18vw, 180px);
        letter-spacing: 0.3em;
        color: var(--netflix-red);
        text-shadow: 
            0 0 80px rgba(229, 9, 20, 0.9),
            0 0 120px rgba(229, 9, 20, 0.7),
            0 0 200px rgba(229, 9, 20, 0.5);
    }
    30% {
        font-size: clamp(50px, 16vw, 160px);
        letter-spacing: 0.25em;
    }
    35%, 100% {
        font-size: clamp(50px, 16vw, 160px);
        letter-spacing: 0.25em;
        color: var(--netflix-red);
        text-shadow: 
            0 0 60px rgba(229, 9, 20, 0.6),
            0 0 100px rgba(229, 9, 20, 0.4);
    }
}

/* Red Screen Flash for TUDUM - synced to 3s */
.intro-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--netflix-red);
    opacity: 0;
    animation: tudumFlash 3s ease-out forwards;
    pointer-events: none;
    z-index: -1;
}

@keyframes tudumFlash {
    0%, 15% {
        opacity: 0;
    }
    20% {
        opacity: 0.2;
    }
    25% {
        opacity: 0;
    }
    28% {
        opacity: 0.1;
    }
    35%, 100% {
        opacity: 0;
    }
}

/* ========================================
   MAIN CONTENT
   ======================================== */
.main-content {
    opacity: 0;
    visibility: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: opacity 0.8s ease-in, visibility 0.8s ease-in;
    position: relative;
}

.main-content.visible {
    opacity: 1;
    visibility: visible;
}

/* Netflix Background */
.netflix-bg {
    position: fixed;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.7) 0%,
        rgba(20, 20, 20, 1) 100%
    );
    z-index: -1;
}

/* ========================================
   HEADER - Netflix Style with Full Nav
   ======================================== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 4%;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: linear-gradient(to bottom, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.7) 50%, transparent 100%);
    height: 68px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 25px;
}

.logo {
    display: flex;
    align-items: center;
}

.header-logo-text {
    font-family: 'Bebas Neue', Impact, sans-serif;
    font-size: clamp(1.4rem, 3vw, 1.8rem);
    letter-spacing: 0.12em;
    color: var(--netflix-red);
    font-weight: 400;
}

/* Primary Navigation - Netflix style */
.primary-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-item {
    color: var(--netflix-light-gray);
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    transition: color var(--transition-fast);
}

.nav-item:hover {
    color: #b3b3b3;
}

.nav-item.active {
    color: var(--netflix-white);
    font-weight: 500;
}

/* Header Right - Icons and Profile */
.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.icon-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--netflix-white);
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn svg {
    width: 24px;
    height: 24px;
}

.icon-btn:hover {
    color: #b3b3b3;
}

/* Profile Dropdown in Header */
.profile-dropdown {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.header-avatar {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    object-fit: cover;
}

.profile-dropdown .caret {
    width: 16px;
    height: 16px;
    fill: var(--netflix-white);
    transition: transform var(--transition-fast);
}

.profile-dropdown:hover .caret {
    transform: rotate(180deg);
}

/* ========================================
   PROFILE SELECTION - Exact Netflix Style
   ======================================== */
.profile-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    min-height: 100vh;
    padding-top: 68px;
}

.profile-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 400;
    color: var(--netflix-white);
    margin-bottom: 1em;
    text-align: center;
    font-family: var(--font-body);
}

/* Profiles Grid - Netflix uses specific spacing */
.profiles-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2vw;
    max-width: 80%;
    margin-bottom: 3em;
}

/* Individual Profile - Netflix exact styling */
.profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    cursor: pointer;
    position: relative;
}

/* Profile Avatar - Netflix uses rounded corners, not circles */
.profile-avatar {
    width: clamp(84px, 10vw, 200px);
    height: clamp(84px, 10vw, 200px);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    border: none;
    background: var(--netflix-profile-bg);
    transition: none;
}

/* Border on hover - using box-shadow to avoid flicker */
.profile:hover .profile-avatar,
.profile:focus .profile-avatar {
    box-shadow: 0 0 0 4px var(--netflix-white);
}

/* Profile Image */
.profile-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 4px;
}

/* Profile Name - Netflix typography */
.profile-name {
    margin-top: 0.6em;
    font-size: clamp(12px, 1.3vw, 18px);
    font-weight: 400;
    color: var(--netflix-gray);
    text-align: center;
    transition: color var(--transition-fast);
}

.profile:hover .profile-name,
.profile:focus .profile-name {
    color: var(--netflix-white);
}

/* ========================================
   ADD PROFILE - Netflix Style
   ======================================== */
.add-profile .profile-avatar,
.add-avatar {
    background: transparent !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-avatar svg {
    width: 60%;
    height: 60%;
    fill: var(--netflix-gray);
    transition: fill var(--transition-fast);
}

.add-profile:hover .add-avatar svg {
    fill: var(--netflix-white);
}

.add-profile .profile-name {
    color: var(--netflix-gray);
}

.add-profile:hover .profile-name {
    color: var(--netflix-white);
}

/* ========================================
   MANAGE PROFILES BUTTON - Netflix Style
   ======================================== */
.manage-profiles-btn {
    background: transparent;
    border: 1px solid var(--netflix-gray);
    color: var(--netflix-gray);
    padding: 0.5em 1.5em;
    font-size: clamp(12px, 1.2vw, 18px);
    font-family: var(--font-body);
    font-weight: 400;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: border-color var(--transition-fast), color var(--transition-fast);
}

.manage-profiles-btn:hover {
    border-color: var(--netflix-white);
    color: var(--netflix-white);
}

/* ========================================
   FOOTER - Netflix Style
   ======================================== */
.footer {
    padding: 30px 4%;
    text-align: center;
    color: var(--netflix-gray);
    font-size: 13px;
    margin-top: auto;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--netflix-gray);
    text-decoration: none;
    font-size: 13px;
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--netflix-white);
    text-decoration: underline;
}

.footer-credit {
    margin-bottom: 8px;
}

.footer-credit a {
    color: var(--netflix-gray);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer-credit a:hover {
    color: var(--netflix-white);
}

.footer-year {
    font-size: 12px;
    color: #666;
}

/* ========================================
   PAGE TRANSITION
   ======================================== */
.page-transition {
    position: fixed;
    inset: 0;
    background: var(--netflix-dark);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease-out;
}

.page-transition.active {
    opacity: 1;
    pointer-events: all;
}

/* ========================================
   RESPONSIVE - Netflix Breakpoints
   ======================================== */
@media (max-width: 1100px) {
    .primary-nav {
        display: none;
    }
}

@media (max-width: 800px) {
    .profiles-grid {
        gap: 15px;
        max-width: 90%;
    }
    
    .profile-avatar {
        width: clamp(70px, 20vw, 120px);
        height: clamp(70px, 20vw, 120px);
    }
    
    .profile-title {
        margin-bottom: 1.5em;
    }
    
    .header-right .icon-btn {
        display: none;
    }
    
    .footer-links {
        gap: 15px;
    }
}

@media (max-width: 500px) {
    .header {
        padding: 10px 4%;
        height: 50px;
    }
    
    .profiles-grid {
        gap: 12px;
    }
    
    .profile-avatar {
        width: 80px;
        height: 80px;
    }
    
    .profile-name {
        font-size: 11px;
    }
    
    .manage-profiles-btn {
        padding: 0.4em 1.2em;
        font-size: 12px;
    }
    
    .header-avatar {
        width: 28px;
        height: 28px;
    }
}

/* ========================================
   SCROLLBAR - Dark Theme
   ======================================== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--netflix-dark);
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Selection */
::selection {
    background: var(--netflix-red);
    color: white;
}

/* ========================================
   LOADING ANIMATION FOR PROFILES
   ======================================== */
.profile-avatar.loading {
    background: linear-gradient(90deg, #333 25%, #444 50%, #333 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

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