:root {
    --primary-blue: #1a73e8;
    --dark-blue: #0d47a1;
    --light-blue: #e8f0fe;
    --accent-blue: #4285f4;
    --black: #121212;
    --white: #ffffff;
    --gray: #5f6368;
    --light-gray: #f1f3f4;
    --card-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Google Sans', Roboto, Arial, sans-serif;
}

body {
    background-color: var(--light-gray);
    color: var(--black);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 100%;
    padding: 20px;
    margin: 0 auto;
}

/* Navbar Moderna */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 15px 0;
    position: relative;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

header h1 {
    color: var(--black);
    font-size: 1.8rem;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.contact-link a {
    color: var(--black);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: var(--light-blue);
    border: 1px solid rgba(0, 0, 0, 0.1);
    font-size: 0.95rem;
}

.contact-link a:hover {
    background-color: var(--primary-blue);
    color: var(--white);
    box-shadow: var(--card-shadow);
}

/* Área do Mascote */
.mascot-container {
    background-color: var(--white);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.mascot-container:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

.mascot {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.mascot-img {
    width: 130px;
    height: 130px;
    margin-bottom: 20px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-blue);
    box-shadow: 0 6px 12px rgba(26, 115, 232, 0.2);
    transition: all 0.3s ease;
}

.mascot-img:hover {
    transform: scale(1.05) rotate(2deg);
}

.speech-bubble {
    position: relative;
    background: var(--white);
    border-radius: 18px;
    padding: 18px;
    width: 100%;
    text-align: center;
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.speech-bubble::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(26, 115, 232, 0.05) 0%, rgba(255,255,255,0) 100%);
}

.speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 10px 10px 0;
    border-style: solid;
    border-color: var(--white) transparent;
}

#mascot-message {
    position: relative;
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--black);
    animation: textFadeIn 0.5s ease-out;
}

/* Grade de Botões Moderna */
.button-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.math-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 120px;
    padding: 15px;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--white);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--card-shadow);
    position: relative;
    overflow: hidden;
    text-align: center;
}

.math-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 100%);
}

.math-btn i {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.math-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.math-btn:active {
    transform: translateY(-2px);
}

/* Cores individuais para cada botão */
.btn-geometria {
    background: linear-gradient(135deg, #4285F4 0%, #34A853 100%);
    border-bottom: 4px solid #3367D6;
}

.btn-graficos {
    background: linear-gradient(135deg, #EA4335 0%, #FBBC05 100%);
    border-bottom: 4px solid #D33427;
}

.btn-algebra {
    background: linear-gradient(135deg, #673AB7 0%, #d430f1 100%);
    border-bottom: 4px solid #5E35B1;
}

.btn-probabilidade {
    background: linear-gradient(135deg, #FBBC05 0%, #EA4335 100%);
    border-bottom: 4px solid #E2A908;
}

.btn-combinatoria {
    background: linear-gradient(135deg, #34A853 0%, #4285F4 100%);
    border-bottom: 4px solid #2D8F48;
}

.btn-aritmetica {
    background: linear-gradient(135deg, #673AB7 0%, #d840f3 100%);
    border-bottom: 4px solid #5E35B1;
}

.btn-series {
    background: linear-gradient(135deg, #009688 0%, #4CAF50 100%);
    border-bottom: 4px solid #00897B;
}

/* Responsividade */
@media (max-width: 600px) {
    .button-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .mascot-img {
        width: 110px;
        height: 110px;
    }
}

@media (max-width: 400px) {
    .button-grid {
        grid-template-columns: 1fr;
    }
}

/* Estilos para os botões do header */
.header-buttons {
    display: flex;
    gap: 10px;
}

.header-button {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.back-button {
    background-color: var(--light-blue);
    color: var(--primary-blue);
}

.contact-button {
    background-color: var(--primary-blue);
    color: var(--white);
}

.header-button i {
    margin-right: 8px;
    font-size: 0.9rem;
}

/* Efeitos hover */
.back-button:hover {
    background-color: var(--primary-blue);
    color: var(--white);
    box-shadow: 0 2px 5px rgba(26, 115, 232, 0.2);
}

.contact-button:hover {
    background-color: var(--dark-blue);
    box-shadow: 0 2px 5px rgba(26, 115, 232, 0.2);
}

/* Responsividade */
@media (max-width: 600px) {
    .header-button {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    .header-button i {
        margin-right: 5px;
    }
    
    .header-buttons {
        gap: 8px;
    }
}

@media (max-width: 400px) {
    .header-button span {
        display: none;
    }
    
    .header-button i {
        margin-right: 0;
        font-size: 1rem;
    }
    
    .header-button {
        width: 36px;
        height: 36px;
        justify-content: center;
        padding: 0;
        border-radius: 50%;
    }
}

/* Container do vídeo */
.video-container {
    position: relative;
    padding-bottom: 56.25%; /* Proporção 16:9 */
    height: 0;
    overflow: hidden;
    margin: 20px 0;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Botão de exercícios */
.actions-container {
    text-align: center;
    margin-top: 25px;
}

.exercises-btn {
    display: inline-flex;
    align-items: center;
    padding: 12px 24px;
    background-color: var(--primary-blue);
    color: white;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(26, 115, 232, 0.2);
}

.exercises-btn:hover {
    background-color: var(--dark-blue);
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(26, 115, 232, 0.3);
}

.exercises-btn i {
    margin-right: 10px;
}

/* Modo Noturno */
body.dark-mode {
    --primary-blue: #5a9cf8;
    --dark-blue: #3a6db7;
    --light-blue: #1a1a2e;
    --black: #f0f0f0;
    --white: #121212;
    --gray: #b0b0b0;
    --light-gray: #1e1e1e;
    background-color: #121212;
    color: #f0f0f0;
}

.dark-mode .exercise-card,
.dark-mode .mascot-container,
.dark-mode .popup-content {
    background-color: #1e1e1e !important;
    border-color: #333 !important;
}

.dark-mode .speech-bubble {
    background-color: #252525 !important;
    color: #f0f0f0 !important;
}

.dark-mode .speech-bubble::after {
    border-color: #252525 transparent !important;
}

.dark-mode-btn .fa-sun {
    display: none;
}

.dark-mode .dark-mode-btn .fa-moon {
    display: none;
}

.dark-mode .dark-mode-btn .fa-sun {
    display: inline-block;
}

.dark-mode .header-button {
    border-color: #333 !important;
}

.dark-mode .back-button {
    background-color: #252525 !important;
}