/* Definindo as cores do autismo */
:root {
    --azul: #0077b6;
    --verde: #2a9d8f;
    --vermelho: #d90429;
    --amarelo: #ffd60a;
    --cinza: #4a4e69;
}

/* Reset básico para consistência */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Estilo global */
body {
    font-family: 'Verdana', 'Comic Sans MS', sans-serif;
    background-color: #f4f4f4;
    color: #333333;
    line-height: 1.4;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50" viewBox="0 0 50 50" opacity="0.1"><path fill="%230077b6" d="M25 5a5 5 0 015 5v10h10m5a5 0 0 1 0V30H10a5 5 0 010 10h10V10a5 0 015-5z"/></svg>');
    background-repeat: repeat;
    background-size: 50px 50px;
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1 0 auto;
}

/* Cabeçalho com degradê */
.navbar {
    background: linear-gradient(90deg, var(--azul), var(--vermelho), var(--amarelo), var(--verde));
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 4px solid var(--amarelo);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.navbar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" opacity="0.2"><path fill="%23ffffff" d="M10 2a2 2 0 012 2v4h4a2 2 0 010 4h-4v4a2 2 0 01-4 0v-4H4a2 2 0 010-4h4V4a2 2 0 012-2z"/></svg>');
    background-repeat: repeat;
    background-size: 20px 20px;
    pointer-events: none;
}

.home-link {
    color: white;
    font-size: 1.8em;
    text-decoration: none;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.nav-links a {
    color: white;
    margin-left: 15px;
    text-decoration: none;
    font-size: 1.1em;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    position: relative;
    padding: 5px 10px;
    transition: transform 0.2s;
}

.nav-links a:hover {
    color: var(--amarelo);
    transform: scale(1.1);
}

/* Container geral */
.container, #demo, .dashboard-main, .login-container, .mensagens-container, 
.relatorios-container, .register-container, .jogo-container, main {
    max-width: 1000px;
    margin: 40px auto;
    padding: 20px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    border: 2px solid var(--azul);
    text-align: center;
}

#demo {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.demo-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    width: 100%;
    max-width: 800px;
}

h2 {
    color: var(--azul);
    margin-bottom: 15px;
    font-size: 28px;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    position: relative;
}

h2::before {
    content: '🎉';
    position: absolute;
    left: -30px;
    font-size: 24px;
}

h2::after {
    content: '🎉';
    position: absolute;
    right: -30px;
    font-size: 24px;
}

p {
    font-size: 18px;
    margin-bottom: 15px;
    color: #333333;
    text-align: center;
}

/* Botões genéricos */
.btn, button {
    background-color: var(--vermelho);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 1.1em;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s, background-color 0.3s;
}

.btn-home {
    margin-top: 10px;
    background-color: var(--azul);
    color: white;
    border: 2px solid var(--azul);
}

.btn-home:hover {
    background-color: var(--vermelho);
    color: white;
}

.btn:hover, button:hover {
    background-color: var(--amarelo);
    color: black;
    transform: scale(1.05);
}

.btn-concluir {
    background-color: var(--amarelo);
    color: black;
}

.btn-concluir-disabled {
    background-color: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

/* Grids para rotinas e jogos */
.rotinas-container, .jogos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.rotina-card, .jogo-card {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    border: 2px solid var(--verde);
    transition: transform 0.2s;
}

.rotina-card:hover, .jogo-card:hover {
    transform: scale(1.03);
}

.rotina-card.amarelo { 
    background-color: #fff3cd;
}

.rotina-card.azul { 
    background-color: #d1ecf1;
}

.rotina-card.concluida { 
    opacity: 0.7;
}

.jogo-card {
    text-decoration: none;
    color: inherit;
}

.jogo-card:hover {
    background-color: #e0f7fa;
}

/* Estilos para o Timer */
.timer-container {
    margin: 15px 0;
    padding: 15px;
    border: 2px solid var(--azul);
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    gap: 10px;
}

#timerInput {
    padding: 5px;
    font-size: 16px;
    width: 60px;
}

#timerDisplay {
    font-size: 20px;
    font-weight: bold;
    color: var(--azul);
    margin: 0;
}

.rotina-imagem {
    width: 50px;
    height: 50px;
    border-radius: 5px;
    margin-right: 10px;
}

#rotina-form {
    margin-bottom: 15px;
    display: flex;
    gap: 10px;
    align-items: center;
}

#rotina-foto, #rotina-nome-ambiente {
    padding: 5px;
    border: 2px solid var(--cinza);
    border-radius: 5px;
    font-size: 16px;
}

/* Outros estilos existentes mantidos e ajustados conforme necessário */
.progresso-container {
    margin: 15px 0;
}

.barra-progresso {
    background-color: #e0e0e0;
    border-radius: 10px;
    height: 20px;
    overflow: hidden;
    border: 2px solid var(--azul);
}

#progressoRotinas {
    background-color: var(--verde);
    height: 100%;
    transition: width 0.3s ease;
    text-align: center;
    color: white;
    line-height: 20px;
    border-radius: 10px;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    max-width: 400px;
    border: 2px solid var(--azul);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.emocoes-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 20px;
}

.emocao-btn {
    font-size: 2em;
    background: none;
    border: none;
    cursor: pointer;
    transition: transform 0.2s;
}

.emocao-btn:hover {
    transform: scale(1.2);
}

/* Ajustes para tablets (600px-1024px) */
@media (max-width: 1024px) {
    .container, .dashboard-main {
        margin: 15px auto;
        padding: 15px;
    }

    .rotinas-container, .jogos-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }

    h2 {
        font-size: 24px;
    }

    .btn, button {
        padding: 8px 15px;
        font-size: 1em;
    }
}

/* Ajustes para celulares (até 600px) */
@media (max-width: 600px) {
    .container, .dashboard-main {
        margin: 10px auto;
        padding: 10px;
    }

    .rotinas-container, .jogos-grid {
        grid-template-columns: 1fr;
    }

    h2 {
        font-size: 20px;
    }

    .btn, button {
        padding: 6px 12px;
        font-size: 0.9em;
    }

    .timer-container {
        flex-direction: column;
        gap: 5px;
    }

    .timerInput {
        width: 80px;
    }
}

/* Estilo base do rodapé */
footer {
    flex-shrink: 0;
    background-color: #f0f0f0;
    padding: 10px;
    text-align: center;
    color: #333;
    border-top: 2px solid var(--azul);
    margin-top: 15px;
}

.footer-links a {
    color: var(--azul);
    text-decoration: none;
    margin: 0 8px;
    font-weight: bold;
}

.footer-links a:hover {
    text-decoration: underline;
    color: var(--vermelho);
}

/* Estilos para o Jogo da Memória */
.memory-game {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 10px;
    max-width: 600px;
    margin: 20px auto;
}

.memory-card {
    position: relative;
    width: 100%;
    padding-top: 100%; /* Mantém proporção quadrada */
    perspective: 1000px;
    cursor: pointer;
}

.memory-card.flip .front-face {
    transform: rotateY(0deg);
}

.memory-card.flip .back-face {
    transform: rotateY(180deg);
}

.front-face, .back-face {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    transition: transform 0.6s;
    border-radius: 10px;
}

.front-face {
    transform: rotateY(180deg);
}

.back-face {
    background-color: #fff;
    border: 2px solid var(--azul);
    transform: rotateY(0deg);
}

/* Estilos para o Jogo de Quebra-Cabeça */
.puzzle-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 5px;
    max-width: 400px;
    margin: 20px auto;
}

.puzzle-piece {
    background-color: #f9f9f9;
    border: 2px solid var(--azul);
    border-radius: 5px;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    color: #000;
    cursor: move;
}

.puzzle-piece.empty {
    background-color: #e0e0e0;
    border: none;
}

/* Estilos para o Jogo de Classificação de Emoções */
.jogo-classificacao {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 20px 0;
}

#emocao-img {
    width: 150px;
    height: 150px;
    margin-bottom: 20px;
    border: 2px solid var(--azul);
    border-radius: 10px;
}

#emocao-opcoes {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.btn-opcao-emocao {
    background-color: var(--verde);
    color: white;
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-opcao-emocao:hover {
    background-color: var(--amarelo);
    color: black;
}

#feedback-message {
    font-size: 18px;
    font-weight: bold;
}

#feedback-message.error {
    color: var(--vermelho);
}

/* Estilos para o gráfico */
.grafico-box {
    margin: 20px 0;
}

#rotinasChart {
    max-width: 100%;
    height: auto;
}

