/* =====================================================
   VARIÁVEIS CSS PARA DARK/LIGHT MODE
   ===================================================== */

:root {
    --bg-color: #141414; /* Fundo dark */
    --text-color: #fff; /* Texto dark */
    --accent-color: #fff; /* Cor de destaque */
}

.light-mode {
    --bg-color: #f5f5f5; /* Fundo light */
    --text-color: #000; /* Texto light */
    --accent-color: #000; /* Cor de destaque light */
}

body {
    background: var(--bg-color); /* Define a cor de fundo da página */
    color: var(--text-color); /* Define a cor do texto principal */
    font-family: 'Segoe UI', Arial, Helvetica, sans-serif; /* Define a fonte usada no site */
    margin: 0; /* Remove a margem padrão do body */
    min-height: 100vh; /* Garante que o body ocupe pelo menos toda a altura da tela */
    transition: background 0.3s ease, color 0.3s ease; /* Transição suave */
}

main {
    display: flex; /* Usa flexbox para layout */
    flex-direction: column; /* Organiza os elementos em coluna */
    align-items: center; /* Centraliza os itens horizontalmente */
    justify-content: center; /* Centraliza os itens verticalmente */
    min-height: 100vh; /* Garante altura mínima de 100% da tela */
    padding: 20px; /* Espaçamento interno para mobile */
    position: relative; /* Para posicionar o botão */
}

#theme-toggle {
    position: absolute; /* Posiciona no canto superior direito */
    top: 20px;
    right: 20px;
    opacity: 0; /* Esconde o input */
    width: 0;
    height: 0;
}

.toggle-switch {
    position: absolute; /* Posiciona no canto superior direito */
    top: 20px;
    right: 20px;
    width: 60px; /* Largura do switch */
    height: 30px; /* Altura do switch */
    background: var(--bg-color); /* Fundo variável */
    border: 2px solid var(--accent-color); /* Borda variável */
    border-radius: 30px; /* Bordas arredondadas */
    cursor: pointer; /* Cursor pointer */
    transition: all 0.3s ease; /* Transição suave */
    display: flex;
    align-items: center;
    padding: 2px;
}

.slider {
    width: 24px; /* Largura do slider */
    height: 24px; /* Altura do slider */
    background: var(--accent-color); /* Fundo do slider */
    border-radius: 50%; /* Circular */
    transition: transform 0.3s ease; /* Transição suave */
    position: relative;
}

#theme-toggle:checked + .slider {
    transform: translateX(30px); /* Move o slider para a direita quando checked */
}

.toggle-switch:hover {
    border-color: var(--text-color); /* Muda borda ao passar o mouse */
}

h1 {
    font-size: 2.5rem; /* Define o tamanho da fonte do título */
    font-weight: bold; /* Deixa o texto em negrito */
    margin-bottom: 2rem; /* Espaço abaixo do título */
    letter-spacing: 1px; /* Espaçamento entre letras */
    text-align: center; /* Centraliza o texto */
}

section[aria-label="Perfis disponíveis"] {
    width: 100%; /* Ocupa toda a largura disponível */
    max-width: 600px; /* Limita a largura máxima */
    display: flex; /* Usa flexbox */
    justify-content: center; /* Centraliza os perfis */
}

ul.profiles {
    display: flex; /* Usa flexbox para os perfis */
    gap: 2rem; /* Espaço entre os perfis */
    flex-wrap: wrap; /* Permite quebra de linha em telas pequenas */
    justify-content: center; /* Centraliza os perfis */
    list-style: none; /* Remove bullets da lista */
    padding: 0; /* Remove padding padrão */
    margin: 0; /* Remove margem padrão */
}

.profile-link {
    text-decoration: none; /* Remove sublinhado dos links */
    color: var(--text-color); /* Cor do texto dos links */
    transition: transform 0.2s, box-shadow 0.2s; /* Suaviza animações de transformação e sombra */
    display: block; /* Faz o link ocupar todo o espaço */
}

figure {
    margin: 0; /* Remove margem padrão */
    display: flex; /* Usa flexbox */
    flex-direction: column; /* Organiza em coluna */
    align-items: center; /* Centraliza itens */
}

img {
    width: 120px; /* Largura fixa da imagem */
    height: 120px; /* Altura fixa da imagem */
    border-radius: 8px; /* Bordas arredondadas */
    object-fit: cover; /* Mantém proporção da imagem */
    margin-bottom: 0.5rem; /* Espaço abaixo da imagem */
    background: var(--bg-color); /* Cor de fundo da imagem variável */
    display: block; /* Exibe como bloco */
    border: 1px transparent; /* Borda inicial invisível */
}

img:hover {
    border: 1px solid var(--accent-color); /* Borda ao passar o mouse */
}

figcaption {
    font-size: 1.1rem; /* Tamanho da fonte da legenda */
    font-weight: 500; /* Peso da fonte */
    margin-top: 0.5rem; /* Espaço acima da legenda */
    letter-spacing: 0.5px; /* Espaçamento entre letras */
}

/* ---------- GERENCIAR ---------- */

.gerenciar {
    margin-top: 20px;
    width: 100%;
    display: flex;
    justify-content: center;
}

.botao-gerenciar {
    background: transparent;
    border: 1px solid grey;
    color: grey;
    padding: 10px 30px;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    font-weight: 200;
    transition: all 0.3s;
}

.botao-gerenciar:hover {
    border-color: #e5e5e5;
    color: #e5e5e5;
}

/* =====================================================
   MEDIA QUERIES - RESPONSIVIDADE
   ===================================================== */

/* Tablet: até 768px */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem; /* Reduz tamanho do título */
        margin-bottom: 1.5rem;
    }

    ul.profiles {
        gap: 1.5rem; /* Reduz espaço entre perfis */
    }

    img {
        width: 100px; /* Reduz tamanho das imagens */
        height: 100px;
    }

    figcaption {
        font-size: 1rem; /* Reduz tamanho da legenda */
    }
}

/* Mobile: até 480px */
@media (max-width: 480px) {
    main {
        padding: 15px; /* Reduz padding */
        justify-content: flex-start; /* Afasta do topo ligeiramente */
        padding-top: 40px;
    }

    .toggle-switch {
        top: 10px; /* Ajusta posição no mobile */
        right: 10px;
        width: 50px; /* Menor */
        height: 25px;
    }

    .slider {
        width: 20px;
        height: 20px;
    }

    #theme-toggle:checked + .slider {
        transform: translateX(25px); /* Ajusta movimento */
    }

    h1 {
        font-size: 1.5rem; /* Reduz bastante o título em mobile */
        margin-bottom: 1rem;
        letter-spacing: 0.5px;
    }

    ul.profiles {
        gap: 1rem; /* Espaço menor entre perfis */
    }

    img {
        width: 80px; /* Imagens menores em mobile */
        height: 80px;
    }

    figcaption {
        font-size: 0.9rem; /* Legenda menor */
    }

    section[aria-label="Perfis disponíveis"] {
        max-width: 100%; /* Ocupa toda largura em mobile */
    }
}

/* Ultra-mobile: até 360px */
@media (max-width: 360px) {
    h1 {
        font-size: 1.2rem; /* Muito pequeno para telas muito pequenas */
        margin-bottom: 0.8rem;
    }

    .toggle-switch {
        width: 45px; /* Ainda menor */
        height: 22px;
    }

    .slider {
        width: 18px;
        height: 18px;
    }

    #theme-toggle:checked + .slider {
        transform: translateX(23px);
    }

    ul.profiles {
        gap: 0.8rem;
    }

    img {
        width: 70px; /* Ainda menor */
        height: 70px;
    }

    figcaption {
        font-size: 0.85rem;
    }
}
