/* assets/css/style.css */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;700;800;900&display=swap');

:root {
    /* Cores Principais */
    --cyan: #2BC9D1;
    --cyan-shade: #22aeb5;
    
    --green: #58CC02;
    --green-shade: #46a302;
    
    --yellow: #FFC800;
    --yellow-shade: #e5b400;
    
    --orange: #FF9600;
    --orange-shade: #cc7800;
    
    --red: #FF4B4B;
    --red-shade: #ea2b2b;

    /* Neutros */
    --text: #4B4B4B;
    --text-light: #777777;
    --bg-app: #FFFFFF;
    --border: #E5E5E5;
    --disabled: #E5E5E5;
    --disabled-text: #AFAFAF;

    /* Dimensões */
    --radius-btn: 16px;
    --radius-card: 20px;
}

* { 
    box-sizing: border-box; 
    -webkit-tap-highlight-color: transparent; 
}

body {
    font-family: 'Nunito', sans-serif;
    background-color: var(--bg-app);
    color: var(--text);
    margin: 0; 
    padding: 0;
    height: 100vh;
    overflow: hidden; /* App feel */
}

a { text-decoration: none; color: inherit; }
h1, h2, h3, p { margin: 0; }

/* --- COMPONENTES UI (Botões Estilo Duolingo) --- */

.btn-block {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: var(--radius-btn);
    font-weight: 800;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    cursor: pointer;
    transition: all 0.1s;
    user-select: none;
    
    /* Padrão (Verde/Sucesso) */
    background-color: var(--green);
    color: white;
    box-shadow: 0 4px 0 var(--green-shade);
    border-bottom: 2px solid transparent; /* Evita pulo no layout */
}

.btn-block:active:not(:disabled) {
    transform: translateY(4px);
    box-shadow: none;
    border-bottom: 0;
    margin-top: 2px; /* Compensação visual */
}

.btn-block:disabled, .btn-block.disabled {
    background-color: var(--disabled);
    color: var(--disabled-text);
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

/* Variantes de Cor */
.btn-primary {
    background-color: var(--cyan);
    box-shadow: 0 4px 0 var(--cyan-shade);
}
.btn-secondary {
    background-color: var(--orange);
    box-shadow: 0 4px 0 var(--orange-shade);
}
.btn-outline {
    background-color: transparent;
    border: 2px solid var(--border);
    box-shadow: 0 4px 0 var(--border);
    color: var(--text-light);
}

/* --- DASHBOARD LAYOUT --- */

.dashboard {
    display: flex;
    height: 100%;
    width: 100%;
}

/* Sidebar (Menu Lateral) */
.sidebar {
    width: 260px;
    border-right: 2px solid var(--border);
    background: white;
    padding: 20px;
    display: flex;
    flex-direction: column;
    z-index: 50; /* Z-index alto para ficar acima de tudo */
}

.logo-area {
    color: var(--cyan);
    font-weight: 900;
    font-size: 1.8rem;
    margin-bottom: 30px;
    letter-spacing: -0.5px;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: 12px;
    font-weight: 700;
    color: var(--text-light);
    border: 2px solid transparent;
    transition: background 0.2s;
    cursor: pointer;
    white-space: nowrap; /* Evita quebra de linha no texto */
}

.menu-item:hover { background: #f7f7f7; }
.menu-item.active {
    background: #ddf4ff;
    color: var(--cyan);
    border-color: #84d8ff;
}
.menu-item i { margin-right: 15px; font-size: 1.2rem; }

/* Área Principal (Mapa) */
.main-content {
    flex-grow: 1;
    overflow-y: auto;
    overflow-x: hidden; /* CORREÇÃO: Remove scroll horizontal indesejado */
    position: relative;
    background: white;
    padding-bottom: 80px;
}

/* Cabeçalho do Mundo */
.world-header {
    background: var(--cyan);
    color: white;
    padding: 40px 20px;
    text-align: center;
    border-bottom: 4px solid var(--cyan-shade);
    margin-bottom: 40px;
}
.world-header h1 { font-size: 1.5rem; font-weight: 800; margin-bottom: 5px; opacity: 0.9; }
.world-header h2 { font-size: 2rem; font-weight: 900; }

/* Caminho da Cobrinha (Snake Path) */
.snake-path {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 20px;
}

.level-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    width: 100%;
}

/* Ziguezague simples */
.level-wrapper:nth-child(4n+1) { transform: translateX(0); }
.level-wrapper:nth-child(4n+2) { transform: translateX(40px); }
.level-wrapper:nth-child(4n+3) { transform: translateX(0); }
.level-wrapper:nth-child(4n+4) { transform: translateX(-40px); }

.level-node {
    width: 75px; height: 70px;
    border-radius: 50%;
    background-color: var(--cyan);
    box-shadow: 0 6px 0 var(--cyan-shade);
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 1.8rem;
    position: relative;
    z-index: 2;
    transition: transform 0.1s;
}

.level-node:active { transform: translateY(6px); box-shadow: none; }

/* Estados do Nível */
.level-node.completed {
    background-color: var(--yellow);
    box-shadow: 0 6px 0 var(--yellow-shade);
}
.level-node.locked {
    background-color: var(--disabled);
    box-shadow: 0 6px 0 #cfcfcf;
    color: #afafaf;
    cursor: default;
}
.level-node.locked:active { transform: none; box-shadow: 0 6px 0 #cfcfcf; }

/* Coroa Flutuante no Nível Atual */
.current-indicator {
    position: absolute;
    top: -45px;
    background: white;
    padding: 5px 10px;
    border-radius: 10px;
    border: 2px solid var(--border);
    font-weight: 800;
    font-size: 1rem;
    color: var(--cyan);
    animation: float 2s infinite ease-in-out;
    white-space: nowrap;
    z-index: 5;
}
.current-indicator::after {
    content: ''; position: absolute; bottom: -6px; left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent; border-right: 6px solid transparent;
    border-top: 6px solid var(--border);
}

@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

/* --- AULAS E QUIZ --- */

.lesson-container {
    max-width: 600px;
    margin: 0 auto;
    height: calc(100svh);
    display: flex;
    flex-direction: column;
}

.top-bar {
    display: flex;
    align-items: center;
    padding: 20px;
    gap: 15px;
}

.progress-track {
    flex-grow: 1;
    height: 16px;
    background: var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--green);
    border-radius: 8px;
    width: 0%;
    transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.quiz-option {
    border: 2px solid var(--border);
    border-radius: var(--radius-btn);
    padding: 18px;
    margin-bottom: 12px;
    font-weight: 700;
    cursor: pointer;
    background: white;
    box-shadow: 0 2px 0 var(--border);
    transition: background 0.2s;
    display: flex; justify-content: space-between; align-items: center;
}

.quiz-option:hover { background: #f7f7f7; }

.quiz-option.selected {
    border-color: var(--cyan-shade);
    background: #ddf4ff;
    color: var(--cyan-shade);
}

/* Feedback (Bottom Sheet) */
.feedback-sheet {
    position: fixed; bottom: -100%; left: 0; width: 100%;
    padding: 30px;
    border-top: 2px solid transparent;
    transition: bottom 0.3s cubic-bezier(0.175, 0.885, 0.32, 1);
    z-index: 100;
}
.feedback-sheet.active { bottom: 0; }

.feedback-sheet.success { background: #d7ffb8; color: var(--green-shade); border-color: #b8f28b; }
.feedback-sheet.error { background: #ffdfe0; color: var(--red-shade); border-color: #ffb3b8; }

/* --- MENU DE UNIDADES FLUTUANTE --- */
/* Criamos um container que "flutua" acima da barra */
.units-container {
    position: absolute;
    bottom: 100%; /* Sobe para cima da barra */
    left: 0;
    width: 100%;
    background: #f8f9fa;
    max-height: 300px;
    overflow-y: auto;
    border-top: 2px solid var(--border);
    box-shadow: 0 -5px 15px rgba(0,0,0,0.05);
    display: none; /* Escondido por padrão */
    padding: 10px;
}

/* Quando clicado (via JS), o container aparece */
.units-container.open {
    display: block;
}

/* --- RESPONSIVO (MOBILE) --- */
@media (max-width: 768px) {
    .dashboard{
        flex-direction: column-reverse;
    }
    
    /* Transforma a Sidebar numa Barra Inferior */
    .sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: auto;
        background: white;
        border-top: 2px solid var(--border);
        z-index: 10000;
        padding: 10px;
        display: block;
    }

    /* Esconde o Logo no Mobile para ganhar espaço */
    .logo-area { display: none; }

    /* Organiza os 4 itens principais em linha */
    .sidebar-menu {
        display: flex;
        justify-content: space-around;
        align-items: flex-end;
        flex-direction: row;
    }

    /* Estiliza cada item com ícone acima do texto */
    .sidebar-menu .menu-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        padding: 8px 0 !important;
        font-size: 0.7rem !important;
        text-transform: uppercase;
        font-weight: 800;
        color: var(--text-light);
    }

    .sidebar-menu .menu-item i {
        font-size: 1.3rem;
        margin: 0 !important;
    }

    .sidebar-menu .menu-item.active {
        color: var(--cyan);
        background: none;
    }

    /* Ajuste no padding do conteúdo principal para não ficar atrás do menu */
    .main-content {
        padding-bottom: 100px;
    }
}