/* ============================================================= */
/* GERAL E RESET */
/* ============================================================= */
:root {
    --cor-primaria: #0f1f3a;
    --cor-secundaria: #1e4d7a;
    --cor-destaque: #fbbf24;
    --cor-fundo: #f8fafc;
    --cor-texto: #1e293b;
    --cor-sucesso: #28a745;
    --cor-erro: #dc3545;
    --cor-info: #3498db;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.7;
    background-color: var(--cor-fundo);
    color: var(--cor-texto);
    padding-bottom: 80px;
}

/* ======================================= */
/* ESTILOS PARA A TELA DE LOGIN */
/* ======================================= */
#login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    width: 100%;
    background: linear-gradient(135deg, var(--cor-primaria) 0%, var(--cor-secundaria) 100%);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 2000;
}

.login-box {
    background: #ffffff;
    padding: 2.5rem 2rem;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    text-align: center;
    max-width: 450px;
    width: 90%;
}

.login-box h1 {
    font-size: 1.8rem;
    color: var(--cor-primaria);
    margin-bottom: 0.5rem;
}

.login-box p {
    color: #6c757d;
    margin-bottom: 2rem;
}

#login-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 12px 24px;
    border: 1px solid #dadce0;
    border-radius: 5px;
    background-color: #fff;
    color: #3c4043;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

#login-btn:hover {
    border-color: var(--cor-primaria);
    background-color: var(--cor-fundo);
    box-shadow: 0 4px 8px rgba(217, 83, 79, 0.2);
}

#acesso-rapido-btn:hover {
    background-color: #e0e0e0;
    border-color: #999;
}

.google-icon {
    width: 20px;
    height: 20px;
}

/* ======================================= */
/* HEADER DO CURSO */
/* ======================================= */
header {
    background: linear-gradient(135deg, var(--cor-primaria) 0%, var(--cor-secundaria) 100%);
    color: white;
    padding: 1.5rem;
    text-align: center;
    border-bottom: 4px solid var(--cor-destaque);
    box-shadow: 0 2px 20px rgba(0,0,0,.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.header-content {
    flex: 1;
}

header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

#header-subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
}

#user-info {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-left: 20px;
    padding-left: 20px;
    border-left: 2px solid rgba(255, 255, 255, 0.3);
}

#user-info span {
    color: white;
    font-size: 0.95rem;
    font-weight: 500;
}

#logout-btn {
    padding: 8px 16px;
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

#logout-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.8);
}

/* ======================================= */
/* CONTEÚDO EXPANDIDO E FERRAMENTAS */
/* ======================================= */
.ferramenta-box {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-left: 5px solid #003366;
    padding: 20px;
    margin: 20px 0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.ferramenta-box h4 {
    color: #003366;
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.calculadora-container, .conversor-container {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: flex-end;
    padding: 15px;
    background: white;
    border-radius: 4px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.input-group label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #333;
}

.input-group input, 
.calculadora-container select, 
.conversor-container select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.calculadora-container button, 
.conversor-container button {
    background: linear-gradient(135deg, var(--cor-secundaria), var(--cor-primaria));
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    height: 40px;
}

.calculadora-container button:hover, 
.conversor-container button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(30,77,122,.3);
}

.resultado-container {
    background: white;
    padding: 20px;
    border-radius: 4px;
    margin-top: 15px;
    border-left: 4px solid #28a745;
}

.resultado-item {
    padding: 12px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.resultado-item strong {
    color: #333;
}

.resultado-item span {
    color: #003366;
    font-weight: 700;
    font-size: 1.1rem;
}

.cenarios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.cenario-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 2px solid #ffc107;
    text-align: center;
    transition: all 0.3s;
}

.cenario-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(255,193,7,0.2);
}

.cenario-card h5 {
    color: #003366;
    margin-top: 0;
}

.cenario-card p {
    font-size: 0.9rem;
    margin: 10px 0;
}

.cenario-card button {
    background: #ffc107;
    color: #333;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    margin-top: 10px;
    transition: all 0.3s;
}

.cenario-card button:hover {
    background: #ffb300;
}

.casos-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 10px 15px;
    border: 2px solid #003366;
    background: white;
    color: #003366;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.tab-btn.active, 
.tab-btn:hover {
    background: #003366;
    color: white;
}

.caso-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #005a9c;
}

.caso-content h5 {
    color: #003366;
    font-size: 1.2rem;
    margin-top: 0;
}

.caso-content ul {
    margin: 10px 0;
    padding-left: 20px;
}

.caso-content li {
    margin: 8px 0;
    line-height: 1.6;
}

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

.exercicio-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #ffc107;
    transition: all 0.3s;
}

.exercicio-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.exercicio-card h5 {
    color: #003366;
    margin-top: 0;
}

.exercicio-card p {
    line-height: 1.6;
    margin: 8px 0;
}

.exercicio-card button {
    background: #003366;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    margin-top: 15px;
    transition: all 0.3s;
}

.exercicio-card button:hover {
    background: #005a9c;
}

.tabela-benchmark {
    overflow-x: auto;
    margin: 15px 0;
}

.tabela-benchmark table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.tabela-benchmark th {
    background: #003366;
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

.tabela-benchmark td {
    padding: 12px;
    border-bottom: 1px solid #ddd;
}

.tabela-benchmark tr:hover {
    background: #f5f5f5;
}

canvas {
    margin-top: 20px;
    max-width: 100%;
}

@media (max-width: 768px) {
    .calculadora-container,
    .conversor-container {
        flex-direction: column;
    }
    
    .cenarios-grid {
        grid-template-columns: 1fr;
    }
    
    .casos-tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        width: 100%;
    }
    
    .exercicios-container {
        grid-template-columns: 1fr;
    }
}
.main-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
}

.module {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

.module.active {
    display: block;
}

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

.module h2 {
    color: var(--cor-primaria);
    margin: 2rem 0 1.5rem 0;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--cor-destaque);
    font-size: 1.8rem;
}

.module h3 {
    color: var(--cor-secundaria);
    margin: 1.5rem 0 0.8rem 0;
    font-size: 1.3rem;
}

.module p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

.module ul {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.module li {
    margin-bottom: 0.7rem;
}

/* ======================================= */
/* CAIXAS DE INFORMAÇÃO E EXEMPLOS */
/* ======================================= */
.info-box,
.example-box,
.formula-box,
.comparison-box,
.strategy-box,
.practice-card,
.component-card,
.roadmap-box {
    background-color: #f0f7ff;
    border-left: 4px solid var(--cor-primaria);
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 5px;
}

.example-box,
.comparison-box {
    background-color: #fef5e7;
    border-left-color: var(--cor-destaque);
}

.formula-box {
    background-color: #e8f4f8;
    border-left-color: var(--cor-info);
    font-family: 'Courier New', monospace;
}

.formula-box p {
    margin: 0.5rem 0;
}

.strategy-box {
    background-color: #e8f5e9;
    border-left-color: var(--cor-sucesso);
    margin-bottom: 1rem;
}

.info-box p {
    margin: 0.5rem 0;
    font-weight: 500;
}

.example-box h4,
.comparison-box h4 {
    color: var(--cor-destaque);
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
}

.example-box ul {
    margin-left: 1.5rem;
    margin-bottom: 0.5rem;
}

/* ======================================= */
/* GRIDS E COMPONENTES */
/* ======================================= */
.components-grid,
.best-practices-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.component-card,
.practice-card {
    background: linear-gradient(135deg, #fff5e6 0%, #fff9e6 100%);
    border: 1px solid var(--cor-destaque);
    border-radius: 8px;
    padding: 1.2rem;
    box-shadow: 0 2px 8px rgba(243, 156, 18, 0.1);
}

.component-card:hover,
.practice-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(243, 156, 18, 0.2);
}

.component-card h4,
.practice-card h4 {
    color: var(--cor-primaria);
    margin-bottom: 0.8rem;
    font-size: 1rem;
}

.component-card p,
.practice-card p {
    font-size: 0.95rem;
    color: #555;
    margin-bottom: 0.5rem;
}

/* ======================================= */
/* CALCULADORA */
/* ======================================= */
.calculator-box {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    padding: 2rem;
    border-radius: 8px;
    margin: 1.5rem 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--cor-primaria);
    font-weight: 600;
}

.input-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #bbb;
    border-radius: 5px;
    font-size: 1rem;
    transition: all 0.3s;
}

.input-group input:focus {
    outline: none;
    border-color: var(--cor-primaria);
    box-shadow: 0 0 5px rgba(217, 83, 79, 0.3);
}

.btn-calcular {
    width: 100%;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--cor-secundaria), var(--cor-primaria));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(30,77,122,.3);
}

.btn-calcular:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(30,77,122,.4);
}

.btn-calcular:active {
    transform: translateY(0);
}

.resultado {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 5px;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.resultado p {
    margin: 0.3rem 0;
}

.resultado strong {
    color: var(--cor-primaria);
    font-size: 1.2rem;
}

/* ======================================= */
/* ROADMAP */
/* ======================================= */
.roadmap-box {
    border-left: 4px solid var(--cor-primaria);
}

.roadmap-item {
    background: white;
    padding: 1.2rem;
    margin-bottom: 1rem;
    border-radius: 5px;
    border-left: 4px solid var(--cor-destaque);
}

.roadmap-item:last-child {
    margin-bottom: 0;
}

.roadmap-item h4 {
    color: var(--cor-primaria);
    margin-bottom: 0.5rem;
}

.roadmap-item p {
    color: #666;
    font-size: 0.95rem;
}

/* ======================================= */
/* TABELAS */
/* ======================================= */
.data-table,
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.data-table th,
table th {
    background-color: #f0f0f0;
    color: var(--cor-texto);
    padding: 12px 10px;
    text-align: left;
    border: 1px solid #ddd;
    font-weight: 600;
}

.data-table td,
table td {
    padding: 10px;
    border: 1px solid #ddd;
}

.data-table tbody tr:nth-child(even),
table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

.data-table tbody tr:hover,
table tbody tr:hover {
    background-color: #f0f7ff;
}

/* ======================================= */
/* QUIZ */
/* ======================================= */
#quiz-container {
    margin-top: 1.5rem;
}

.quiz-question {
    background: white;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid var(--cor-info);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.quiz-question h4 {
    color: var(--cor-primaria);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.quiz-option {
    display: flex;
    align-items: center;
    padding: 0.8rem;
    margin-bottom: 0.8rem;
    background: var(--cor-fundo);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.quiz-option:hover {
    background-color: #e8f4f8;
}

.quiz-option input[type="radio"] {
    margin-right: 1rem;
    cursor: pointer;
}

.quiz-option label {
    cursor: pointer;
    flex: 1;
}

#quiz-submit-btn {
    width: 100%;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--cor-primaria) 0%, var(--cor-secundaria) 100%);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 1.5rem;
    box-shadow: 0 4px 12px rgba(217, 83, 79, 0.3);
}

#quiz-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(217, 83, 79, 0.4);
}

.quiz-result {
    margin-top: 2rem;
    padding: 2rem;
    background: #e8f5e9;
    border-left: 4px solid var(--cor-sucesso);
    border-radius: 8px;
}

.quiz-result.erro {
    background: #ffebee;
    border-left-color: var(--cor-erro);
}

.quiz-result h3 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

/* ======================================= */
/* NAVEGAÇÃO FLUTUANTE */
/* ======================================= */
.floating-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background: linear-gradient(135deg, var(--cor-primaria) 0%, var(--cor-secundaria) 100%);
    color: white;
    padding: 1rem;
    box-shadow: 0 -4px 20px rgba(0,0,0,.3);
    z-index: 1000;
}

#module-indicator {
    font-weight: 600;
    min-width: 80px;
    text-align: center;
}

.nav-btn {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.25);
    border-color: var(--cor-destaque);
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ======================================= */
/* RESPONSIVO */
/* ======================================= */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        text-align: center;
    }

    header h1 {
        font-size: 1.5rem;
    }

    #header-subtitle {
        font-size: 0.9rem;
    }

    .main-container {
        padding: 1rem;
    }

    .module h2 {
        font-size: 1.5rem;
    }

    .components-grid,
    .best-practices-container {
        grid-template-columns: 1fr;
    }

    .calculator-box {
        padding: 1.5rem;
    }

    .data-table,
    table {
        font-size: 0.9rem;
    }

    .data-table th,
    .data-table td,
    table th,
    table td {
        padding: 8px 5px;
    }

    .floating-nav {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .nav-btn {
        flex: 1;
        min-width: 100px;
        padding: 8px 12px;
        font-size: 0.9rem;
    }

    #module-indicator {
        width: 100%;
        order: 3;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.2rem;
    }

    #header-subtitle {
        font-size: 0.8rem;
    }

    .module h2 {
        font-size: 1.3rem;
    }

    .module h3 {
        font-size: 1.1rem;
    }

    .data-table,
    table {
        font-size: 0.8rem;
        overflow-x: auto;
    }

    .data-table th,
    .data-table td,
    table th,
    table td {
        padding: 6px 3px;
    }

    .calculator-box {
        padding: 1rem;
    }

    .login-box {
        padding: 1.5rem 1rem;
    }

    .login-box h1 {
        font-size: 1.5rem;
    }
}

/* Impressão */
@media print {
    .floating-nav,
    #user-info,
    .nav-btn {
        display: none !important;
    }

    body {
        background: white;
        padding: 0;
    }

    .main-container {
        padding: 1rem;
    }
}

/* ========== LOGIN OVERLAY ========== */
.login-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(135deg, #0f1f3a, #1e4d7a);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.login-card {
    background: white;
    padding: 40px;
    border-radius: 16px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.login-card h2 {
    color: #0f1f3a;
    margin: 0 0 12px 0;
    font-size: 1.5rem;
}
.login-card p {
    color: #555;
    margin-bottom: 24px;
    font-size: .95rem;
}
.login-card #google-login-btn {
    background: white;
    color: #333;
    border: 2px solid #ddd;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all .3s;
}
.login-card #google-login-btn:hover {
    border-color: #4285f4;
    box-shadow: 0 4px 12px rgba(66,133,244,.2);
}
.login-card #google-login-btn i {
    color: #4285f4;
    font-size: 1.2rem;
}
.login-error {
    color: #dc3545;
    margin-top: 12px;
    font-size: .85rem;
}
