:root {
    --bg-gradient-start: #0f172a;
    --bg-gradient-end: #1e293b;
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);

    --success-color: #10b981;
    --success-bg: rgba(16, 185, 129, 0.15);
    --error-color: #ef4444;
    --error-bg: rgba(239, 68, 68, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* ============================================================
   WORD CLOUD BACKGROUND (Home Menu)
   ============================================================ */

#word-cloud-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    /* Never intercepts clicks */
    z-index: 0;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.6s ease;
}

#home-view.word-cloud-visible #word-cloud-bg {
    opacity: 1;
}

.wc-word {
    position: absolute;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.04);
    user-select: none;
    white-space: nowrap;
    cursor: default;
    pointer-events: none;
    /* Never block user interaction */
    transition: color 0.4s ease, text-shadow 0.4s ease;
    animation: wcFloat 12s ease-in-out infinite;
}

/* Hover class applied via JS mousemove — no pointer-events needed */
.wc-word.wc-hover {
    color: rgba(147, 197, 253, 0.6);
    text-shadow: 0 0 18px rgba(96, 165, 250, 0.45);
    transition: color 0.15s ease, text-shadow 0.15s ease;
}

@keyframes wcFloat {
    0% {
        transform: translate(0px, 0px) rotate(var(--wc-rot));
    }

    25% {
        transform: translate(var(--wc-driftX), calc(var(--wc-drift) * 0.6)) rotate(calc(var(--wc-rot) + var(--wc-rotDelta)));
    }

    50% {
        transform: translate(calc(var(--wc-driftX) * -0.5), var(--wc-drift)) rotate(var(--wc-rot));
    }

    75% {
        transform: translate(calc(var(--wc-driftX) * 0.3), calc(var(--wc-drift) * 0.3)) rotate(calc(var(--wc-rot) - var(--wc-rotDelta)));
    }

    100% {
        transform: translate(0px, 0px) rotate(var(--wc-rot));
    }
}

.app-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Typography elements */
header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.8s ease-out;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(to right, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Glassmorphism Panel reusable class */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);

    /* Optimized rendering to prevent solid-color flash */
    will-change: backdrop-filter;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

/* ============================================================
   POMODORO WIDGET & SOUND TOGGLE
   ============================================================ */
#pomodoro-widget {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--glass-border);
    color: white;
    border-radius: 8px;
    padding: 0.5rem 0.8rem;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
}

#pomodoro-widget:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#pomodoro-widget.running {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: #fca5a5;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

#pomodoro-widget.break {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.4);
    color: #6ee7b7;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

#btn-sound-toggle {
    position: absolute;
    top: 1.25rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--glass-border);
    color: white;
    border-radius: 8px;
    padding: 0.5rem 0.8rem;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

#btn-sound-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Versión móvil (Home): Bajar la campana para que no tape el texto "TAI" */
@media (max-width: 768px) {
    #btn-sound-toggle {
        top: auto;
        bottom: 2rem;
        right: 1.5rem;
        position: fixed;
        /* Se queda pegada a la pantalla en móvil para mejor ergonomía */
        background: rgba(15, 23, 42, 0.85);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        border-color: rgba(255, 255, 255, 0.2);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    }
}

/* Durante examen (PC): Pegada al lateral del bloque de preguntas */
@media (min-width: 1201px) {
    body.exam-active #btn-sound-toggle {
        top: 50%;
        right: calc(50% - 500px - 70px);
        /* Justo a la derecha del contenedor de 1000px */
        transform: translateY(-50%);
        position: fixed;
    }
}

/* Si la pantalla PC es estrecha, la mantenemos arriba del bloque de preguntas */
@media (max-width: 1200px) and (min-width: 769px) {
    body.exam-active #btn-sound-toggle {
        top: 1.5rem;
        right: 2rem;
        position: absolute;
    }
}

/* Views Handling */
.view {
    display: none;
    animation: fadeIn 0.5s ease-out;
}

.view.active {
    display: block;
}

/* Home view gets a dedicated animation that holds opacity:0 briefly so
   backdrop-filter has time to compute before cards become visible.
   This prevents the 1-2s solid-colour flash on cards. */
#home-view.active {
    animation: homeViewFadeIn 0.85s ease-out both;
}

@keyframes homeViewFadeIn {
    0% {
        opacity: 0;
    }

    35% {
        opacity: 0;
    }

    /* hide for ~300ms while backdrop-filter computes */
    100% {
        opacity: 1;
    }
}

.modal.view.active {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.95);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.modal-content {
    background: rgba(255, 255, 255, 0.05);
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-height: 90vh;
    overflow-y: auto;
}

@media (max-width: 768px) {
    .modal-content {
        padding: 1.5rem;
    }
}

.input-field:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
}

.hidden {
    display: none !important;
}

/* HOME VIEW */
.intro-box {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 3rem auto;
    color: var(--text-muted);
    line-height: 1.6;
}

.intro-box h2 {
    color: var(--text-main);
    margin-bottom: 1rem;
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0.5rem;
}

.simulators-grid,
.supuesto-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.simulator-card,
.supuesto-card {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.25rem;
    margin-bottom: 10px;
    color: #f8fafc;
}

.simulator-card p,
.supuesto-card p {
    color: #cbd5e1;
    margin-bottom: 20px;
}

.simulator-card:hover,
.supuesto-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 140px;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.4);
    background: rgba(255, 255, 255, 0.08);
}

.card h4 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.card p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* EXAM VIEW */
.exam-header {
    margin-bottom: 2rem;
}

#current-exam-title {
    margin: 1.5rem 0 0.5rem 0;
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.progress-bar-bg {
    flex: 1;
    height: 8px;
    background: var(--glass-bg);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    width: 0%;
    transition: width 0.4s ease;
}

/* Question Area */
#question-text {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    line-height: 1.5;
}

.question-badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    margin-bottom: 1rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.badge-bloque1 {
    background: rgba(245, 158, 11, 0.2);
    color: #fcd34d;
    border: 1px solid rgba(245, 158, 11, 0.5);
}

.badge-bloque2 {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.5);
}

.badge-bloque3 {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.5);
}

.badge-bloque4 {
    background: rgba(139, 92, 246, 0.2);
    color: #c4b5fd;
    border: 1px solid rgba(139, 92, 246, 0.5);
}

.badge-desconocido {
    background: rgba(148, 163, 184, 0.2);
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.5);
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.option-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    color: var(--text-main);
    text-align: left;
    font-size: 1.05rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.option-btn .letter {
    font-weight: 600;
    color: var(--primary-color);
    width: 24px;
}

.option-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateX(4px);
}

.option-btn:focus,
.option-btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    background: rgba(255, 255, 255, 0.1);
}

.option-btn:disabled {
    cursor: default;
    opacity: 0.7;
}

.option-btn.selected-neutral {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
    color: #fff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

.option-btn.selected-doubtful {
    background: rgba(245, 158, 11, 0.2);
    border-color: rgba(245, 158, 11, 0.7);
    color: #fde68a;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.15);
}

.option-btn.selected-doubtful .letter {
    color: #fcd34d;
}

.option-btn.correct {
    background: var(--success-bg);
    border-color: var(--success-color);
    color: #fff;
}

.option-btn.correct .letter {
    color: var(--success-color);
}

.option-btn.incorrect {
    background: var(--error-bg);
    border-color: var(--error-color);
    color: #fff;
}

.option-btn.incorrect .letter {
    color: var(--error-color);
}

/* Explanation */
.explanation-box {
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(15, 23, 42, 0.5);
    border-left: 4px solid #a78bfa;
    border-radius: 0 8px 8px 0;
    animation: slideInUp 0.4s ease;
}

.explanation-box h4 {
    color: #a78bfa;
    margin-bottom: 0.5rem;
}

.explanation-box p {
    line-height: 1.6;
    color: #cbd5e1;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    font-size: 1rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
    background: var(--glass-bg);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
    opacity: 1 !important;
}

.mt-4 {
    margin-top: 1.5rem;
}

/* Summary box */
.summary-box {
    text-align: center;
    padding: 4rem 2rem;
}

.score-display {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
}

.score-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(167, 139, 250, 0.2));
    border: 4px solid var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 800;
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.3);
}

footer {
    text-align: center;
    margin-top: auto;
    padding-top: 3rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================
   ESQUEMAS INTERACTIVOS
   ========================================= */

/* Theme Colors */
.theme-linux {
    background-color: #f97316;
    color: white;
}

.theme-windows {
    background-color: #2563eb;
    color: white;
}

.theme-powershell {
    background-color: #0e7490;
    color: white;
}

.theme-macos {
    background-color: #1e293b;
    color: white;
}

.theme-iac {
    background-color: #4f46e5;
    color: white;
}

.theme-bbdd {
    background-color: #059669;
    color: white;
}

.theme-storage {
    background-color: #0284c7;
    color: white;
}

.theme-backup {
    background-color: #f59e0b;
    color: white;
}

.theme-virtual {
    background-color: #7c3aed;
    color: white;
}

.theme-conceptos {
    background-color: #4f46e5;
    color: white;
}

/* indigo-600 */
.theme-componentes {
    background-color: #2563eb;
    color: white;
}

/* blue-600 */
.theme-protocolos {
    background-color: #ea580c;
    color: white;
}

/* orange-600 */
.theme-seguridad {
    background-color: #10b981;
    color: white;
}

/* emerald-500 */

.theme-monitorizacion {
    background-color: #2563eb;
    color: white;
}

/* blue-600 */
.theme-seguridad-cpd {
    background-color: #059669;
    color: white;
}

/* emerald-600 */
.theme-amenazas {
    background-color: #dc2626;
    color: white;
}

/* red-600 */
.theme-criptografia {
    background-color: #d97706;
    color: white;
}

/* amber-600 */
.theme-incidencias {
    background-color: #0891b2;
    color: white;
}

/* cyan-600 */

.theme-senales {
    background-color: #2563eb;
    color: white;
}

/* blue-600 */
.theme-guiados {
    background-color: #059669;
    color: white;
}

/* emerald-600 */
.theme-inalambricas {
    background-color: #f97316;
    color: white;
}

/* orange-500 */
.theme-redes-moviles {
    background-color: #9333ea;
    color: white;
}

/* purple-600 */
.theme-wpan {
    background-color: #0d9488;
    color: white;
}

/* teal-600 */

.theme-ipv4 {
    background-color: #2563eb;
    color: white;
}

/* blue-600 */
.theme-ipv6 {
    background-color: #059669;
    color: white;
}

/* emerald-600 */
.theme-modelos {
    background-color: #9333ea;
    color: white;
}

/* purple-600 */
.theme-protocolos_aux {
    background-color: #f97316;
    color: white;
}

/* orange-500 */
.theme-transporte {
    background-color: #dc2626;
    color: white;
}

/* red-600 */

.theme-internet {
    background-color: #2563eb;
    color: white;
}

/* blue-600 */
.theme-dns {
    background-color: #059669;
    color: white;
}

/* emerald-600 */
.theme-http {
    background-color: #f97316;
    color: white;
}

/* orange-500 */
.theme-ftp {
    background-color: #9333ea;
    color: white;
}

/* purple-600 */
.theme-servidores {
    background-color: #0d9488;
    color: white;
}

/* teal-600 */

.theme-firewalls {
    background-color: #2563eb;
    color: white;
}

/* blue-600 */
.theme-ids_ips {
    background-color: #059669;
    color: white;
}

/* emerald-600 */
.theme-vpn {
    background-color: #9333ea;
    color: white;
}

/* purple-600 */
.theme-medidas {
    background-color: #f97316;
    color: white;
}

/* orange-500 */
.theme-iptables {
    background-color: #1e293b;
    color: white;
}

/* slate-800 */

.theme-redes {
    background-color: #2563eb;
    color: white;
}

/* blue-600 */
.theme-trama {
    background-color: #059669;
    color: white;
}

/* emerald-600 */
.theme-ethernet {
    background-color: #f97316;
    color: white;
}

/* orange-500 */
.theme-acceso {
    background-color: #9333ea;
    color: white;
}

/* purple-600 */
.theme-dispositivos {
    background-color: #0d9488;
    color: white;
}

/* teal-600 */

/* BLOQUE 3 */
.theme-conceptos {
    background-color: #4f46e5;
    color: white;
}

/* indigo-600 */
.theme-entidades {
    background-color: #059669;
    color: white;
}

/* emerald-600 */
.theme-relaciones {
    background-color: #f97316;
    color: white;
}

/* orange-500 */
.theme-extensiones {
    background-color: #9333ea;
    color: white;
}

/* purple-600 */

.theme-arquitectura {
    background-color: #2563eb;
    color: white;
}

/* blue-600 */
.theme-logico {
    background-color: #059669;
    color: white;
}

/* emerald-600 */
.theme-fisico {
    background-color: #f97316;
    color: white;
}

/* orange-500 */
.theme-algebra {
    background-color: #9333ea;
    color: white;
}

/* purple-600 */
.theme-normalizacion {
    background-color: #0d9488;
    color: white;
}

.theme-clasificacion {
    background-color: #059669;
    color: white;
}

/* emerald-600 */
.theme-datos {
    background-color: #f97316;
    color: white;
}

/* orange-500 */
.theme-control {
    background-color: #9333ea;
    color: white;
}

/* purple-600 */
.theme-subprogramas {
    background-color: #0d9488;
    color: white;
}

/* teal-600 */

.theme-historia {
    background-color: #4f46e5;
    color: white;
}

/* indigo-600 */
.theme-ddl {
    background-color: #059669;
    color: white;
}

/* emerald-600 */
.theme-dml {
    background-color: #f97316;
    color: white;
}

/* orange-500 */
.theme-select {
    background-color: #2563eb;
    color: white;
}

/* blue-600 */
.theme-dcl {
    background-color: #0d9488;
    color: white;
}

.theme-poo {
    background-color: #2563eb;
    color: white;
}

/* blue-600 */
.theme-pilares {
    background-color: #059669;
    color: white;
}

/* emerald-600 */
.theme-uml {
    background-color: #f97316;
    color: white;
}

/* orange-500 */
.theme-patrones_gof {
    background-color: #9333ea;
    color: white;
}

/* purple-600 */
.theme-grasp {
    background-color: #0d9488;
    color: white;
}

.theme-cycpp {
    background-color: #2563eb;
    color: white;
}

/* blue-600 */
.theme-javacore {
    background-color: #f97316;
    color: white;
}

/* orange-500 */
.theme-javaee {
    background-color: #059669;
    color: white;
}

/* emerald-600 */
.theme-dotnet {
    background-color: #9333ea;
    color: white;
}

/* purple-600 */

.theme-arquitecturas {
    background-color: #2563eb;
    color: white;
}

/* blue-600 */
.theme-soa {
    background-color: #059669;
    color: white;
}

/* emerald-600 */
.theme-microservicios {
    background-color: #9333ea;
    color: white;
}

/* purple-600 */
.theme-servicios_web {
    background-color: #f97316;
    color: white;
}

/* orange-500 */
.theme-herramientas {
    background-color: #0d9488;
    color: white;
}

/* teal-600 */

/* teal-600 */

/* teal-600 */

.theme-gestion {
    background-color: #059669;
    color: white;
}

/* emerald-600 */
.theme-snmp {
    background-color: #ea580c;
    color: white;
}

/* orange-500 */
.theme-sniffers {
    background-color: #9333ea;
    color: white;
}

/* purple-600 */
.theme-apps {
    background-color: #2563eb;
    color: white;
}

/* blue-600 */
.theme-htmlxml {
    background-color: #f97316;
    color: white;
}

/* orange-500 */
.theme-cssweb {
    background-color: #0d9488;
    color: white;
}

/* teal-600 */
.theme-javascript {
    background-color: #059669;
    color: white;
}

/* emerald-600 */
.theme-backend {
    background-color: #9333ea;
    color: white;
}

/* purple-600 */

.theme-accesibilidad {
    background-color: #2563eb;
    color: white;
}

/* blue-600 */
.theme-herramientas {
    background-color: #059669;
    color: white;
}

/* emerald-600 */
.theme-normativa {
    background-color: #f97316;
    color: white;
}

/* orange-500 */
.theme-autenticacion {
    background-color: #9333ea;
    color: white;
}

/* purple-600 */
.theme-seguridad {
    background-color: #0d9488;
    color: white;
}

/* teal-600 */

.theme-herramientas_desarrollo {
    background-color: #2563eb;
    color: white;
}

/* blue-600 */
.theme-mantenimiento {
    background-color: #059669;
    color: white;
}

/* emerald-600 */
.theme-calidad {
    background-color: #ef4444;
    color: white;
}

/* red-500 */
.theme-metodologias {
    background-color: #0d9488;
    color: white;
}

/* teal-600 */
.theme-metrica {
    background-color: #9333ea;
    color: white;
}

/* purple-600 */

/* pink-600 */

/* pink-600 */

/* Tabs */
.esquema-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    font-weight: 500;
    cursor: pointer;
    background: var(--glass-bg);
    color: var(--text-muted);
    border: 1px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.esquema-tab:hover {
    background: rgba(255, 255, 255, 0.1);
}

.esquema-tab.active {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transform: scale(1.05);
    z-index: 10;
}

.esquema-tab .badge {
    font-size: 0.75rem;
    padding: 0.1rem 0.5rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.2);
}

/* Accordion */
.accordion-item {
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    background: rgba(15, 23, 42, 0.4);
    overflow: hidden;
    transition: all 0.3s ease;
}

.accordion-header {
    width: 100%;
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-weight: 600;
    cursor: pointer;
}

.accordion-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.accordion-body {
    padding: 1rem 1.25rem;
    background: rgba(0, 0, 0, 0.2);
    color: #cbd5e1;
    font-size: 0.95rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: none;
    line-height: 1.6;
}

.accordion-item.open .accordion-body {
    display: block;
    animation: fadeIn 0.3s ease;
}

.chevron {
    transition: transform 0.3s ease;
}

.accordion-item.open .chevron {
    transform: rotate(180deg);
}



@media (max-width: 600px) {
    .app-container {
        padding: 1rem;
    }

    header h1 {
        font-size: 2rem;
    }

    .glass-panel {
        padding: 1.5rem;
    }

    .option-btn {
        padding: 0.8rem 1rem;
    }
}

/* ===== FLASHCARDS STYLES ===== */

.flashcard-container {
    perspective: 1000px;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    height: 400px;
}

.flashcard {
    width: 100%;
    height: 100%;
    position: relative;
    transition: transform 0.6s cubic-bezier(0.4, 0.2, 0.2, 1);
    transform-style: preserve-3d;
    cursor: pointer;
}

/* Class to trigger the flip from JS */
.flashcard.flipped {
    transform: rotateY(180deg);
}

.flashcard-front,
.flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 16px;
    padding: 2rem;
    box-sizing: border-box;
    text-align: center;
}

.flashcard-front {
    background: linear-gradient(145deg, rgb(30, 41, 59), rgb(15, 23, 42));
    border: 2px solid rgba(59, 130, 246, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.flashcard-front:hover {
    border-color: rgba(59, 130, 246, 0.8);
    box-shadow: 0 10px 40px rgba(59, 130, 246, 0.2);
}

.flashcard-back {
    background: linear-gradient(145deg, rgb(16, 55, 45), rgb(15, 23, 42));
    border: 2px solid rgba(16, 185, 129, 0.5);
    transform: rotateY(180deg);
}

.flashcard-label {
    position: absolute;
    top: 20px;
    font-size: 0.8rem;
    letter-spacing: 2px;
    color: var(--text-muted);
    font-weight: 800;
}

/* =========================================
   DASHBOARD ACTIONS (Top Menu)
   ========================================= */
.dashboard-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.action-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 0.6rem 1rem;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 600;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.action-btn.stats {
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.1), rgba(167, 139, 250, 0.05));
    border-color: rgba(167, 139, 250, 0.3);
    color: #c4b5fd;
}

.action-btn.stats:hover {
    background: rgba(167, 139, 250, 0.2);
    box-shadow: 0 4px 12px rgba(167, 139, 250, 0.2);
}

.action-btn.repaso {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.05));
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.action-btn.repaso:hover {
    background: rgba(239, 68, 68, 0.2);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.action-btn.favs {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(245, 158, 11, 0.05));
    border-color: rgba(245, 158, 11, 0.3);
    color: #fcd34d;
}

.action-btn.favs:hover {
    background: rgba(245, 158, 11, 0.2);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

.action-btn.new {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
    border-color: rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
}

.action-btn.new:hover {
    background: rgba(16, 185, 129, 0.2);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.action-btn.history {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.1), rgba(6, 182, 212, 0.05));
    border-color: rgba(6, 182, 212, 0.3);
    color: #67e8f9;
}

.action-btn.history:hover {
    background: rgba(6, 182, 212, 0.2);
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.2);
}

@media (max-width: 768px) {
    .user-profile-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1.5rem;
    }

    .dashboard-actions {
        justify-content: center;
        width: 100%;
    }

    .action-btn {
        flex: 1 1 calc(50% - 10px);
        justify-content: center;
    }
}

/* ============================================================
   GAMIFICATION BADGES & TOAST
   ============================================================ */
.badge {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(147, 51, 234, 0.2));
    border: 2px solid rgba(147, 51, 234, 0.5);
    box-shadow: 0 0 15px rgba(147, 51, 234, 0.3);
    color: white;
    cursor: default;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.badge:hover {
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(147, 51, 234, 0.5);
}

.badge .icon {
    font-size: 2rem;
    margin-bottom: 5px;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.8));
}

.badge .title {
    font-size: 0.7rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.1;
    padding: 0 5px;
}

.badge.locked {
    background: rgba(255, 255, 255, 0.05);
    border: 2px dashed rgba(255, 255, 255, 0.1);
    box-shadow: none;
    color: var(--text-muted);
}

.badge.locked .icon {
    filter: grayscale(100%) opacity(0.5);
}

.badge.locked:hover {
    transform: none;
    box-shadow: none;
}

/* Toast Animation */
@keyframes slideUpFade {
    0% {
        bottom: -50px;
        opacity: 0;
    }

    10% {
        bottom: 20px;
        opacity: 1;
    }

    90% {
        bottom: 20px;
        opacity: 1;
    }

    100% {
        bottom: -50px;
        opacity: 0;
    }
}

#toast-container {
    position: fixed;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(250, 204, 21, 0.5);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(250, 204, 21, 0.2);
    color: white;
    padding: 1rem 2rem;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
}

#toast-container.show {
    animation: slideUpFade 4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* ============================================================
   LIGHT THEME OVERRIDES
   ============================================================ */
body.light-mode {
    --bg-color: #f1f5f9;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(0, 0, 0, 0.1);
    background: var(--bg-color);
}

body.light-mode .card,
body.light-mode .glass-panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
}

body.light-mode .option-btn {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--text-main);
}

body.light-mode .option-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

body.light-mode .option-btn.selected-neutral {
    background: #e0f2fe;
    border-color: #38bdf8;
    color: #0369a1;
}

body.light-mode .app-container {
    color: var(--text-main);
}

body.light-mode h1,
body.light-mode h2,
body.light-mode h3,
body.light-mode h4 {
    color: var(--text-main);
}

body.light-mode #btn-theme-toggle,
body.light-mode #btn-sound-toggle,
body.light-mode #pomodoro-widget {
    color: var(--text-main);
    background: #f1f5f9;
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .user-profile-header {
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

body.light-mode .action-btn {
    background: #f1f5f9 !important;
    color: #1e293b !important;
    border: 1px solid #cbd5e1 !important;
}

body.light-mode .action-btn:hover {
    background: #e2e8f0 !important;
}

body.light-mode .option-btn:focus,
body.light-mode .option-btn:focus-visible {
    outline: 2px solid #3b82f6 !important;
    background: rgba(0, 0, 0, 0.05);
}

body.light-mode .word {
    color: rgba(0, 0, 0, 0.4);
}

body.light-mode [style*="color: white"],
body.light-mode [style*="color: #fff"],
body.light-mode [style*="color:#fff"],
body.light-mode [style*="color: rgba(255,255,255"],
body.light-mode [style*="color: #e2e8f0"],
body.light-mode [style*="color:#e2e8f0"] {
    color: var(--text-main) !important;
}

/* ============================================================
   VOICE FLASHCARDS (GEMINI)
   ============================================================ */
.voice-pulse-ring {
    position: relative;
    width: 60px;
    height: 60px;
    background: rgba(139, 92, 246, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #8b5cf6;
    transition: all 0.3s ease;
}

.voice-pulse-ring::before,
.voice-pulse-ring::after {
    content: '';
    position: absolute;
    left: -10px;
    top: -10px;
    right: -10px;
    bottom: -10px;
    border-radius: 50%;
    border: 2px solid #8b5cf6;
    opacity: 0;
    pointer-events: none;
}

/* Estado Escuchando (pulsante) */
.voice-pulse-ring.listening::before {
    animation: pulse-ring 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

.voice-pulse-ring.listening::after {
    animation: pulse-ring 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
    animation-delay: 1s;
}
.voice-pulse-ring.listening {
    background: rgba(139, 92, 246, 0.4);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.5);
}

/* Estado AI Hablando */
.voice-pulse-ring.speaking {
    background: rgba(16, 185, 129, 0.4);
    border-color: #10b981;
    box-shadow: 0 0 25px rgba(16, 185, 129, 0.6);
    animation: ai-speak 1s infinite alternate;
}

@keyframes pulse-ring {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

@keyframes ai-speak {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(1.15);
    }
}