/* ============================================
   VARIABLES Y MODO OSCURO
   ============================================ */
:root {
    --font-size-base: 100%;
    --bg-gradient-start: #667eea;
    --bg-gradient-end: #764ba2;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-card: rgba(255, 255, 255, 0.95);
    --bg-header: #ffffff;
    --border-color: #e5e7eb;
}

/* Modo oscuro */
.dark {
    --bg-gradient-start: #1e1b4b;
    --bg-gradient-end: #312e81;
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --bg-card: rgba(31, 41, 55, 0.95);
    --bg-header: #1f2937;
    --border-color: #374151;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    min-height: 100vh;
    font-size: var(--font-size-base);
    transition: background 0.3s ease;
}

/* Override Tailwind colors en modo oscuro */
.dark .bg-white {
    background-color: var(--bg-header) !important;
}

.dark .text-gray-900,
.dark .text-gray-800 {
    color: var(--text-primary) !important;
}

.dark .text-gray-600,
.dark .text-gray-500 {
    color: var(--text-secondary) !important;
}

.dark .border-gray-200 {
    border-color: var(--border-color) !important;
}

.dark .bg-gray-200 {
    background-color: #374151 !important;
}

.dark .bg-gray-100 {
    background-color: #1f2937 !important;
}

.dark .hover\:bg-gray-100:hover {
    background-color: #374151 !important;
}

.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    transition: background 0.3s ease;
}

.dark .glass-card {
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Opciones en modo oscuro */
.dark .option-card {
    background-color: #374151;
    color: var(--text-primary);
}

.dark .option-card:hover {
    background-color: #4b5563;
}

/* Case study y behavioral en modo oscuro */
.dark .case-study-container {
    background: linear-gradient(to right, #1e3a5f, #1e3a8a);
}

.dark .behavioral-container {
    background: linear-gradient(to right, #78350f, #92400e);
}

/* Feedback container en modo oscuro */
.dark .bg-blue-50 {
    background-color: #1e3a5f !important;
}

.dark .border-blue-200 {
    border-color: #3b82f6 !important;
}

.dark .text-blue-900,
.dark .text-blue-700,
.dark .text-blue-600 {
    color: #93c5fd !important;
}

/* ============================================
   TAMAÑO DE LETRA DINÁMICO
   ============================================ */
#question-text {
    font-size: calc(1.25rem * var(--font-size-base) / 100);
    line-height: 1.6;
}

.option-card {
    font-size: calc(1rem * var(--font-size-base) / 100);
}

#case-context-text {
    font-size: calc(1rem * var(--font-size-base) / 100);
}

#feedback-text {
    font-size: calc(0.95rem * var(--font-size-base) / 100);
}

/* ============================================
   ESTILOS BASE
   ============================================ */
.progress-ring {
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
}

.progress-ring-circle {
    transition: stroke-dashoffset 0.35s;
    stroke-linecap: round;
}

.option-card {
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.option-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    border-color: #6366f1;
}

.option-card.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #764ba2;
    transform: scale(1.02);
}

.option-card.correct {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-color: #059669;
}

.option-card.incorrect {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border-color: #dc2626;
}

.timer-warning {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.case-study-container {
    background: linear-gradient(to right, #f0f9ff, #e0f2fe);
    border-left: 4px solid #3b82f6;
}

.behavioral-container {
    background: linear-gradient(to right, #fef3c7, #fde68a);
    border-left: 4px solid #f59e0b;
}

.question-type-badge {
    position: absolute;
    top: -10px;
    right: 20px;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
    background: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.type-functional {
    color: #6366f1;
    border: 1px solid #6366f1;
}

.type-behavioral {
    color: #f59e0b;
    border: 1px solid #f59e0b;
}

.type-case-study {
    color: #3b82f6;
    border: 1px solid #3b82f6;
}

/* Loading animation */
.loading-dots {
    display: inline-flex;
    gap: 0.25rem;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #6366f1;
    animation: loading 1.4s infinite both;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes loading {

    0%,
    80%,
    100% {
        transform: scale(0);
        opacity: 0.5;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ============================================
   STRESS MODE STYLES
   ============================================ */

/* Blink Animation for Exhaustion Bar */
@keyframes stress-blink {

    0%,
    100% {
        opacity: 1;
        background-color: #ef4444;
    }

    50% {
        opacity: 0.5;
        background-color: #fee2e2;
    }
}

.stress-blink {
    animation: stress-blink 0.5s infinite;
}

/* Vignette Effect (Tunnel Vision) - Dynamic */
:root {
    --stress-c-r: 220;
    --stress-c-g: 38;
    --stress-c-b: 38;
    --stress-speed: 1s;
}

.stress-vigette::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0px solid rgba(var(--stress-c-r), var(--stress-c-g), var(--stress-c-b), 0.3);
    box-shadow: inset 0 0 100px rgba(var(--stress-c-r), var(--stress-c-g), var(--stress-c-b), 0.5);
    z-index: 9999;
    pointer-events: none;
    animation: pulse-vigette var(--stress-speed) infinite;
}

@keyframes pulse-vigette {

    0%,
    100% {
        box-shadow: inset 0 0 30px rgba(var(--stress-c-r), var(--stress-c-g), var(--stress-c-b), 0.1);
    }

    50% {
        box-shadow: inset 0 0 100px rgba(var(--stress-c-r), var(--stress-c-g), var(--stress-c-b), 0.5);
    }
}

/* Timer Warning Upgrade */
.timer-warning {
    color: #dc2626 !important;
    transform: scale(1.1);
    transition: all 0.3s ease;
}