/**
 * HTML & CSS Guide - Theme Styles
 * Desenvolvido por B20 Conteúdo Digital
 * https://www.b20.com.br
 */

/* ===== COLOR PALETTE (Antigravity Soft UI) ===== */
:root {
    /* Primary Colors */
    --primary-color: #2563EB;
    --secondary-color: #0F172A;
    --accent-color: #3B82F6;
    --surface-base: #F8FAFC;
    --text-base: #0F172A;
    
    /* Derived Colors */
    --primary-hover: #1D4ED8;
    --primary-light: rgba(37, 99, 235, 0.1);
    
    /* Light Theme */
    --bg-color: #F8FAFC;
    --surface-color: #FFFFFF;
    --surface-hover: #F1F5F9;
    --text-color: #0F172A;
    --text-muted: #64748B;
    --border-color: #E2E8F0;
    
    /* Shadows (Weightless / Floating) */
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 24px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.12);
    
    /* Spacing */
    --spacing-unit: 8px;
    --border-radius: 16px;
    
    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

/* ===== DARK MODE ===== */
[data-theme="dark"] {
    --bg-color: #0F172A;
    --surface-color: #1E293B;
    --surface-hover: #334155;
    --text-color: #F8FAFC;
    --text-muted: #94A3B8;
    --border-color: rgba(255, 255, 255, 0.05);
    
    /* Subtle shadows for dark mode */
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 10px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.4);
}

/* ===== DARK MODE SPECIFIC STYLES ===== */
[data-theme="dark"] body {
    background: var(--bg-color);
    color: var(--text-color);
}

[data-theme="dark"] .app-header {
    background: rgba(30, 30, 30, 0.95);
    border-bottom: 1px solid var(--border-color);
}

[data-theme="dark"] .bottom-nav {
    background: rgba(30, 30, 30, 0.95);
    border-top: 1px solid var(--border-color);
}

[data-theme="dark"] .code-editor {
    background: #1E1E1E;
    color: #D4D4D4;
}

[data-theme="dark"] #preview-frame {
    background: #FFFFFF;
}

[data-theme="dark"] .search-box {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .filter-tab {
    border-color: var(--border-color);
}

[data-theme="dark"] .feature-card,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .dict-item,
[data-theme="dark"] .challenge-card,
[data-theme="dark"] .roadmap-content {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .feature-icon {
    background: rgba(0, 221, 128, 0.15);
}

[data-theme="dark"] .faq-section {
    background: var(--surface-color);
}

[data-theme="dark"] .faq-item {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
}

/* ===== THEME TOGGLE ANIMATION ===== */
#theme-toggle {
    position: relative;
    overflow: hidden;
}

#theme-toggle i {
    transition: transform 0.3s ease;
}

[data-theme="dark"] #theme-toggle i.fa-moon {
    transform: rotate(180deg) scale(0);
}

[data-theme="dark"] #theme-toggle i.fa-sun {
    transform: rotate(0) scale(1);
}

/* ===== GRADIENT ACCENTS ===== */
.gradient-text {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gradient-bg {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

/* ===== GLASSMORPHISM EFFECT ===== */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

[data-theme="dark"] .glass {
    background: rgba(30, 30, 30, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ===== EDUCATION & GAMIFICATION ELEMENTS ===== */
.progress-ring {
    width: 120px;
    height: 120px;
    position: relative;
}

.progress-ring-circle {
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
}

.progress-ring-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Achievement Badge */
.achievement-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #F59E0B, #FCD34D);
    border-radius: 100px;
    color: #000;
    font-weight: 600;
    box-shadow: 4px 4px 0px rgba(0, 221, 128, 0.4);
    animation: badgePulse 2s infinite;
}

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

/* Streak Counter */
.streak-counter {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #EC4899, #F43F5E);
    border-radius: 100px;
    color: white;
    font-weight: 700;
    box-shadow: 4px 4px 0px rgba(0, 221, 128, 0.4);
}

.streak-counter i {
    font-size: 1.5rem;
}

/* Level Badge */
.level-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-color), #00F0FF);
    border-radius: 50%;
    color: white;
    font-weight: 700;
    font-size: 1.2rem;
    box-shadow: 4px 4px 0px rgba(0, 221, 128, 0.4);
}

/* ===== CELEBRATION ANIMATIONS ===== */
@keyframes celebrate {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    25% {
        transform: scale(1.2) rotate(-10deg);
    }
    75% {
        transform: scale(1.2) rotate(10deg);
    }
}

.celebrate {
    animation: celebrate 0.6s ease;
}

/* Confetti effect (CSS only) */
@keyframes confetti-fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background: var(--primary-color);
    animation: confetti-fall 3s linear;
    pointer-events: none;
    z-index: 9999;
}

/* ===== SYNTAX HIGHLIGHTING (Code Editor) ===== */
[data-theme="dark"] .code-editor {
    /* VS Code Dark+ theme colors */
    color: #D4D4D4;
}

.code-keyword {
    color: #569CD6;
}

.code-string {
    color: #CE9178;
}

.code-comment {
    color: #6A9955;
    font-style: italic;
}

.code-function {
    color: #DCDCAA;
}

.code-number {
    color: #B5CEA8;
}

/* ===== RESPONSIVE THEME ADJUSTMENTS ===== */
@media (max-width: 767px) {
    :root {
        --border-radius: 8px;
    }
    
    .progress-ring {
        width: 80px;
        height: 80px;
    }
    
    .progress-ring-text {
        font-size: 1.2rem;
    }
}

/* ===== PRINT THEME ===== */
@media print {
    * {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
    }
}

/* ===== HIGH CONTRAST MODE ===== */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #1D4ED8;
        --text-color: #000000;
        --bg-color: #FFFFFF;
    }
    
    [data-theme="dark"] {
        --primary-color: #3B82F6;
        --text-color: #FFFFFF;
        --bg-color: #000000;
    }
}
    
    [data-theme="dark"] {
        --primary-color: #00DD80;
        --text-color: #FFFFFF;
        --bg-color: #000000;
    }
}
    
    [data-theme="dark"] {
        --primary-color: #FF5722;
        --text-color: #FFFFFF;
        --bg-color: #000000;
    }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== COLOR SCHEME PREFERENCE ===== */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        --bg-color: #0F0F0F;
        --surface-color: #1E1E1E;
        --surface-hover: #2A2A2A;
        --text-color: #FFFFFF;
        --text-muted: #AAAAAA;
        --border-color: #3A3A3A;
    }
}
