/* =====================================================
   SISTEMA DE GAMIFICAÇÃO ESCOLAR
   CSS LÚDICO E RESPONSIVO
   ===================================================== */

/* Reset e Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --cor-primaria: #FF6B6B;
    --cor-secundaria: #4DABF7;
    --cor-sucesso: #51CF66;
    --cor-aviso: #FFD700;
    --cor-fundo: #F8F9FA;
    --cor-card: #FFFFFF;
    --cor-texto: #212529;
    --cor-texto-claro: #868E96;
    --sombra: 0 4px 12px rgba(0,0,0,0.08);
    --sombra-forte: 0 8px 24px rgba(0,0,0,0.12);
    --raio: 16px;
    --raio-pill: 50px;
}

html {
    font-size: 16px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--cor-fundo);
    color: var(--cor-texto);
    line-height: 1.6;
    min-height: 100vh;
}

/* =====================================================
   TIPOGRAFIA
   ===================================================== */
h1, h2, h3, h4 {
    font-weight: 800;
    line-height: 1.2;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.1rem; }

/* =====================================================
   LAYOUT E CONTAINERS
   ===================================================== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

.container-escolha {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

header.site-header {
    background: linear-gradient(135deg, var(--cor-primaria) 0%, #FF8787 100%);
    color: white;
    padding: 24px 0;
    text-align: center;
    border-bottom-left-radius: 32px;
    border-bottom-right-radius: 32px;
    box-shadow: var(--sombra-forte);
}

header.site-header h1 {
    font-size: 2.4rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.15);
}

header.site-header p {
    font-size: 1.1rem;
    opacity: 0.95;
    margin-top: 8px;
}

/* Topo Professor */
header.prof-header {
    background: linear-gradient(135deg, #495057 0%, #343A40 100%);
    color: white;
    padding: 16px 0;
}

header.prof-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

header.prof-header nav a {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: var(--raio-pill);
    background: rgba(255,255,255,0.15);
    font-weight: 600;
    font-size: 0.9rem;
}

header.prof-header nav a:hover {
    background: rgba(255,255,255,0.3);
}

/* =====================================================
   CARDS
   ===================================================== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.card-grid-4 {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.card {
    background: var(--cor-card);
    border-radius: var(--raio);
    box-shadow: var(--sombra);
    padding: 24px;
    text-align: center;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    cursor: pointer;
    border: 3px solid transparent;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--sombra-forte);
    border-color: var(--cor-primaria);
}

.card-selecionado {
    border-color: var(--cor-sucesso) !important;
    background: #F0FFF4;
}

.card-icone {
    font-size: 3.5rem;
    margin-bottom: 12px;
    display: block;
}

.card-titulo {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--cor-texto);
    margin-bottom: 4px;
}

.card-sub {
    font-size: 0.95rem;
    color: var(--cor-texto-claro);
}

.card-pontos {
    font-size: 2rem;
    font-weight: 900;
    color: var(--cor-primaria);
    margin: 12px 0;
}

.card-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--raio-pill);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-top: 8px;
}

/* Card Aluno */
.card-aluno {
    position: relative;
    overflow: hidden;
}

.card-aluno .avatar {
    font-size: 4rem;
    line-height: 1;
    margin-bottom: 8px;
}

.card-aluno .nome {
    font-size: 1.2rem;
    font-weight: 800;
}

.card-aluno .nivel {
    font-size: 0.85rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--raio-pill);
    display: inline-block;
    margin-top: 6px;
}

.card-aluno .pontos-display {
    margin-top: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    font-size: 1.5rem;
    font-weight: 900;
}

.card-aluno .pontos-display .icone-moeda {
    font-size: 2rem;
}

/* =====================================================
   BOTÕES
   ===================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: var(--raio-pill);
    font-size: 1.1rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
}

.btn-primario {
    background: linear-gradient(135deg, var(--cor-primaria), #FF8787);
    color: white;
    box-shadow: 0 4px 12px rgba(255,107,107,0.3);
}

.btn-primario:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255,107,107,0.4);
}

.btn-secundario {
    background: white;
    color: var(--cor-texto);
    border: 2px solid #DEE2E6;
}

.btn-secundario:hover {
    border-color: var(--cor-primaria);
    color: var(--cor-primaria);
}

.btn-sucesso {
    background: linear-gradient(135deg, var(--cor-sucesso), #8CE99A);
    color: white;
    box-shadow: 0 4px 12px rgba(81,207,102,0.3);
}

.btn-sucesso:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(81,207,102,0.4);
}

.btn-perigo {
    background: #FA5252;
    color: white;
}

.btn-pequeno {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.grupo-botoes {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 20px;
}

/* =====================================================
   FORMULÁRIOS
   ===================================================== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--cor-texto);
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 14px 18px;
    font-size: 1.05rem;
    border: 2px solid #DEE2E6;
    border-radius: var(--raio);
    background: white;
    transition: border-color 0.15s;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--cor-secundaria);
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 44px;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

/* =====================================================
   ALERTAS
   ===================================================== */
.alert {
    padding: 16px 20px;
    border-radius: var(--raio);
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-sucesso {
    background: #EBFBEE;
    color: #2B8A3E;
    border-left: 5px solid var(--cor-sucesso);
}

.alert-erro {
    background: #FFF5F5;
    color: #C92A2A;
    border-left: 5px solid #FA5252;
}

.alert-info {
    background: #E7F5FF;
    color: #1864AB;
    border-left: 5px solid var(--cor-secundaria);
}

/* =====================================================
   TABELAS
   ===================================================== */
.tabela-container {
    overflow-x: auto;
    background: white;
    border-radius: var(--raio);
    box-shadow: var(--sombra);
}

table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

table.data-table thead th {
    background: #F1F3F5;
    padding: 14px 16px;
    text-align: left;
    font-weight: 700;
    color: #495057;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

table.data-table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid #F1F3F5;
    vertical-align: middle;
}

table.data-table tbody tr:hover {
    background: #F8F9FA;
}

table.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* =====================================================
   RANKING
   ===================================================== */
.podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 16px;
    margin: 32px 0;
    flex-wrap: wrap;
}

.podium-lugar {
    text-align: center;
    background: white;
    border-radius: var(--raio);
    box-shadow: var(--sombra);
    padding: 20px;
    min-width: 160px;
}

.podium-lugar.primeiro {
    order: 2;
    padding-top: 32px;
    border-top: 6px solid #FFD700;
}

.podium-lugar.segundo {
    order: 1;
    border-top: 6px solid #ADB5BD;
}

.podium-lugar.terceiro {
    order: 3;
    border-top: 6px solid #FA9E45;
}

.podium-medalha {
    font-size: 3rem;
    margin-bottom: 8px;
}

.podium-nome {
    font-weight: 800;
    font-size: 1.1rem;
}

.podium-pontos {
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--cor-primaria);
    margin-top: 4px;
}

/* Lista de ranking */
.ranking-lista {
    background: white;
    border-radius: var(--raio);
    box-shadow: var(--sombra);
    overflow: hidden;
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    border-bottom: 1px solid #F1F3F5;
}

.ranking-item:last-child {
    border-bottom: none;
}

.ranking-posicao {
    font-size: 1.4rem;
    font-weight: 900;
    width: 40px;
    text-align: center;
    color: var(--cor-texto-claro);
}

.ranking-posicao.top3 {
    font-size: 1.8rem;
}

.ranking-avatar {
    font-size: 2.5rem;
}

.ranking-info {
    flex: 1;
}

.ranking-info .nome {
    font-weight: 700;
    font-size: 1.05rem;
}

.ranking-info .nivel {
    font-size: 0.8rem;
    color: var(--cor-texto-claro);
    font-weight: 600;
}

.ranking-pontos {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--cor-primaria);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* =====================================================
   ÁREA DE PONTUAÇÃO VISUAL
   ===================================================== */
.painel-pontuar {
    background: white;
    border-radius: var(--raio);
    box-shadow: var(--sombra);
    padding: 24px;
}

.aluno-selecionado {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #F8F9FA;
    padding: 20px;
    border-radius: var(--raio);
    margin-bottom: 24px;
}

.aluno-selecionado .avatar {
    font-size: 4rem;
}

.aluno-selecionado .info h3 {
    margin-bottom: 4px;
}

.aluno-selecionado .pontos-atuais {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--cor-primaria);
}

/* Botões de pontos rápidos */
.botoes-pontos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
    margin: 16px 0;
}

.btn-ponto-rapido {
    padding: 16px 8px;
    border-radius: var(--raio);
    border: 3px solid #DEE2E6;
    background: white;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s;
}

.btn-ponto-rapido:hover {
    border-color: var(--cor-sucesso);
    background: #EBFBEE;
}

.btn-ponto-rapido.selecionado {
    border-color: var(--cor-sucesso);
    background: #D3F9D8;
}

.btn-ponto-rapido .icone {
    font-size: 2rem;
    display: block;
    margin-bottom: 4px;
}

.btn-ponto-rapido .valor {
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--cor-sucesso);
}

/* =====================================================
   LOGIN PROFESSOR
   ===================================================== */
.login-box {
    max-width: 420px;
    margin: 60px auto;
    background: white;
    border-radius: var(--raio);
    box-shadow: var(--sombra-forte);
    padding: 40px 32px;
    text-align: center;
}

.login-box .logo {
    font-size: 4rem;
    margin-bottom: 12px;
}

.login-box h2 {
    margin-bottom: 24px;
    color: var(--cor-texto);
}

/* =====================================================
   RESPONSIVIDADE
   ===================================================== */
@media (max-width: 768px) {
    html { font-size: 15px; }
    h1 { font-size: 1.6rem; }
    h2 { font-size: 1.3rem; }
    
    header.site-header h1 {
        font-size: 1.8rem;
    }
    
    .card-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }
    
    .card {
        padding: 16px;
    }
    
    .card-icone {
        font-size: 2.5rem;
    }
    
    .podium {
        flex-direction: column;
        align-items: center;
    }
    
    .podium-lugar {
        width: 100%;
        max-width: 280px;
    }
    
    .podium-lugar.primeiro {
        order: 1;
    }
    
    header.prof-header .container {
        flex-direction: column;
        text-align: center;
    }
    
    header.prof-header nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }
    
    .grupo-botoes {
        justify-content: center;
    }
    
    .btn {
        width: 100%;
    }
    
    .ranking-item {
        padding: 12px 14px;
        gap: 10px;
    }
    
    .ranking-avatar {
        font-size: 2rem;
    }
    
    .login-box {
        margin: 20px auto;
        padding: 24px 20px;
    }
}

@media (max-width: 480px) {
    .container-escolha {
        padding: 12px;
    }
    
    .card-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .botoes-pontos {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* =====================================================
   UTILITÁRIOS
   ===================================================== */
.texto-centro { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--raio-pill);
    font-size: 0.75rem;
    font-weight: 700;
}

.tag-verde { background: #D3F9D8; color: #2B8A3E; }
.tag-azul { background: #D0EBFF; color: #1864AB; }
.tag-amarela { background: #FFF9DB; color: #F59F00; }
.tag-vermelha { background: #FFE3E3; color: #C92A2A; }

/* Barra de progresso */
.barra-progresso {
    width: 100%;
    height: 12px;
    background: #E9ECEF;
    border-radius: var(--raio-pill);
    overflow: hidden;
    margin-top: 8px;
}

.barra-progresso-fill {
    height: 100%;
    border-radius: var(--raio-pill);
    background: linear-gradient(90deg, var(--cor-sucesso), #8CE99A);
}

/* Badge flutuante */
.badge-flutuante {
    position: absolute;
    top: -10px;
    right: -10px;
    background: var(--cor-primaria);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 0.85rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
