/* ===================================
   PREPARATÓRIO CEA - LARA
   Design Motivacional e Acolhedor
   =================================== */

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

:root {
    /* Cores principais - tons suaves e motivacionais */
    --primary: #8B5CF6;
    --primary-dark: #7C3AED;
    --secondary: #EC4899;
    --accent: #F59E0B;
    --success: #10B981;
    --info: #3B82F6;
    
    /* Tons neutros */
    --bg-main: #FAF8FF;
    --bg-card: #FFFFFF;
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --border: #E5E7EB;
    
    /* Gradientes */
    --gradient-primary: linear-gradient(135deg, #8B5CF6 0%, #EC4899 100%);
    --gradient-card: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-success: linear-gradient(135deg, #10B981 0%, #059669 100%);
    
    /* Sombras */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
    
    /* Animações */
    --transition: all 0.3s ease;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
}

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

/* ===================================
   HEADER
   =================================== */

.header {
    background: var(--gradient-primary);
    color: white;
    padding: 20px 0;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 700;
}

.logo i {
    font-size: 32px;
}

.motivational-message {
    flex: 1;
    text-align: right;
    font-family: 'Quicksand', sans-serif;
    font-weight: 500;
    font-size: 18px;
    animation: fadeInMotivation 2s ease-in-out infinite;
}

@keyframes fadeInMotivation {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

/* ===================================
   PROGRESS CONTAINER
   =================================== */

.progress-container {
    background: white;
    padding: 25px 0;
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--text-primary);
}

.progress-bar {
    height: 12px;
    background: #E5E7EB;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 10px;
    transition: width 0.5s ease;
    width: 0%;
}

.stats {
    display: flex;
    justify-content: space-around;
    gap: 20px;
    flex-wrap: wrap;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.stat i {
    font-size: 24px;
    color: var(--primary);
}

.stat span {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat small {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

/* ===================================
   MAIN NAVIGATION
   =================================== */

.main-nav {
    background: white;
    padding: 15px 0;
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
    position: sticky;
    top: 80px;
    z-index: 99;
}

.main-nav .container {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: 2px solid var(--border);
    background: white;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 500;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.nav-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

.nav-btn.active {
    background: var(--gradient-primary);
    color: white;
    border-color: var(--primary);
}

/* ===================================
   MAIN CONTENT
   =================================== */

.main-content {
    min-height: calc(100vh - 400px);
    padding-bottom: 50px;
}

.content-section {
    display: none;
    animation: fadeIn 0.5s ease;
}

.content-section.active {
    display: block;
}

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

.section-title {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 10px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 40px;
    font-family: 'Quicksand', sans-serif;
}

/* ===================================
   MODULES GRID
   =================================== */

.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
}

.module-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 25px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 2px solid transparent;
}

.module-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.module-header {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 15px;
}

.module-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    flex-shrink: 0;
}

.module-info {
    flex: 1;
}

.module-info h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--text-primary);
}

.module-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    background: #F3F4F6;
    color: var(--text-secondary);
}

.module-status.completed {
    background: #D1FAE5;
    color: #065F46;
}

.module-status.in-progress {
    background: #FEF3C7;
    color: #92400E;
}

.module-card p {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 14px;
}

/* ===================================
   BUTTONS
   =================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-secondary:hover {
    background: var(--primary);
    color: white;
}

.btn-success {
    background: var(--gradient-success);
    color: white;
}

.btn-block {
    width: 100%;
}

/* ===================================
   SIMULATOR SECTION
   =================================== */

.simulator-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.sim-card {
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    text-align: center;
    transition: var(--transition);
}

.sim-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.sim-card i {
    font-size: 48px;
    color: var(--primary);
    margin-bottom: 15px;
}

.sim-card h3 {
    font-size: 22px;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.sim-card p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* ===================================
   REWARDS GRID
   =================================== */

.rewards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.reward-card {
    background: white;
    border-radius: 16px;
    padding: 25px;
    box-shadow: var(--shadow-md);
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.reward-card.locked {
    opacity: 0.6;
    filter: grayscale(100%);
}

.reward-card.unlocked {
    border: 2px solid var(--success);
    animation: unlockPulse 1s ease;
}

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

.reward-icon {
    font-size: 64px;
    margin-bottom: 15px;
}

.reward-card h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.reward-card p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 15px;
}

.reward-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--gradient-success);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* ===================================
   MODAL
   =================================== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 900px;
    width: 100%;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

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

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #F3F4F6;
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--primary);
    color: white;
    transform: rotate(90deg);
}

/* ===================================
   MODULE CONTENT
   =================================== */

.module-content-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border);
}

.module-content-header h2 {
    font-size: 32px;
    margin-bottom: 10px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.module-content-header .motivation {
    font-family: 'Quicksand', sans-serif;
    color: var(--text-secondary);
    font-size: 16px;
    font-style: italic;
}

.topic {
    background: #F9FAFB;
    border-left: 4px solid var(--primary);
    padding: 25px;
    margin-bottom: 30px;
    border-radius: 8px;
}

.topic h3 {
    font-size: 22px;
    margin-bottom: 15px;
    color: var(--primary);
}

.topic h4 {
    font-size: 18px;
    margin: 20px 0 10px;
    color: var(--text-primary);
}

.topic p, .topic li {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 10px;
}

.topic ul {
    margin-left: 25px;
}

.highlight-box {
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
    border-left: 4px solid var(--accent);
}

.highlight-box strong {
    color: #92400E;
}

/* ===================================
   QUESTIONS
   =================================== */

.question-container {
    background: white;
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 25px;
    margin: 20px 0;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.question-number {
    background: var(--gradient-primary);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
}

.question-text {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 20px;
    color: var(--text-primary);
    line-height: 1.6;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option {
    padding: 15px 20px;
    border: 2px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
    background: white;
    text-align: left;
    font-size: 15px;
}

.option:hover {
    border-color: var(--primary);
    background: #FAF5FF;
}

.option.selected {
    border-color: var(--primary);
    background: #FAF5FF;
}

.option.correct {
    border-color: var(--success);
    background: #D1FAE5;
}

.option.incorrect {
    border-color: #EF4444;
    background: #FEE2E2;
}

.explanation {
    background: #F0F9FF;
    border-left: 4px solid var(--info);
    padding: 20px;
    margin-top: 20px;
    border-radius: 8px;
    display: none;
}

.explanation.show {
    display: block;
    animation: fadeIn 0.5s ease;
}

.explanation h4 {
    color: var(--info);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hp12c-solution {
    background: #1F2937;
    color: #10B981;
    padding: 15px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    margin-top: 15px;
    font-size: 14px;
    line-height: 1.8;
}

.hp12c-solution strong {
    color: #F59E0B;
}

/* ===================================
   DYNAMICS
   =================================== */

.dynamic-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 16px;
    margin: 30px 0;
    text-align: center;
}

.dynamic-card h3 {
    font-size: 24px;
    margin-bottom: 15px;
}

.dynamic-card p {
    font-size: 16px;
    margin-bottom: 20px;
    opacity: 0.9;
}

/* ===================================
   HP12C CALCULATOR
   =================================== */

.hp12c-calculator {
    background: #2D3748;
    border-radius: 20px;
    padding: 30px;
    max-width: 400px;
    margin: 0 auto;
    box-shadow: var(--shadow-lg);
}

.hp12c-display {
    background: #9CA38F;
    color: #000;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    font-family: 'Courier New', monospace;
    font-size: 24px;
    text-align: right;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    font-weight: bold;
}

.hp12c-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.hp12c-btn {
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    background: #4A5568;
    color: white;
}

.hp12c-btn:hover {
    background: #5A6678;
    transform: scale(1.05);
}

.hp12c-btn.operator {
    background: #F59E0B;
}

.hp12c-btn.function {
    background: #8B5CF6;
}

.hp12c-btn.special {
    background: #EC4899;
}

/* ===================================
   RESPONSIVE
   =================================== */

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .motivational-message {
        text-align: center;
    }
    
    .section-title {
        font-size: 28px;
    }
    
    .modules-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        padding: 25px;
    }
    
    .stats {
        gap: 15px;
    }
    
    .nav-btn {
        font-size: 14px;
        padding: 10px 16px;
    }
}

/* ===================================
   CONGRATULATIONS ANIMATION
   =================================== */

.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background: var(--primary);
    position: absolute;
    animation: confetti-fall 3s linear;
}

@keyframes confetti-fall {
    to {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

.celebration-modal {
    text-align: center;
}

.celebration-icon {
    font-size: 80px;
    margin-bottom: 20px;
    animation: bounce 1s infinite;
}

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

.reward-modal-content {
    text-align: center;
    max-width: 500px;
}

.reward-modal-content .reward-icon {
    font-size: 100px;
    margin: 20px 0;
}

.reward-details {
    background: var(--bg-main);
    padding: 25px;
    border-radius: 12px;
    margin: 20px 0;
}

.reward-details h3 {
    color: var(--primary);
    margin-bottom: 10px;
}

/* ===================================
   LOADING ANIMATION
   =================================== */

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
