/* Estilos inspirados na Netflix */

/* ============================================
   VARIÁVEIS
============================================ */
:root {
    --netflix-red: #e50914;
    --netflix-black: #000000;
    --netflix-dark-gray: #141414;
    --netflix-white: #ffffff;
    --netflix-gray: #808080;

    --gradient-1: #050505;
    --gradient-2: #151515;
    --gradient-3: #3d0000;
    --gradient-4: #110909;

    --light-gradient-1: #fffdf8;
    --light-gradient-2: #f5efe7;
    --light-gradient-3: #f4d8d8;
    --light-gradient-4: #f7f3ff;

    --vignette-color: rgba(0, 0, 0, 0.65);
    --header-overlay: linear-gradient(to bottom, rgba(0, 0, 0, 0.72), transparent);
    --toggle-bg: rgba(255, 255, 255, 0.04);
    --toggle-hover-bg: rgba(255, 255, 255, 0.1);
    --theme-shadow: rgba(229, 9, 20, 0.18);
}

/* Tema claro */
[data-theme="light"] {
    --netflix-red: #e50914;
    --netflix-black: #0b0b0b;
    --netflix-dark-gray: #f4f4f4;
    --netflix-white: #131313;
    --netflix-gray: #5f5f5f;

    --gradient-1: #050505;
    --gradient-2: #151515;
    --gradient-3: #3d0000;
    --gradient-4: #110909;

    --light-gradient-1: #fffdf8;
    --light-gradient-2: #f5efe7;
    --light-gradient-3: #f4d8d8;
    --light-gradient-4: #f7f3ff;

    --vignette-color: rgba(255, 255, 255, 0.06);
    --header-overlay: linear-gradient(to bottom, rgba(255, 255, 255, 0.88), transparent);
    --toggle-bg: rgba(255, 255, 255, 0.72);
    --toggle-hover-bg: rgba(255, 255, 255, 0.96);
    --theme-shadow: rgba(0, 0, 0, 0.08);
}

/* RESET */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

/* ============================================
   BODY
============================================ */
body {
    color: var(--netflix-white);
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;

    min-height: 100vh;
    padding: 1rem;

    display: flex;
    justify-content: center;
    align-items: center;

    position: relative;
    overflow: hidden;
    isolation: isolate;

    transition: color 0.35s ease, filter 0.6s ease;
}

body::before,
body::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
}

/* Camada dark base */
body::before {
    z-index: -3;
    background: linear-gradient(-45deg, var(--gradient-1), var(--gradient-2), var(--gradient-3), var(--gradient-4));
    background-size: 400% 400%;
    animation: darkBackgroundFlow 12s ease infinite;
    transition: opacity 0.9s ease, filter 0.45s ease, transform 0.45s ease;
    filter: brightness(0.95) saturate(1.05);
    opacity: 1;
}

/* Camada light sobreposta */
body::after {
    z-index: -2;
    background: linear-gradient(-45deg, var(--light-gradient-1), var(--light-gradient-2), var(--light-gradient-3), var(--light-gradient-4));
    background-size: 400% 400%;
    animation: lightBackgroundFlow 12s ease infinite;
    transition: opacity 0.9s ease, filter 0.45s ease, transform 0.45s ease;
    filter: brightness(1) saturate(1.05);
    opacity: 0;
}

/* Quando o tema for light, a camada clara aparece */
[data-theme="light"] body::after {
    opacity: 1;
}

/* Camada de vinheta separada */
body .bg-vignette {
    display: none;
}

body::selection {
    background: rgba(229, 9, 20, 0.3);
}

/* Vinheta usando background no próprio body com múltiplas camadas seria ruim aqui,
   então criamos com sombra no container visual */
body::marker {
    content: "";
}

/* Vinheta adicional */
body::before,
body::after {
    will-change: opacity, background-position, transform;
}

/* camada de vinheta */
body > * {
    position: relative;
    z-index: 1;
}

/* overlay de vinheta real */
body:has(main)::after {
    box-shadow: inset 0 0 180px 20px var(--vignette-color);
}

/* animação de troca */
body.theme-switching {
    filter: brightness(1.06);
}

body.theme-switching::before,
body.theme-switching::after {
    transform: scale(1.02);
}

/* ============================================
   HEADER
============================================ */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;

    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 15px 30px;
    z-index: 20;

    background: var(--header-overlay);
    transition: background 0.35s ease;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* LOGO */
.logo {
    width: 140px;
    height: auto;

    opacity: 0;
    transform: translateY(-20px);
    animation: logoEntry 1s ease forwards;

    filter: drop-shadow(0 0 10px rgba(229, 9, 20, 0.5));
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

/* BOTÃO */
.manage-btn {
    background: transparent;
    border: 1px solid var(--netflix-gray);
    color: var(--netflix-gray);

    padding: 8px 15px;
    border-radius: 5px;

    cursor: pointer;
    transition: all 0.3s ease;
}

.manage-btn:hover {
    color: var(--netflix-white);
    border-color: var(--netflix-white);
}

/* Botão de alternância de tema */
.theme-toggle {
    width: 52px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;

    background: var(--toggle-bg);
    border: 1px solid color-mix(in srgb, var(--netflix-gray) 75%, transparent);
    border-radius: 999px;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px var(--theme-shadow);

    cursor: pointer;
    overflow: hidden;
    transition:
        transform 0.2s ease,
        border-color 0.25s ease,
        background 0.25s ease,
        box-shadow 0.25s ease;
}

.theme-toggle:hover {
    transform: translateY(-2px) scale(1.04);
    background: var(--toggle-hover-bg);
    border-color: var(--netflix-white);
}

.theme-toggle:active {
    transform: scale(0.96);
}

.theme-toggle img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    display: block;
    transition: transform 0.35s ease, opacity 0.25s ease, filter 0.25s ease;
}

.theme-toggle:hover img {
    transform: rotate(12deg) scale(1.08);
}

.theme-toggle[aria-pressed="true"] img {
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.12));
}

/* ============================================
   MAIN
============================================ */
main {
    text-align: center;
    max-width: 900px;
    width: 100%;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    margin-top: 100px;
    min-height: calc(100vh - 100px);

    transition: color 0.25s ease;
}

/* TÍTULO */
h1 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    font-weight: 400;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

/* ============================================
   PROFILES
============================================ */
.Profiles ul,
.Profiles ol {
    list-style: none;
    padding: 0;
    margin: 0;
}

.Profiles ul ol {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.Profiles li {
    list-style: none;
}

/* PROFILE */
.profile {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    text-decoration: none;
    color: inherit;

    max-width: 180px;

    transform: translateY(20px);
    opacity: 0;

    animation: profileEntry 0.8s ease forwards;
}

/* Delay */
.Profiles li:nth-child(1) .profile { animation-delay: 0.2s; }
.Profiles li:nth-child(2) .profile { animation-delay: 0.4s; }
.Profiles li:nth-child(3) .profile { animation-delay: 0.6s; }
.Profiles li:nth-child(4) .profile { animation-delay: 0.8s; }

/* Glow */
.profile::before {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: 12px;

    background: linear-gradient(270deg, #e50914, #8b0000, #ff1a1a, #e50914);
    background-size: 400% 400%;

    z-index: -1;
    opacity: 0;

    animation: glowMove 6s ease infinite;
    transition: opacity 0.3s ease;
}


/* IMAGEM BASE */
.profile img {
    width: 100px;
    height: 100px;
    border-radius: 12px;
    object-fit: cover;
    border: 3px solid transparent;

    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.profile:hover img {
    transform: scale(1.08);
    border-color: var(--netflix-red);
    box-shadow: 0 0 20px rgba(229, 9, 20, 0.7);
}

/* TEXTO */
.profile p {
    margin-top: 0.8rem;
    font-size: 1rem;
    font-weight: 300;
}

/* ============================================
   ANIMAÇÕES
============================================ */
@keyframes darkBackgroundFlow {
    0% {
        background-position: 0% 50%;
        transform: scale(1);
    }
    50% {
        background-position: 100% 50%;
        transform: scale(1.035);
    }
    100% {
        background-position: 0% 50%;
        transform: scale(1);
    }
}

@keyframes lightBackgroundFlow {
    0% {
        background-position: 100% 50%;
        transform: scale(1);
    }
    50% {
        background-position: 0% 50%;
        transform: scale(1.025);
    }
    100% {
        background-position: 100% 50%;
        transform: scale(1);
    }
}

@keyframes glowMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes logoEntry {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes profileEntry {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}



/* ============================================
   RESPONSIVIDADE
============================================ */
@media (max-width: 480px) {
    header {
        padding: 14px 16px;
    }

    .header-actions {
        gap: 0.45rem;
    }

    .manage-btn {
        padding: 8px 10px;
        font-size: 0.85rem;
    }

    .theme-toggle {
        width: 46px;
        height: 46px;
    }

    .Profiles ul ol {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
        justify-items: center;
    }

    .profile img {
        width: 90px;
        height: 90px;
    }

    .profile p {
        font-size: 0.9rem;
    }

    .logo {
        width: 100px;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .Profiles ul ol {
        display: flex;
        justify-content: center;
        gap: 2rem;
        flex-wrap: wrap;
        max-width: 600px;
        margin: 0 auto;
    }

    .profile img {
        width: 130px;
        height: 130px;
    }

    .profile p {
        font-size: 1.1rem;
    }

    .logo {
        width: 120px;
    }
}

@media (min-width: 769px) {
    .Profiles ul ol {
        display: flex;
        justify-content: center;
        gap: 3rem;
        flex-wrap: nowrap;
    }

    .profile img {
        width: 160px;
        height: 160px;
    }

    .profile p {
        font-size: 1.2rem;
    }

    .logo {
        width: 160px;
    }

    h1 {
        font-size: 3rem;
        margin-bottom: 2.5rem;
    }
}