/* ==========================================================================
    VARIÁVEIS E SETUP GLOBAL
   ========================================================================== */
:root {
    --bg: #141414;
    --card: #1f1f1f;
    --red: #e50914;
    --text: #ffffff;
    --muted: #b3b3b3;
    --transition: 0.2s ease-in-out;
}

.light-theme {
    --bg: #ffffff;
    --card: #f4f4f4;
    --red: #c1121f;
    --text: #111111;
    --muted: #4a4a4a;
}

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
}

/* O segredo da centralização "elevada":
    Justify-content centraliza, e o padding-bottom empurra o bloco para cima.
*/
body {
    display: flex;
    flex-direction: column;
    justify-content: center; 
    align-items: center;
    min-height: 100vh;
    padding-bottom: 12vh; /* Ajuste este valor para subir ou descer o conjunto todo */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(180deg, var(--bg), #0f0f0f);
    color: var(--text);
    transition: background-color var(--transition), color var(--transition);
    -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
    CABEÇALHO (TÍTULO)
   ========================================================================== */
header {
    text-align: center;
    width: 100%;
    padding: 1rem;
    margin-bottom: 2rem; /* Espaço seguro entre título e perfis */
    display: flex;
    justify-content: center;
    align-items: center;
}

header h1 {
    margin: 0;
    font-size: clamp(1.8rem, 5vw, 3rem);
    font-weight: 500;
    letter-spacing: 0.5px;
}

#theme-toggle {
    margin-left: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text);
    padding: 0.4rem 0.7rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: var(--transition);
}

#theme-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
    CONTEÚDO PRINCIPAL E PERFIS
   ========================================================================== */
main {
    width: 100%;
    max-width: 1000px;
    display: flex;
    justify-content: center;
    padding: 0 2rem;
}

.profiles {
    width: 100%;
}

.profiles-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: nowrap; /* Impede quebra de linha, mantendo os perfis em uma única linha */
    justify-content: center;
    gap: 2.5rem; /* Espaçamento entre os perfis */
}

.profile {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

.profile figure {
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
}

.profile img {
    width: clamp(7rem, 15vw, 11rem);
    aspect-ratio: 1/1;
    object-fit: cover;
    border-radius: 4px;
    border: 3px solid transparent;
    transition: transform var(--transition), border-color var(--transition);
}

.profile figcaption {
    color: var(--muted);
    font-size: clamp(0.9rem, 1.5vw, 1.2rem);
    transition: color var(--transition);
}

/* Efeito de Hover estilo Netflix */
.profile:hover img {
    transform: scale(1.05);
    border-color: #e5e5e5;
}

.profile:hover figcaption {
    color: #ffffff;
}

/* ==========================================================================
    RESPONSIVIDADE (MEDIA QUERIES)
   ========================================================================== */

/* TABLETS (iPad e similares) */
@media (max-width: 1024px) {
    body {
        padding-bottom: 8vh;
    }
    .profiles-list {
        gap: 2rem;
    }
}

/* MOBILE (Celulares) */
@media (max-width: 600px) {
    body {
        justify-content: flex-start; /* No mobile, alinhamos ao topo para permitir scroll */
        padding-top: 15vh;
        padding-bottom: 5vh;
    }

    header {
        margin-bottom: 1.5rem;
    }

    header h1 {
        font-size: 1.6rem;
    }

    .profiles-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr); /* 2 colunas no celular */
        gap: 2rem 1.5rem;
    }

    .profile img {
        width: 100%;
        max-width: 120px;
    }
}

/* ACESSIBILIDADE */
button.profile:focus-visible {
    outline: 2px solid var(--red);
    outline-offset: 4px;
}