/* ============================================
   LÓGICA DE PROGRAMAÇÃO PARA CRIANÇAS
   Design colorido e animado para 8-10 anos
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --cor-primaria: #FF6B9D;
    --cor-secundaria: #4ECDC4;
    --cor-terciaria: #FFD93D;
    --cor-roxo: #A960EE;
    --cor-laranja: #FF8C42;
    --cor-verde: #6BCF7F;
    --cor-azul: #4A90E2;
    --cor-fundo: #FFF8F0;
    --cor-texto: #2C3E50;
    --sombra: 0 8px 20px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Comic Sans MS', 'Chalkboard SE', 'Arial Rounded MT Bold', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--cor-texto);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ============================================
   ANIMAÇÕES GLOBAIS
   ============================================ */

@keyframes flutuar {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

@keyframes girar {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes pulsar {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes aparecer {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes brilhar {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.3); }
}

@keyframes balanco {
    0%, 100% { transform: rotate(-3deg); }
    50% { transform: rotate(3deg); }
}

/* ============================================
   CONTAINER PRINCIPAL
   ============================================ */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    animation: aparecer 0.8s ease-out;
}

/* ============================================
   CABEÇALHO
   ============================================ */

header {
    text-align: center;
    padding: 40px 20px;
    background: white;
    border-radius: 30px;
    box-shadow: var(--sombra);
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: girar 3s linear infinite;
}

h1 {
    font-size: 3em;
    color: var(--cor-primaria);
    text-shadow: 3px 3px 0 var(--cor-secundaria);
    margin-bottom: 10px;
    animation: pulsar 2s ease-in-out infinite;
    position: relative;
    z-index: 1;
}

.subtitulo {
    font-size: 1.3em;
    color: var(--cor-roxo);
    position: relative;
    z-index: 1;
}

/* ============================================
   CARDS DE TÓPICOS
   ============================================ */

.topicos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

.card-topico {
    background: white;
    border-radius: 25px;
    padding: 30px;
    box-shadow: var(--sombra);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.card-topico::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--cor-primaria), var(--cor-secundaria), var(--cor-terciaria));
}

.card-topico:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.card-topico:active {
    transform: scale(0.98);
}

.icone-topico {
    font-size: 4em;
    margin-bottom: 15px;
    display: inline-block;
    animation: flutuar 3s ease-in-out infinite;
}

.card-topico:nth-child(1) { --cor-card: var(--cor-primaria); }
.card-topico:nth-child(2) { --cor-card: var(--cor-secundaria); }
.card-topico:nth-child(3) { --cor-card: var(--cor-terciaria); }
.card-topico:nth-child(4) { --cor-card: var(--cor-roxo); }
.card-topico:nth-child(5) { --cor-card: var(--cor-laranja); }
.card-topico:nth-child(6) { --cor-card: var(--cor-verde); }

.card-topico h2 {
    color: var(--cor-card);
    font-size: 1.8em;
    margin-bottom: 10px;
}

.card-topico p {
    color: var(--cor-texto);
    line-height: 1.6;
    font-size: 1.1em;
}

/* ============================================
   BOTÕES
   ============================================ */

.btn {
    display: inline-block;
    padding: 15px 40px;
    background: linear-gradient(135deg, var(--cor-primaria), var(--cor-secundaria));
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-size: 1.2em;
    font-weight: bold;
    box-shadow: var(--sombra);
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    margin: 10px;
}

.btn:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.btn:active {
    transform: scale(0.95);
}

.btn-voltar {
    background: linear-gradient(135deg, var(--cor-roxo), var(--cor-azul));
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    padding: 10px 20px;
    font-size: 1em;
}

/* ============================================
   CONTEÚDO DAS PÁGINAS
   ============================================ */

.conteudo-topico {
    background: white;
    border-radius: 25px;
    padding: 40px;
    box-shadow: var(--sombra);
    margin: 20px 0;
    animation: aparecer 0.6s ease-out;
}

.conteudo-topico h2 {
    color: var(--cor-primaria);
    font-size: 2.5em;
    margin-bottom: 20px;
    text-align: center;
}

.conteudo-topico h3 {
    color: var(--cor-secundaria);
    font-size: 1.8em;
    margin: 30px 0 15px 0;
}

.conteudo-topico p {
    font-size: 1.3em;
    line-height: 1.8;
    margin-bottom: 15px;
}

.exemplo-box {
    background: linear-gradient(135deg, #FFF5E6, #FFE6F0);
    border-left: 5px solid var(--cor-laranja);
    padding: 20px;
    margin: 20px 0;
    border-radius: 15px;
    animation: pulsar 3s ease-in-out infinite;
}

.exemplo-box strong {
    color: var(--cor-laranja);
    font-size: 1.2em;
}

.lista-exemplos {
    list-style: none;
    padding-left: 0;
}

.lista-exemplos li {
    padding: 15px;
    margin: 10px 0;
    background: linear-gradient(135deg, #E8F5E9, #E1F5FE);
    border-radius: 15px;
    font-size: 1.2em;
    animation: aparecer 0.5s ease-out backwards;
}

.lista-exemplos li:nth-child(1) { animation-delay: 0.1s; }
.lista-exemplos li:nth-child(2) { animation-delay: 0.2s; }
.lista-exemplos li:nth-child(3) { animation-delay: 0.3s; }
.lista-exemplos li:nth-child(4) { animation-delay: 0.4s; }

.lista-exemplos li::before {
    content: '✨ ';
    font-size: 1.3em;
    margin-right: 10px;
}

/* ============================================
   ILUSTRAÇÕES SVG
   ============================================ */

.ilustracao-container {
    text-align: center;
    margin: 30px 0;
}

.ilustracao-container svg {
    max-width: 100%;
    height: auto;
    animation: flutuar 4s ease-in-out infinite;
}

/* ============================================
   JOGOS
   ============================================ */

.jogo-container {
    background: white;
    border-radius: 25px;
    padding: 40px;
    box-shadow: var(--sombra);
    margin: 20px 0;
    text-align: center;
}

.jogo-titulo {
    color: var(--cor-roxo);
    font-size: 2.5em;
    margin-bottom: 20px;
}

.jogo-area {
    min-height: 400px;
    background: linear-gradient(135deg, #F5F7FA, #C3CFE2);
    border-radius: 20px;
    padding: 30px;
    margin: 20px 0;
}

.pontuacao {
    font-size: 2em;
    color: var(--cor-verde);
    font-weight: bold;
    margin: 20px 0;
    animation: pulsar 1s ease-in-out infinite;
}

.feedback {
    font-size: 1.5em;
    padding: 15px;
    border-radius: 15px;
    margin: 20px 0;
    font-weight: bold;
}

.feedback.correto {
    background: var(--cor-verde);
    color: white;
    animation: pulsar 0.5s ease-out;
}

.feedback.incorreto {
    background: var(--cor-primaria);
    color: white;
    animation: balanco 0.5s ease-out;
}

/* ============================================
   ELEMENTOS DRAG AND DROP
   ============================================ */

.drag-item {
    background: white;
    padding: 20px;
    margin: 10px;
    border-radius: 15px;
    cursor: move;
    display: inline-block;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    font-size: 1.2em;
}

.drag-item:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.drag-item.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

.drop-zone {
    min-height: 100px;
    border: 3px dashed var(--cor-secundaria);
    border-radius: 15px;
    padding: 20px;
    margin: 10px;
    background: rgba(78, 205, 196, 0.1);
    transition: all 0.3s ease;
}

.drop-zone.over {
    background: rgba(78, 205, 196, 0.3);
    border-color: var(--cor-primaria);
    transform: scale(1.02);
}

/* ============================================
   RESPONSIVO
   ============================================ */

@media (max-width: 768px) {
    h1 {
        font-size: 2em;
    }
    
    .topicos-grid {
        grid-template-columns: 1fr;
    }
    
    .conteudo-topico {
        padding: 20px;
    }
    
    .btn-voltar {
        position: static;
        display: block;
        margin: 20px auto;
    }
}

/* ============================================
   ELEMENTOS DECORATIVOS
   ============================================ */

.estrelas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.estrela {
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: brilhar 2s ease-in-out infinite;
}

/* ============================================
   LOADING E TRANSIÇÕES
   ============================================ */

.loading {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 5px solid var(--cor-fundo);
    border-top-color: var(--cor-primaria);
    border-radius: 50%;
    animation: girar 1s linear infinite;
}

/* ============================================
   FOOTER
   ============================================ */

footer {
    text-align: center;
    padding: 30px;
    background: white;
    border-radius: 25px;
    margin-top: 40px;
    box-shadow: var(--sombra);
}

footer p {
    font-size: 1.2em;
    color: var(--cor-roxo);
}
