/* === RESET & BASE === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@font-face {
    font-family: 'Netflix Sans';
    src: local('Helvetica Neue'), local('Arial');
}

:root {
    --netflix-red: #e50914;
    --netflix-red-dark: #b20710;
    --netflix-black: #141414;
    --netflix-dark: #1a1a1a;
    --netflix-gray: #808080;
    --netflix-light-gray: #b3b3b3;
    --netflix-white: #e5e5e5;
    --profile-size: clamp(84px, 12vw, 150px);
    --transition-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --transition-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: var(--netflix-black);
    color: var(--netflix-white);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

/* === FUNDO ANIMADO === */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(229, 9, 20, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 50%, rgba(229, 9, 20, 0.04) 0%, transparent 60%),
        radial-gradient(ellipse at 50% 0%, rgba(229, 9, 20, 0.03) 0%, transparent 50%);
    animation: bgPulse 8s ease-in-out infinite alternate;
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.02'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

@keyframes bgPulse {
    0% { opacity: 0.6; }
    100% { opacity: 1; }
}

/* === HEADER === */
header {
    text-align: center;
    position: relative;
    z-index: 1;
    animation: slideDown 0.8s var(--transition-smooth) both;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo {
    margin-bottom: clamp(16px, 3vw, 32px);
}

.logo img {
    width: clamp(80px, 15vw, 180px);
    height: auto;
    filter: drop-shadow(0 4px 20px rgba(229, 9, 20, 0.3));
    transition: filter 0.4s var(--transition-smooth);
}

.logo img:hover {
    filter: drop-shadow(0 4px 30px rgba(229, 9, 20, 0.5));
}

h1 {
    font-size: clamp(1.4rem, 4vw, 3.2rem);
    font-weight: 400;
    color: #ffffff;
    letter-spacing: 0.02em;
    margin-bottom: clamp(20px, 4vw, 48px);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* === MAIN === */
main {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}

/* === PROFILES SECTION === */
.profiles ul {
    list-style: none;
    display: flex;
    gap: clamp(12px, 3vw, 32px);
    justify-content: center;
    flex-wrap: wrap;
    padding: 0 16px;
}

/* === PROFILE CARD === */
.profile {
    text-align: center;
    cursor: pointer;
    position: relative;
    animation: profileAppear 0.6s var(--transition-bounce) both;
    transition: transform 0.3s var(--transition-smooth);
}

.profile:nth-child(1) { animation-delay: 0.15s; }
.profile:nth-child(2) { animation-delay: 0.30s; }
.profile:nth-child(3) { animation-delay: 0.45s; }
.profile:nth-child(4) { animation-delay: 0.60s; }
.profile:nth-child(5) { animation-delay: 0.75s; }

@keyframes profileAppear {
    from {
        opacity: 0;
        transform: scale(0.7) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* === PROFILE IMAGE === */
.profile img {
    width: var(--profile-size);
    height: var(--profile-size);
    border-radius: 8px;
    object-fit: cover;
    border: 3px solid transparent;
    transition: all 0.35s var(--transition-smooth);
    filter: brightness(0.85);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    display: block;
    margin: 0 auto;
}

.profile:hover img,
.profile:focus-visible img {
    border-color: #ffffff;
    filter: brightness(1.05);
    transform: scale(1.08);
    box-shadow:
        0 0 0 3px #ffffff,
        0 0 25px rgba(229, 9, 20, 0.35),
        0 8px 30px rgba(0, 0, 0, 0.6);
}

/* Overlay glow no hover */
.profile::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(var(--profile-size) + 12px);
    height: calc(var(--profile-size) + 12px);
    border-radius: 12px;
    background: radial-gradient(circle, rgba(229, 9, 20, 0.2) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s var(--transition-smooth);
    pointer-events: none;
    z-index: -1;
}

.profile:hover::before {
    opacity: 1;
}

/* === PROFILE NAME === */
.profile p {
    margin-top: clamp(8px, 1.5vw, 14px);
    font-size: clamp(0.75rem, 1.5vw, 1.1rem);
    color : var(--netflix-light-gray);
    font-weight: 400;
    letter-spacing: 0.04em;
    transition: color 0.3s var(--transition-smooth);
}

.profile:hover p,
.profile:focus-visible p {
    color: #ffffff;
}

/* === SELECTED ANIMATION === */
.profile.selected {
    animation: profileSelected 0.6s var(--transition-smooth) forwards;
}

@keyframes profileSelected {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(1.3); opacity: 0; }
}

.profile.fade-out {
    animation: fadeOut 0.4s var(--transition-smooth) forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: scale(0.9);
    }
}

/* === MANAGE PROFILES BUTTON === */
.manage-profiles {
    margin-top: clamp(28px, 5vw, 56px);
    padding: clamp(8px, 1.2vw, 14px) clamp(20px, 3vw, 40px);
    background: transparent;
    color: var(--netflix-gray);
    border: 1.5px solid var(--netflix-gray);
    font-size: clamp(0.7rem, 1.2vw, 1rem);
    font-family: inherit;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.35s var(--transition-smooth);
    animation: buttonAppear 0.6s var(--transition-smooth) 0.9s both;
    z-index: 1;
}

@keyframes buttonAppear {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Shimmer effect */
.manage-profiles::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.08),
        transparent
    );
    transition: left 0.5s ease;
    z-index: -1;
}

.manage-profiles:hover::before {
    left: 100%;
}

.manage-profiles:hover,
.manage-profiles:focus-visible {
    color: #ffffff;
    border-color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.manage-profiles:active {
    transform: scale(0.97);
}

.manage-profiles:focus-visible {
    outline: 2px solid var(--netflix-red);
    outline-offset: 4px;
}

/* === FOCUS VISIBLE (ACESSIBILIDADE) === */
.profile:focus-visible {
    outline: 2px solid var(--netflix-red);
    outline-offset: 6px;
    border-radius: 8px;
}

/* ============================================
   RESPONSIVIDADE
   ============================================ */

/* Telas grandes (1400px+) */
@media (min-width: 1400px) {
    :root {
        --profile-size: 170px;
    }

    .profiles ul {
        gap: 40px;
    }

    h1 {
        font-size: 3.5rem;
    }
}

/* Tablets */
@media (max-width: 768px) {
    body {
        padding: 24px 16px;
    }

    .profiles ul {
        gap: 16px;
    }

    h1 {
        font-size: 1.6rem;
    }

    .profile img {
        border-radius: 6px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    body {
        justify-content: flex-start;
        padding-top: 15vh;
    }

    .profiles ul {
        gap: 12px;
        max-width: 320px;
    }

    :root {
        --profile-size: 80px;
    }

    .profile img {
        border-width: 2px;
        border-radius: 5px;
    }

    .profile p {
        font-size: 0.7rem;
    }

    .manage-profiles {
        padding: 8px 20px;
        font-size: 0.65rem;
        letter-spacing: 0.15em;
    }

    h1 {
        margin-bottom: 24px;
    }
}

/* Mobile muito pequeno */
@media (max-width: 360px) {
    :root {
        --profile-size: 68px;
    }

    .profiles ul {
        gap: 8px;
    }

    body {
        padding-top: 12vh;
    }
}

/* Landscape em mobile */
@media (max-height: 500px) and (orientation: landscape) {
    body {
        padding: 16px;
        justify-content: center;
    }

    :root {
        --profile-size: 80px;
    }

    h1 {
        font-size: 1.2rem;
        margin-bottom: 12px;
    }

    .manage-profiles {
        margin-top: 16px;
    }

    header {
        margin-bottom: 0;
    }

    .logo img {
        width: 70px;
    }
}

/* === PREFERS REDUCED MOTION === */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    body::before {
        animation: none;
    }
}

/* === SCROLLBAR CUSTOM === */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--netflix-black);
}

::-webkit-scrollbar-thumb {
    background: var(--netflix-red-dark);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--netflix-red);
}

/* === SELECTION === */
::selection {
    background: var(--netflix-red);
    color: #ffffff;
}
