/**
 * TrilhaDoDev Platform (Minimalist & Modern)
 * Developed by LG
 */

/* ==========================================================================
   1. FONTES E VARIÁVEIS
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;700;800;900&display=swap');

:root {
    --bg-color: #f9fafb;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --primary: #58cc02;
    /* Verde Duolingo */
    --primary-hover: #46a302;
    --secondary: #1cb0f6;
    /* Azul Duolingo */
    --white: #ffffff;
    --accent: #ff4b4b;
    --border-light: #e5e7eb;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   2. RESET E BASE
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Nunito', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
}

/* ==========================================================================
   3. LAYOUT GLOBAL (Header & Footer)
   ========================================================================== */

/* Navbar */
.navbar {
    background: var(--white);
    padding: 1rem 5%;
    border-bottom: 2px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    text-decoration: none;
    color: var(--text-dark);
}

.logo span {
    color: var(--primary);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-light);
    font-weight: 700;
    transition: color 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--secondary);
}

/* Footer */
.main-footer {
    background: var(--white);
    padding: 80px 10% 20px;
    border-top: 2px solid var(--border-light);
    margin-top: 50px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 50px;
    margin-bottom: 50px;
}

.footer-links h4 {
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    text-decoration: none;
    color: var(--text-light);
    transition: 0.3s;
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
    color: var(--text-light);
}

/* ==========================================================================
   4. COMPONENTES DA HOME (Hero & Buttons)
   ========================================================================== */
.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 100px 10%;
    min-height: 80vh;
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.hero-content h1 span {
    color: var(--secondary);
}

.hero-content p {
    font-size: 1.25rem;
    color: var(--text-light);
    max-width: 500px;
    margin-bottom: 2.5rem;
}

.hero-image img {
    width: 450px;
    animation: float 4s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

/* Botões 3D Style */
.btn-main,
.btn-primary {
    display: inline-block;
    background: var(--primary);
    color: var(--white);
    padding: 0.8rem 2rem;
    border-radius: 16px;
    text-decoration: none;
    font-weight: 800;
    text-transform: uppercase;
    box-shadow: 0 4px 0 var(--primary-hover);
    transition: all 0.1s;
    cursor: pointer;
    border: none;
}

.btn-main:active,
.btn-primary:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 var(--primary-hover);
}

/* ==========================================================================
   5. COMPONENTES DA TRILHA (Snake Path & Nodes)
   ========================================================================== */
.trail-wrapper {
    padding: 40px 0;
}

.trail-section {
    margin-bottom: 100px;
}

/* Banners de Categoria */
.section-banner {
    max-width: 600px;
    margin: 0 auto 40px auto;
    padding: 30px;
    border-radius: 20px;
    color: white;
    text-align: center;
    box-shadow: var(--shadow);
}

.section-banner.logic {
    background: linear-gradient(135deg, #ff9d00, #ffb900);
}

.section-banner.front {
    background: linear-gradient(135deg, #1cb0f6, #00cdff);
}

.section-banner.back {
    background: linear-gradient(135deg, #58cc02, #23ad5c);
}

.section-banner.data {
    background: linear-gradient(135deg, #490581, #210263);
}

.section-banner.tools {
    background: linear-gradient(135deg, #f05032, #ff8a65);
}

.section-banner.mobile {
    background: linear-gradient(135deg, #a367ff, #7a22ff);
}

.section-banner.soft {
    background: linear-gradient(135deg, #ff4b81, #ff79b0);
}

.section-banner.devops {
    background: linear-gradient(135deg, #2c3e50, #4ca1af);
}

.section-banner.ai {
    background: linear-gradient(135deg, #00f2fe, #4facfe);
}

.section-banner.locked {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    filter: grayscale(1);
    opacity: 0.8;
}

.section-banner h2 {
    font-weight: 900;
    margin-bottom: 5px;
}

.section-banner p {
    opacity: 0.9;
    font-weight: 600;
}

/* Engine do Caminho Sinuoso */
.snake-container {
    max-width: 500px;
    margin: 60px auto;
    position: relative;
    padding: 20px;
}

.snake-container::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 50%;
    width: 100px;
    height: calc(100% + 40px);
    border-left: 4px dashed #ddd;
    border-radius: 50px;
    transform: translateX(-50%);
    z-index: 0;
}

.node-item {
    display: flex;
    flex-direction: column;
    margin-bottom: 80px;
    position: relative;
    z-index: 1;
}

.node-item:nth-child(odd) {
    align-items: flex-start;
    padding-left: 15%;
}

.node-item:nth-child(even) {
    align-items: flex-end;
    padding-right: 15%;
}

.node-btn {
    width: 90px;
    height: 85px;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--text-light);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05), inset 0 -5px 0 rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-decoration: none;
}

.node-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 15px 30px rgba(88, 204, 2, 0.3), inset 0 -5px 0 var(--primary-hover);
}

.node-btn.current {
    background: var(--secondary);
    color: white;
    box-shadow: 0 15px 30px rgba(28, 176, 246, 0.3), inset 0 -5px 0 #1899d6;
}

.node-btn.locked {
    background: #e5e5e5;
    cursor: not-allowed;
}

.node-btn.trophy {
    background: var(--accent) !important;
    box-shadow: 0 8px 0 #d33131 !important;
    color: white !important;
}

.node-btn:hover:not(.locked) {
    transform: scale(1.1) rotate(5deg);
}

.node-label {
    margin-top: 15px;
    background: white;
    padding: 5px 15px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    font-weight: 800;
    font-size: 0.85rem;
    color: var(--text-dark);
    text-transform: uppercase;
}

.node-badge {
    background: var(--accent);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 900;
    margin-bottom: 8px;
}

/* ==========================================================================
   6. LAYOUT DE AULA E CONTEÚDO
   ========================================================================== */
.content-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
}

.lesson-hero {
    text-align: center;
    margin-bottom: 60px;
}

.lesson-header .badge {
    background: var(--secondary);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: 800;
    font-size: 0.8rem;
}

.lesson-header h1 {
    font-size: 2.5rem;
    margin: 15px 0;
    font-weight: 900;
}

/* Learning Cards */
.learning-card {
    background: var(--white);
    border-radius: 24px;
    padding: 40px;
    margin-bottom: 30px;
    border: 2px solid var(--border-light);
    box-shadow: var(--shadow);
}

.card-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 40px;
    align-items: center;
}

.card-grid.reverse {
    direction: rtl;
}

.card-grid.reverse .card-text {
    direction: ltr;
}

.card-image img {
    width: 100%;
    max-width: 250px;
    display: block;
    margin: 0 auto;
}

.feature-list {
    list-style: none;
    margin-top: 20px;
}

.feature-list li {
    margin-bottom: 10px;
    font-weight: 700;
    color: var(--text-light);
}

.feature-list i {
    color: var(--primary);
    margin-right: 10px;
}

/* Blocos de Informação Específicos */
.card-header-icon {
    font-size: 3rem;
    color: #007bff;
    margin-bottom: 20px;
    text-align: center;
}

.info-box-blue {
    background: #e7f3ff;
    border-left: 5px solid #007bff;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.check-list li {
    list-style: none;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.check-list i {
    color: #2ecc71;
    margin-right: 10px;
}

/* ==========================================================================
   7. TERMINAIS E CÓDIGO
   ========================================================================== */
.modern-terminal {
    background: #2d3436;
    border-radius: 12px;
    overflow: hidden;
    margin: 20px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.terminal-header {
    background: #e5e7eb;
    padding: 10px;
    display: flex;
    gap: 8px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.red {
    background: #ff5f56;
}

.yellow {
    background: #ffbd2e;
}

.green {
    background: #27c93f;
}

.terminal-body {
    padding: 20px;
    color: #fab1a0;
    font-family: 'Courier New', Courier, monospace;
}

.folder-structure {
    background: #2d3436;
    color: #dfe6e9;
    padding: 25px;
    border-radius: 10px;
    font-family: 'Courier New', Courier, monospace;
    line-height: 2;
}

.prompt {
    color: var(--primary);
}

.code-block {
    background: #f1f2f6;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid var(--secondary);
    margin: 15px 0;
}

/* ==========================================================================
   8. QUIZ SYSTEM
   ========================================================================== */
.quiz-container {
    text-align: center;
    padding: 20px;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 25px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.btn-quiz-option {
    display: flex;
    align-items: center;
    background-color: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 15px 20px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-align: left;
    color: #333;
    font-family: inherit;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.btn-quiz-option span {
    background-color: #3498db;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-weight: bold;
    flex-shrink: 0;
    transition: background-color 0.3s;
}

.btn-quiz-option:hover {
    border-color: #3498db;
    background-color: #ecf6fd;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(52, 152, 219, 0.15);
}

.btn-quiz-option:hover span {
    background-color: #2980b9;
}

#quiz-feedback {
    font-size: 1.1rem;
    margin-top: 20px;
    padding: 10px;
    border-radius: 8px;
    transition: all 0.4s ease;
}

.quiz-feedback-box {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    font-weight: bold;
    text-align: center;
    min-height: 50px;
    display: none;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

/* ==========================================================================
   9. NAVEGAÇÃO DE AULA E CONTROLES
   ========================================================================== */
.lesson-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 50px;
    padding-top: 30px;
    border-top: 2px solid var(--border-light);
}

.carousel-controls {
    position: sticky;
    bottom: 20px;
    z-index: 10;
}

.btn-secondary {
    background: #f1f2f6;
    color: var(--text-dark);
    padding: 0.8rem 1.5rem;
    border-radius: 16px;
    text-decoration: none;
    font-weight: 800;
}

.btn-finish {
    background-color: #28a745 !important;
    border-color: #28a745 !important;
}

/* ==========================================================================
   10. ANIMAÇÕES E ESTADOS DE VISIBILIDADE
   ========================================================================== */
.step-card {
    display: none;
    /* Esconde por padrão */
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.step-card.active {
    display: block;
    /* Mostra apenas o ativo */
    opacity: 1;
    transform: translateY(0);
}

.animate-fade-in {
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   11. RESPONSIVIDADE
   ========================================================================== */
@media (max-width: 600px) {
    .btn-quiz-option {
        font-size: 1rem;
        padding: 12px 15px;
    }
}

/* ==========================================================================
   12. FLASHCARD
   ========================================================================== */
/* Layout Específico de Aula */
.lesson-page {
    background-color: var(--white);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header de Progresso */
.lesson-nav {
    padding: 20px 5%;
    background: var(--white);
}

.nav-content {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 20px;
}

.btn-close {
    font-size: 1.5rem;
    color: var(--text-light);
    text-decoration: none;
    transition: 0.2s;
}

.progress-container {
    flex-grow: 1;
    height: 16px;
    background: #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    width: 0%;
    height: 100%;
    background: var(--primary);
    border-radius: 10px;
    transition: width 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    /* Brilho na barra */
    box-shadow: inset 0 4px 2px rgba(255, 255, 255, 0.2);
}

/* Layout do Conteúdo */
.lesson-layout {
    max-width: 800px;
    margin: 40px auto 120px;
    /* Espaço para o footer fixo */
    padding: 0 20px;
    width: 100%;
}

.lesson-info {
    text-align: left;
    margin-bottom: 30px;
}

.lesson-info h1 {
    font-size: 2rem;
    font-weight: 800;
}

/* Footer Fixo Estilo App */
.lesson-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 25px 5%;
    background: var(--white);
    border-top: 2px solid var(--border-light);
    z-index: 100;
}

.footer-content {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Botão Continuar Duolingo Style */
.btn-next {
    background: var(--primary);
    color: white;
    padding: 15px 45px;
    border-radius: 15px;
    font-weight: 800;
    letter-spacing: 1px;
    border: none;
    cursor: pointer;
    box-shadow: 0 5px 0 var(--primary-hover);
    transition: all 0.1s;
}

.btn-next:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 var(--primary-hover);
}

.btn-back {
    background: transparent;
    color: var(--text-light);
    font-weight: 800;
    border: 2px solid var(--border-light);
    padding: 13px 25px;
    border-radius: 15px;
    cursor: pointer;
    transition: 0.2s;
}

.btn-back:hover {
    background: #f1f2f6;
}

/* Ajuste no Loading */
#loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.2rem;
    gap: 15px;
    margin-top: 100px;
}

#loading-spinner i {
    font-size: 3rem;
}



/* ==========================================================================
   13. ICONES DO FLASHCARD
   ========================================================================== */
/* Layout Específico de Aula */
/* Container do Cabeçalho da Lição */
.lesson-info {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 40px;
    padding: 0 10px;
}

/* O "Badge" do ícone da tecnologia */
.tech-badge {
    width: 64px;
    height: 64px;
    background: var(--white);
    border: 2px solid var(--border-light);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: 0 4px 0 var(--border-light);
    /* Efeito 3D sutil */
    flex-shrink: 0;
}

/* Estilização do grupo de texto */
.text-group h1 {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--text-dark);
    line-height: 1.1;
}

.text-group p {
    color: var(--text-light);
    font-weight: 700;
    font-size: 1rem;
    margin-top: 4px;
}

/* Cores dinâmicas para os ícones (Opcional) */
/* .fa-js { color: #f7df1e; }
.fa-html5 { color: #e34f26; }
.fa-css3-alt { color: #1572b6; }
.fa-python { color: #3776ab; }
.fa-react { color: #61dafb; } */

#lesson-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background-color: #f3f4f6;
    /* Cinza bem claro e limpo */
    color: var(--text-light);
    /* Seu cinza de texto definido no :root */
    border-radius: 20px;
    /* Formato de pílula */
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 2px solid var(--border-light);
    transition: all 0.3s ease;
    white-space: nowrap;
}

/* Ícone dentro do badge */
#lesson-badge i {
    color: var(--secondary);
    /* Azul para dar um destaque minimalista */
    font-size: 0.9rem;
}

/* Efeito ao passar o mouse (opcional para feedback visual) */
#lesson-badge:hover {
    background-color: var(--white);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}


/* ==========================================================================
   14. FEEDBACK
   ========================================================================== */
/* Layout Específico de Aula */
/* Container do Cabeçalho da Lição */

/* Container de Feedback Moderno */
.quiz-feedback-box {
    margin-top: 30px;
    border-radius: 20px;
    overflow: hidden;
    display: none;
}

.feedback-content {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    text-align: left;
    border-radius: 20px;
    border-bottom: 4px solid rgba(0, 0, 0, 0.1);
}

/* Estado Correto */
.feedback-content.is-correct {
    background-color: #d7ffb8;
    color: #46a302;
    border: 2px solid #58cc02;
}

/* Estado Errado */
.feedback-content.is-wrong {
    background-color: #ffdfe0;
    color: #ee2c2c;
    border: 2px solid #ff4b4b;
}

.feedback-icon {
    font-size: 2.5rem;
}

.feedback-text strong {
    display: block;
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.feedback-text p {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
    margin: 0;
}

/* Estilos dos Botões do Quiz durante a resposta */
.btn-quiz-option.correct {
    background-color: #d7ffb8 !important;
    border-color: #58cc02 !important;
    color: #46a302 !important;
    box-shadow: 0 4px 0 #46a302 !important;
}

.btn-quiz-option.wrong {
    background-color: #ffdfe0 !important;
    border-color: #ff4b4b !important;
    color: #ee2c2c !important;
    box-shadow: 0 4px 0 #ee2c2c !important;
}

/* Animação de Surgimento */
.animate-pop {
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* 15. Filtro Trilhas */

.filter-container {
    position: sticky;
    top: 70px; /* Altura da sua navbar */
    background: white;
    z-index: 100;
    padding: 15px 0;
    border-bottom: 2px solid #e5e5e5;
    margin-bottom: 20px;
}

.filter-scroll {
    display: flex;
    justify-content: center;
    gap: 12px;
    overflow-x: auto;
    padding: 0 20px;
}

.filter-btn {
    background: white;
    border: 2px solid #e5e5e5;
    border-bottom: 4px solid #e5e5e5; /* Efeito 3D Duolingo */
    border-radius: 12px;
    padding: 8px 16px;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    color: #afafaf;
    cursor: pointer;
    transition: all 0.1s;
    white-space: nowrap;
    text-transform: uppercase;
    font-size: 0.8rem;
}

.filter-btn:hover {
    background: #f7f7f7;
}

.filter-btn.active {
    color: #127894;
    border-color: #127894;
    border-bottom: 4px solid #127894;
    background: #e1f5fe;
    transform: translateY(2px); /* Botão "pressionado" */
}

/* Ocultar seções que não batem com o filtro */
.trail-section.hidden {
    display: none;
}