/**
 * Desafios de Aprendizagem - Main Stylesheet
 * Desenvolvido por B20 Conteúdo Digital
 * https://www.b20.com.br
 */

/* ===== CSS VARIABLES ===== */
:root {
    /* Paleta Educacional/Gamificada */
    --primary-color: #7C3AED; /* Violeta Intenso */
    --secondary-color: #EC4899; /* Rosa Vibrante */
    --accent-color: #38BDF8; /* Sky Blue */
    --surface-color: #FFFFFF;
    --text-color: #0F172A; /* Slate 900 */
    
    /* Variações automáticas */
    --primary-hover: #6D28D9;
    --primary-light: #EDE9FE;
    --bg-color: #F8FAFC;
    --text-muted: #64748B;
    --text-secondary: #475569;
    
    /* Cores de feedback */
    --success-color: #10B981; /* Verde Esmeralda */
    --error-color: #EF4444;
    --warning-color: #F59E0B;
    
    /* Layout */
    --border-radius: 16px;
    --border-radius-small: 12px;
    --spacing-unit: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Shadows & Glassmorphism */
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: 1px solid rgba(255, 255, 255, 0.5);
    --glass-blur: blur(12px);
    
    /* Header & Navigation */
    --header-height: 70px;
    --bottom-nav-height: 70px;
}

/* Modo Escuro Forçado via JS */
body.dark-mode {
    --bg-color: #0F172A;
    --surface-color: #1E293B;
    --text-color: #F8FAFC;
    --text-muted: #94A3B8;
    --text-secondary: #CBD5E1;
    --primary-light: rgba(124, 58, 237, 0.15);
    --glass-bg: rgba(30, 41, 59, 0.75);
    --glass-border: 1px solid rgba(255, 255, 255, 0.05);
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.4);
}

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

html {
    font-size: clamp(14px, 2.5vw, 16px);
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-color);
    background-image: linear-gradient(135deg, #F8FAFC 0%, #E2E8F0 100%);
    background-attachment: fixed;
    color: var(--text-color);
    line-height: 1.6;
    padding-top: var(--header-height);
    padding-bottom: var(--bottom-nav-height);
    transition: background-color 0.3s ease, background-image 0.3s ease, color 0.3s ease;
}

body.dark-mode {
    background-image: linear-gradient(135deg, #0F172A 0%, #1E1B4B 100%);
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.5em;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

p {
    margin-bottom: 1em;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    text-decoration: underline;
}

/* ===== HEADER FIXO ===== */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--glass-bg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: var(--glass-border);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.header-logo i {
    font-size: 1.5rem;
}

.header-logo h1 {
    font-size: 1.25rem;
    margin: 0;
}

/* Desktop Navigation - Hidden on Mobile */
.desktop-nav {
    display: none;
}

.header-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--bg-color);
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1.1rem;
}

.btn-icon:hover {
    background: var(--primary-light);
    color: var(--primary-color);
    transform: scale(1.05);
}

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

/* ===== BOTTOM NAVIGATION ===== */
.bottom-nav {
    position: fixed;
    bottom: 24px; /* Floating space */
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 400px;
    height: 70px;
    background: var(--glass-bg);
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 16px 32px rgba(124, 58, 237, 0.15); /* Sombra colorida suave */
    z-index: 1000;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 35px; /* Pill shape */
    padding: 0 8px;
}

body.dark-mode .bottom-nav {
    background: rgba(15, 23, 42, 0.7);
    border-color: rgba(255, 255, 255, 0.05);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.4);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px 4px;
    flex: 1;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 600;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); /* Bouncy effect */
    border-radius: 20px;
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 0;
}

.nav-item i {
    font-size: 1.4rem;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1;
}

.nav-item span {
    z-index: 1;
    transition: transform 0.3s ease;
}

.nav-item.active {
    color: white;
}

.nav-item.active::before {
    opacity: 1;
}

.nav-item.active i {
    transform: translateY(-2px) scale(1.1);
    text-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.nav-item.active span {
    transform: translateY(1px);
}

@media (max-width: 380px) {
    .nav-item {
        padding: 8px 2px;
    }
    .nav-item i {
        font-size: 1.2rem;
    }
    .nav-item span {
        font-size: 0.65rem;
    }
}

.nav-item:hover {
    text-decoration: none;
}

/* ===== MAIN CONTENT ===== */
main {
    min-height: calc(100vh - var(--header-height) - var(--bottom-nav-height));
}

.container {
    padding: 16px;
    max-width: 100%;
    margin: 0 auto;
}

/* ===== SECTIONS ===== */
.section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.section.active {
    display: block;
}

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

.section-header {
    margin-bottom: 28px;
}

.section-header h2 {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 8px;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-color);
    letter-spacing: -0.5px;
}

.section-header h2 i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-radius: 12px;
    font-size: 1.15rem;
    box-shadow: 0 8px 16px rgba(111, 66, 193, 0.25);
    flex-shrink: 0;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.section-header:hover h2 i {
    transform: scale(1.08) rotate(-5deg);
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    min-height: 48px;
}

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

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

.btn-secondary {
    background: var(--surface-color);
    color: var(--text-color);
    border: 2px solid var(--text-muted);
}

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

.btn-danger {
    background: var(--error-color);
    color: white;
}

.btn-danger:hover {
    background: #a00d12;
    transform: translateY(-2px);
}

.btn-large {
    padding: 16px 32px;
    font-size: 1.1rem;
    width: 100%;
}

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

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--surface-color);
    border: none;
    border-radius: var(--border-radius-small);
    color: var(--text-color);
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-back:hover {
    background: var(--primary-light);
    color: var(--primary-color);
}

/* ===== CARDS ===== */
.welcome-card,
.daily-challenge-card,
.profile-card,
.settings-card,
.data-card,
.chart-card,
.activity-card {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

body.dark-mode .welcome-card,
body.dark-mode .daily-challenge-card,
body.dark-mode .profile-card,
body.dark-mode .settings-card,
body.dark-mode .data-card,
body.dark-mode .chart-card,
body.dark-mode .activity-card {
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.welcome-card:hover,
.daily-challenge-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.welcome-card {
    background-color: var(--primary-color);
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    color: #FFFFFF;
    border-radius: var(--border-radius);
    padding: 32px 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    border: none;
    position: relative;
    overflow: hidden;
}

body.dark-mode .welcome-card {
    background-color: #1E1B4B;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.welcome-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.user-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    font-size: 2.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.user-info h2 {
    margin: 0;
    font-size: 1.75rem;
    color: #FFFFFF;
    font-weight: 700;
}

.user-subtitle {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1rem;
    margin: 0;
}

/* User Stats Grid */
.user-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.welcome-card .stat-item {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.welcome-card .stat-label {
    color: rgba(255, 255, 255, 0.85);
}

.welcome-card .stat-value {
    color: #FFFFFF;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: var(--bg-color);
    border-radius: var(--border-radius-small);
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0; /* Impede o esmagamento em telas estreitas */
}

.level-icon {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: white;
}

.xp-icon {
    background: linear-gradient(135deg, #0A66C2, #084d92);
    color: white;
}

.streak-icon {
    background: linear-gradient(135deg, #FF6B35, #F7931E);
    color: white;
}

.stat-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
}

/* XP Progress Bar */
.xp-progress-container {
    margin-top: 16px;
}

.xp-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.85rem;
}

.xp-progress-label {
    color: var(--text-secondary);
    font-weight: 600;
}

.welcome-card .xp-progress-label {
    color: rgba(255, 255, 255, 0.9);
}

.xp-progress-text {
    color: var(--text-muted);
}

.welcome-card .xp-progress-text {
    color: rgba(255, 255, 255, 0.8);
}

.xp-progress-bar {
    height: 12px;
    background: var(--bg-color);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.welcome-card .xp-progress-bar {
    background: rgba(255, 255, 255, 0.2);
}

.xp-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #084d92);
    border-radius: 6px;
    transition: width 0.5s ease;
    position: relative;
}

.xp-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Daily Challenge Card */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.card-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.challenge-badge {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
}

.challenge-description {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* Categories Grid */
.categories-grid,
.categories-grid-full {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.category-card {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

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

.category-icon {
    font-size: 2.5rem;
    margin-bottom: 8px;
}

.category-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-color);
}

.category-count {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.link-see-all {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.95rem;
}

/* Quiz Container */
.quiz-container {
    max-width: 600px;
    margin: 0 auto;
}

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

.quiz-timer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--surface-color);
    border-radius: var(--border-radius-small);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary-color);
}

.quiz-progress-container {
    margin-bottom: 32px;
}

.quiz-progress-bar {
    height: 8px;
    background: var(--surface-color);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.quiz-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #084d92);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.quiz-progress-text {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Micro Lesson */
.micro-lesson {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    padding: 32px 24px;
    text-align: center;
    margin-bottom: 24px;
}

.micro-lesson-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: white;
}

.micro-lesson-title {
    margin-bottom: 16px;
    color: var(--text-color);
}

.micro-lesson-content {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 24px;
}

/* Quiz Question */
.quiz-question-container {
    margin-bottom: 24px;
}

.quiz-question {
    background: var(--surface-color);
    padding: 24px;
    border-radius: var(--border-radius);
    margin-bottom: 24px;
    font-size: 1.2rem;
    line-height: 1.6;
}

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

.quiz-option {
    background: var(--surface-color);
    border: 2px solid transparent;
    border-radius: var(--border-radius);
    padding: 16px 20px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
    text-align: left;
    min-height: 56px;
    display: flex;
    align-items: center;
}

.quiz-option:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
    transform: translateX(4px);
}

.quiz-option.selected {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.quiz-option.correct {
    border-color: var(--success-color);
    background: rgba(5, 118, 66, 0.1);
}

.quiz-option.incorrect {
    border-color: var(--error-color);
    background: rgba(204, 16, 22, 0.1);
}

.quiz-option:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

/* Quiz Feedback */
.quiz-feedback {
    text-align: center;
    padding: 32px 24px;
}

.feedback-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.feedback-icon.correct {
    background: rgba(5, 118, 66, 0.1);
    color: var(--success-color);
}

.feedback-icon.incorrect {
    background: rgba(204, 16, 22, 0.1);
    color: var(--error-color);
}

.feedback-title {
    margin-bottom: 16px;
}

.feedback-explanation {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 24px;
    padding: 16px;
    background: var(--surface-color);
    border-radius: var(--border-radius-small);
}

/* Results Container */
.results-container {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
    padding: 24px;
}

.results-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
    animation: bounceIn 0.6s ease;
}

@keyframes bounceIn {
    0% { transform: scale(0); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.results-title {
    margin-bottom: 32px;
}

.results-score {
    margin-bottom: 32px;
}

.score-circle {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto;
}

.score-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.score-value {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    display: block;
}

.score-total {
    font-size: 1.2rem;
    color: var(--text-muted);
}

.results-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.result-stat {
    background: var(--surface-color);
    padding: 20px;
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.result-stat i {
    font-size: 2rem;
    color: var(--primary-color);
}

.result-stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.result-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
}

.results-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.results-actions .btn {
    flex: 1;
    min-width: 140px;
}

/* New Achievements */
.new-achievements {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    padding: 24px;
    margin-bottom: 24px;
}

.new-achievements h3 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
    color: #FFD700;
}

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

/* Statistics */
.stats-overview-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
}

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

.stat-card-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    flex-shrink: 0; /* Impede o ícone de virar uma elipse */
}

.challenges-icon {
    background: linear-gradient(135deg, #0A66C2, #084d92);
}

.questions-icon {
    background: linear-gradient(135deg, #057642, #045a33);
}

.accuracy-icon {
    background: linear-gradient(135deg, #FFD700, #FFA500);
}

.stat-card-content {
    display: flex;
    flex-direction: column;
}

.stat-card-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-color);
}

.stat-card-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Chart Card */
@media (max-width: 480px) {
    .stats-grid {
        gap: 12px;
    }
    .stat-card {
        padding: 16px 12px;
        gap: 12px;
    }
    .stat-card-icon {
        width: 42px;
        height: 42px;
        font-size: 1.2rem;
    }
    .stat-card-value {
        font-size: 1.4rem;
    }
    .stat-card-label {
        font-size: 0.75rem;
    }
}

.chart-card {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    padding: 24px;
    margin-bottom: 24px;
}

.chart-card h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

#performance-chart {
    max-width: 100%;
    height: auto;
}

/* Activity List */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.activity-item {
    background: var(--bg-color);
    padding: 16px;
    border-radius: var(--border-radius-small);
    display: flex;
    align-items: center;
    gap: 12px;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.activity-time {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    margin-bottom: 8px;
}

.empty-state-hint {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Achievements */
.achievements-stats {
    margin-bottom: 24px;
}

.achievement-progress-card {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    padding: 24px;
}

.achievement-progress-card h3 {
    margin-bottom: 16px;
}

.achievement-progress-bar {
    height: 12px;
    background: var(--bg-color);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 12px;
}

.achievement-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #FFD700, #FFA500);
    border-radius: 6px;
    transition: width 0.5s ease;
}

.achievement-progress-text {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.achievement-card {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    padding: 20px;
    text-align: center;
    transition: var(--transition);
    border: 2px solid transparent;
}

.achievement-card.unlocked {
    border-color: #FFD700;
}

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

.achievement-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 12px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    background: var(--bg-color);
    color: var(--text-muted);
}

.achievement-card.unlocked .achievement-icon {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: white;
}

.achievement-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.achievement-description {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Profile */
.profile-avatar-section {
    text-align: center;
    margin-bottom: 32px;
}

.profile-avatar-large {
    width: 100px;
    height: 100px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 4rem;
}

.profile-level-badge {
    display: inline-block;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Form */
.profile-form {
    margin-top: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--surface-color);
    border-radius: var(--border-radius-small);
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 1rem;
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--surface-color);
}

/* Settings */
.settings-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--bg-color);
    border-radius: var(--border-radius-small);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-logo-svg {
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
    border-radius: 10px;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-color);
    margin: 0;
    line-height: 1.1;
    letter-spacing: -0.5px;
    display: flex;
    flex-direction: column;
}

.logo-subtext {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--primary-color);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.setting-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.setting-info i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.setting-label {
    display: block;
    font-weight: 600;
    margin-bottom: 2px;
}

.setting-description {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--text-muted);
    transition: 0.3s;
    border-radius: 28px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: var(--primary-color);
}

input:checked + .toggle-slider:before {
    transform: translateX(22px);
}

/* Data Management */
.data-description {
    color: var(--text-muted);
    margin-bottom: 20px;
}

.data-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.data-actions .btn {
    flex: 1;
    min-width: 140px;
}

/* FAQ Section */
.faq-section {
    background: var(--bg-color);
    padding: 40px 0;
}

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

.faq-item {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.faq-question {
    width: 100%;
    padding: 20px;
    background: transparent;
    border: none;
    text-align: left;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.faq-question:hover {
    background: var(--bg-color);
}

.faq-icon {
    font-size: 1.5rem;
    font-weight: 300;
    transition: transform 0.3s ease;
}

.faq-question[aria-expanded="true"] .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-answer:not([hidden]) {
    padding: 0 20px 20px;
    max-height: 500px;
}

.faq-answer p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin: 0;
}

/* ===== FOOTER ===== */
.app-footer {
    background: var(--card-bg);
    padding: 48px 0 24px;
    margin-top: 60px;
    border-top: 1px solid var(--border-color);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 32px;
    margin-bottom: 32px;
}

.footer-col h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-color);
}

.footer-col p {
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 16px;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

.footer-bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.b20-link {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.b20-link:hover {
    text-decoration: underline;
    opacity: 0.8;
}

/* ===== LEGAL PAGES ===== */
.legal-page .container {
    max-width: 800px;
    margin: 0 auto;
}

.legal-page .legal-content {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 24px;
    box-shadow: var(--card-shadow);
    line-height: 1.7;
    color: var(--text-color);
}

.legal-content h2 {
    color: var(--primary-color);
    margin-top: 32px;
    margin-bottom: 16px;
    font-size: 1.5rem;
}

.legal-content h3 {
    color: var(--text-color);
    margin-top: 24px;
    margin-bottom: 12px;
    font-size: 1.2rem;
}

.legal-content p, .legal-content ul {
    margin-bottom: 20px;
    color: var(--text-muted);
}

.legal-content ul {
    padding-left: 24px;
}

.legal-content li {
    margin-bottom: 8px;
}

@media (max-width: 768px) {
    .legal-page .legal-content {
        padding: 24px;
    }
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + 16px);
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text-color);
    color: var(--bg-color);
    padding: 12px 24px;
    border-radius: var(--border-radius-small);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 2000;
    max-width: 90%;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.loading-overlay.show {
    display: flex;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Utility Classes */
.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ===== AVATAR E SELETOR ===== */
.profile-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    background-color: var(--card-bg);
}

.avatar-selection-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.avatar-selection-section h4 {
    margin-bottom: 16px;
    color: var(--text-color);
    font-size: 1.1rem;
    font-weight: 600;
}

.avatar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
    max-height: 250px;
    overflow-y: auto;
    padding: 8px;
    border-radius: 12px;
    background-color: var(--bg-color);
}

.avatar-grid::-webkit-scrollbar {
    width: 6px;
}

.avatar-grid::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 4px;
}

.avatar-option {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    cursor: pointer;
    background-color: var(--card-bg);
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.avatar-option:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.avatar-option.selected {
    border-color: var(--primary-color);
    transform: scale(1.05);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.3);
}
