/* ============================================
   PQnos Educativos - Theme Colors
   Dynamic color themes for all variations
   ============================================ */

/* Rainbow Theme (Default) */
:root.theme-rainbow {
    --primary: #FFD93D;
    --secondary: #457B9D;
    --accent: #E63946;
    --bg: #FFFBF0;
    --text: #2D3142;
    --text-light: false;
}

/* Ocean Theme */
:root.theme-ocean {
    --primary: #0077B6;
    --secondary: #00B4D8;
    --accent: #90E0EF;
    --bg: #E0F7FF;
    --text: #023E8A;
    --text-light: false;
}

/* Forest Theme */
:root.theme-forest {
    --primary: #2D6A4F;
    --secondary: #40916C;
    --accent: #52B788;
    --bg: #D8F3DC;
    --text: #1B4332;
    --text-light: false;
}

/* Sunset Theme */
:root.theme-sunset {
    --primary: #FF6B35;
    --secondary: #F7931E;
    --accent: #FDB833;
    --bg: #FFF4E6;
    --text: #5D2E0F;
    --text-light: false;
}

/* Night Theme */
:root.theme-night {
    --primary: #667BC6;
    --secondary: #9BA3EB;
    --accent: #D4A5FF;
    --bg: #1A1A2E;
    --text: #E0E0E0;
    --text-light: true;
}

/* Candy Theme */
:root.theme-candy {
    --primary: #FF006E;
    --secondary: #FB5607;
    --accent: #FFBE0B;
    --bg: #FFF0F5;
    --text: #6A0572;
    --text-light: false;
}

/* Apply theme colors to elements */
body {
    background-color: var(--bg);
    color: var(--text);
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--primary);
    color: #FFFFFF;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    filter: brightness(0.9);
}

.btn-secondary {
    border-color: var(--primary);
    color: var(--primary);
    transition: all 0.3s ease;
}

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

.navbar {
    background-color: rgba(255, 255, 255, 0.95);
    transition: all 0.3s ease;
}

.navbar-link.active {
    background-color: var(--primary);
    color: #FFFFFF;
    box-shadow: 0 4px 0 0 rgba(45, 49, 66, 0.1), 0 8px 24px -4px rgba(45, 49, 66, 0.12);
}

.card {
    background-color: #FFFFFF;
    color: var(--text);
    border-top-color: var(--primary);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 0 0 rgba(45, 49, 66, 0.1), 0 8px 24px -4px rgba(45, 49, 66, 0.12);
}

.section-bg-sun {
    background-color: rgba(255, 217, 61, 0.1);
}

.section-bg-cherry {
    background-color: rgba(230, 57, 70, 0.1);
}

.section-bg-sky {
    background-color: rgba(69, 123, 157, 0.1);
}

.section-bg-apple {
    background-color: rgba(42, 157, 143, 0.1);
}

.section-bg-mango {
    background-color: rgba(244, 162, 97, 0.1);
}

.section-bg-berry {
    background-color: rgba(157, 78, 221, 0.1);
}

.section-bg-cream {
    background-color: var(--bg);
}

/* Adjust text colors for light backgrounds */
:root.theme-rainbow body,
:root.theme-ocean body,
:root.theme-forest body,
:root.theme-sunset body,
:root.theme-candy body {
    color: var(--text);
}

/* Adjust text colors for dark backgrounds */
:root.theme-night body {
    color: var(--text);
    background-color: var(--bg);
}

:root.theme-night .navbar {
    background-color: rgba(26, 26, 46, 0.95);
    border-bottom: 2px solid var(--primary);
}

:root.theme-night .card {
    background-color: #2D2D4D;
    color: var(--text);
}

:root.theme-night .card:hover {
    background-color: #3D3D5D;
}

:root.theme-night input,
:root.theme-night textarea,
:root.theme-night select {
    background-color: #2D2D4D;
    color: var(--text);
    border-color: var(--primary);
}

:root.theme-night input:focus,
:root.theme-night textarea:focus,
:root.theme-night select:focus {
    background-color: #3D3D5D;
    border-color: var(--accent);
}

/* Footer theme adjustments */
.footer {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 50%, var(--accent) 100%);
    color: #FFFFFF;
    transition: all 0.3s ease;
}

.footer-logo {
    background-color: #FFFFFF;
    border-radius: 12px;
    padding: 8px;
}

/* Selector styling */
.selector-input {
    background-color: var(--bg);
    color: var(--text);
    border-color: var(--primary);
    transition: all 0.3s ease;
}

.selector-input:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 217, 61, 0.1);
}

.selector-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 217, 61, 0.2);
}

/* Ensure theme selector is visible */
.theme-language-selector {
    position: fixed !important;
    top: 15px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 999 !important;
}

/* Smooth transitions */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Prevent transition on page load */
body.preload * {
    transition: none !important;
}
