/* 1. RESET E VARIÁVEIS */
/* Variáveis CSS para cores e estilos, com suporte a modo escuro */
:root {
    --bg-body: #f4f4f9;
    --bg-container: #ffffff;
    --bg-card: #fafafa;
    --text-main: #333333;
    --text-secondary: #777777;
    --border-color: #eeeeee;
    --input-bg: #ffffff;
    --shadow: rgba(0, 0, 0, 0.1);
    --primary-color: #6a1b9a;
    --secondary-color: #9c4dcc;
    --focus-outline: 2px solid #6a1b9a;
}

body.dark-mode {
    --bg-body: #121212;
    --bg-container: #1e1e1e;
    --bg-card: #2a2a2a;
    --text-main: #f0f0f0;
    --text-secondary: #bbbbbb;
    --border-color: #444444;
    --input-bg: #333333;
    --shadow: rgba(0, 0, 0, 0.5);
    --focus-outline: 2px solid #bb86fc;
}

/* 2. LAYOUT BASE (AJUSTADO PARA ROLAGEM) */
/* Estilos base para body e html */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100%;
}

body { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    background: var(--bg-body); 
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 20px;
    transition: background 0.3s, color 0.3s;
    box-sizing: border-box;
}

/* 3. CONTAINER PRINCIPAL */
/* Estilo do container principal da aplicação */
.container { 
    width: 100%;
    max-width: 450px; 
    background: var(--bg-container); 
    padding: 30px; 
    border-radius: 20px; 
    box-shadow: 0 10px 30px var(--shadow); 
    box-sizing: border-box; 
    margin-bottom: 40px; 
    text-align: center;
}

/* 4. ELEMENTOS DE FORMULÁRIO */
/* Estilos para inputs, selects e botões */
select, input { 
    width: 100%; 
    padding: 12px; 
    margin: 10px 0; 
    border-radius: 8px; 
    border: 1px solid var(--border-color); 
    background-color: var(--input-bg);
    color: var(--text-main);
    box-sizing: border-box;
    font-size: 16px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

select:focus, input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(106, 27, 154, 0.15);
}

button { 
    width: 100%;
    padding: 14px;
    margin: 10px 0;
    border-radius: 8px;
    background: var(--primary-color); 
    color: white; 
    border: none; 
    cursor: pointer; 
    font-weight: bold;
    font-size: 1rem;
    transition: transform 0.1s, filter 0.2s, background 0.3s, box-shadow 0.3s;
    box-shadow: 0 4px 15px rgba(106, 27, 154, 0.3);
}

button:hover {
    filter: brightness(1.1);
    box-shadow: 0 6px 20px rgba(106, 27, 154, 0.4);
    transform: translateY(-2px);
}

button:active {
    transform: scale(0.98);
}

button:focus {
    outline: var(--focus-outline);
}

/* Estilo especial para botão de surpresa */
.btn-surprise {
    background: linear-gradient(135deg, #ff6b9d 0%, #c44569 100%);
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.4);
}

.btn-surprise:hover {
    box-shadow: 0 6px 25px rgba(255, 107, 157, 0.6);
}

/* 5. RESULTADOS E CARDS */
/* Estilos para a área de resultados e cards */
#resultado {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid var(--border-color);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 18px; 
    justify-content: center;
}

.card-perfume {
    padding: 18px;
    border: 2px solid var(--border-color);
    border-radius: 16px;
    background: var(--bg-card);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column; 
    align-items: center;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.card-perfume::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.card-perfume:hover::before {
    left: 100%;
}

.card-perfume:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 8px 25px rgba(106, 27, 154, 0.2);
    border-color: var(--primary-color);
}

.img-perfume {
    width: 100%;
    height: 140px;
    object-fit: contain;
    object-position: center;
    border-radius: 12px;
    margin-bottom: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.card-perfume:hover .img-perfume {
    transform: scale(1.08);
}

.perfume-marca {
    display: block;
    font-size: 0.7em;
    text-transform: uppercase;
    font-weight: bold;
    color: var(--primary-color);
    letter-spacing: 1px;
    margin-bottom: 4px;
}

body.dark-mode .perfume-marca {
    color: #bb86fc;
}

.card-perfume strong {
    font-size: 1em;
    color: var(--secondary-color);
    display: block;
}

.card-perfume p {
    font-size: 0.85em;
    margin: 4px 0;
    color: var(--text-secondary);
}

/* 6. COMPONENTES ESPECÍFICOS */
/* Estilos específicos para badges e durações */
.badge-intensity {
    display: inline-block;
    padding: 4px 10px;
    font-weight: bold;
    font-size: 10px;
    color: white;
    border-radius: 4px;
    background: linear-gradient(135deg, #ff8c00 0%, #ff0000 100%) !important;
    box-shadow: 0 0 10px rgba(255, 69, 0, 0.4);
    animation: pulse-glow 2s infinite ease-in-out;
    margin: 8px 0;
    text-transform: uppercase;
}

.perfume-duracao {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(0,0,0,0.05);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75em;
    margin-top: 8px;
    color: var(--text-secondary);
}

body.dark-mode .perfume-duracao {
    background: rgba(255,255,255,0.1);
}

/* 7. ANIMAÇÕES E SKELETON */
/* Animações para skeleton e glow */
@keyframes pulse-glow {
    0% { transform: scale(1); opacity: 0.9; }
    50% { transform: scale(1.05); opacity: 1; }
    100% { transform: scale(1); opacity: 0.9; }
}

@keyframes skeleton-loading {
    0% { background-color: var(--border-color); opacity: 0.5; }
    50% { background-color: var(--border-color); opacity: 1; }
    100% { background-color: var(--border-color); opacity: 0.5; }
}

.skeleton-card {
    padding: 15px;
    border-radius: 12px;
    background: var(--bg-card);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.skeleton-img { 
    width: 100%; height: 140px; border-radius: 8px; 
    margin-bottom: 12px; animation: skeleton-loading 1.5s infinite; 
}

.skeleton-text { 
    width: 80%; height: 12px; border-radius: 4px; 
    margin-bottom: 8px; animation: skeleton-loading 1.5s infinite; 
}

/* 8. RESPONSIVIDADE */
/* Media queries para diferentes tamanhos de tela */
@media (max-width: 480px) {
    body {
        align-items: flex-start;
        padding: 10px;
    }
    .container {
        margin: 10px auto;
        padding: 20px;
        width: 100%;
        border-radius: 15px;
    }
    #resultado {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 10px;
    }
    .boas-vindas h1 {
        font-size: 1.5rem;
    }
    .boas-vindas p {
        font-size: 0.9rem;
    }
    .btn-home {
        font-size: 1rem;
        padding: 15px;
    }
}

@media (min-width: 481px) and (max-width: 767px) {
    /* Tablet pequeno */
    .container {
        max-width: 500px;
        padding: 25px;
    }
    #resultado {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 12px;
    }
    .botoes-home {
        gap: 12px;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    /* Tablet */
    .container {
        max-width: 600px;
        padding: 35px;
    }
    #resultado {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 18px;
    }
    .boas-vindas {
        max-width: 400px;
    }
    .botoes-home {
        justify-content: center;
        gap: 15px;
    }
    .btn-home {
        flex: 1;
        max-width: 200px;
    }
}

@media (min-width: 1024px) {
    /* PC */
    .container {
        max-width: 800px;
        padding: 40px;
    }
    #resultado {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 20px;
    }
    .boas-vindas {
        max-width: 500px;
    }
    .boas-vindas h1 {
        font-size: 2.5rem;
    }
    .botoes-home {
        gap: 20px;
    }
    .btn-home {
        flex: 1;
        max-width: 250px;
        padding: 20px;
        font-size: 1.2rem;
    }
    .menu-tabs {
        display: flex;
        justify-content: center;
        gap: 10px;
    }
    .tab-btn {
        flex: 1;
        max-width: 200px;
    }
}

/* 9. TELA INICIAL */
/* Estilos para a tela inicial (splash) */
#tela-inicial {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #6a1b9a 0%, #4a148c 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    color: white;
    text-align: center;
    transition: opacity 0.6s ease, visibility 0.6s;
}

.boas-vindas {
    max-width: 320px;
    padding: 20px;
    animation: zoomIn 0.8s ease;
}

.boas-vindas h1 {
    font-size: 2rem;
    margin: 20px 0;
    line-height: 1.2;
}

.boas-vindas p {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 30px;
}

.btn-entrar {
    background: white;
    color: #6a1b9a;
    font-size: 1.1rem;
    padding: 15px;
    border-radius: 50px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

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

.botoes-home {
    display: flex;
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
}

.btn-home {
    background: white;
    color: #6a1b9a;
    font-size: 1.1rem;
    padding: 18px;
    border-radius: 15px;
    border: none;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    transition: transform 0.2s, background 0.3s;
}

.btn-home:focus {
    outline: 2px solid white;
}

.btn-colar-home {
    color: #2e7d32;
}

.btn-home:hover {
    transform: scale(1.05);
}

.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.btn-voltar {
    width: auto;
    background: transparent !important;
    color: var(--text-secondary);
    padding: 5px 10px;
    margin: 0 0 10px 0;
    font-size: 0.8rem;
    border: 1px solid var(--border-color);
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    transition: background 0.3s, color 0.3s;
}

.btn-voltar:hover {
    background: var(--border-color);
    color: var(--text-main);
}

.btn-voltar:focus {
    outline: var(--focus-outline);
}

#conteudo-colares button {
    background: #2e7d32;
}

#conteudo-colares button:hover {
    filter: brightness(1.1);
}

#conteudo-colares button:focus {
    outline: 2px solid #2e7d32;
}

/* Estilos específicos para seção de colares */
#conteudo-colares .estacao-selector {
    background: linear-gradient(135deg, rgba(46, 125, 50, 0.08) 0%, rgba(76, 175, 80, 0.08) 100%) !important;
    border-left: 4px solid #2e7d32 !important;
}

#conteudo-colares .estacao-selector:hover {
    border-color: #2e7d32 !important;
}

#conteudo-colares select {
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

#conteudo-colares select:hover {
    border-color: #2e7d32;
    box-shadow: 0 4px 12px rgba(46, 125, 50, 0.1);
}

#conteudo-colares select:focus {
    outline: none;
    border-color: #2e7d32;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.15);
}

/* Suporte a navegação por teclado */
button:focus-visible, select:focus-visible, input:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

@media (prefers-contrast: high) {
    :root {
        --bg-body: #ffffff;
        --text-main: #000000;
        --border-color: #000000;
    }
    body.dark-mode {
        --bg-body: #000000;
        --text-main: #ffffff;
    }
}