/**
 * Estilos personalizados para Quiz Verdadero/Falso
 * Complementa a Tailwind CSS
 */

/* Variables CSS */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --success-gradient: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --error-gradient: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    --warning-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --shadow-soft: 0 10px 25px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 15px 35px rgba(0, 0, 0, 0.15);
    --shadow-strong: 0 20px 40px rgba(0, 0, 0, 0.2);
}

/* Fuentes personalizadas */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* Estilos base */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #2d3748;
    background-image: url(//game.losjuegosdelhuevo.eu/assets/images/bg.jpg);
    min-height: 100vh;
}

/* Contenedores principales */
.container {
    max-width: 1200px;
}

/* Tarjetas mejoradas */
.card-enhanced {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: var(--shadow-medium);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.card-enhanced:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-strong);
}

/* Botones mejorados */
.btn-primary {
    background: var(--primary-gradient);
    border: none;
    border-radius: 50px;
    padding: 12px 30px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

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

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

/* Botones de respuesta */
.answer-btn {
    position: relative;
    overflow: hidden;
    transform-origin: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.answer-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.answer-btn:active::after {
    width: 300px;
    height: 300px;
}

/* Barra de progreso mejorada */
.progress-container {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    padding: 2px;
    backdrop-filter: blur(5px);
}

.progress-bar {
    background: linear-gradient(90deg, #11998e, #38ef7d, #4facfe, #00f2fe);
    background-size: 400% 400%;
    animation: gradient-shift 3s ease infinite;
    border-radius: 50px;
    height: 12px;
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: progress-shine 2s infinite;
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes progress-shine {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Efectos de feedback */
.feedback-correct {
    background: var(--success-gradient);
    color: white;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow-soft);
    animation: bounce-in 0.5s ease-out;
}

.feedback-incorrect {
    background: var(--error-gradient);
    color: white;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow-soft);
    animation: shake 0.5s ease-out;
}

@keyframes bounce-in {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
}

/* Formulario mejorado */
.form-group {
    position: relative;
    margin-bottom: 24px;
}

.form-input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: rgba(255, 255, 255, 1);
}

.form-input.error {
    border-color: #e53e3e;
    background: rgba(254, 242, 242, 0.9);
}

.form-input.error:focus {
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1);
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2d3748;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Checkbox personalizado */
.custom-checkbox {
    position: relative;
    display: inline-block;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #e2e8f0;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.custom-checkbox:checked {
    background: var(--primary-gradient);
    border-color: #667eea;
}

.custom-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 12px;
}

/* Animaciones de entrada */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    animation: fade-in-up 0.6s ease-out forwards;
}

.fade-in-down {
    opacity: 0;
    transform: translateY(-30px);
    animation: fade-in-down 0.6s ease-out forwards;
}

.fade-in {
    opacity: 0;
    animation: fade-in 0.8s ease-out forwards;
}

@keyframes fade-in-up {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fade-in-down {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fade-in {
    to {
        opacity: 1;
    }
}

/* Efectos de hover mejorados */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
}

/* Spinner personalizado */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Notificaciones */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    min-width: 300px;
    padding: 16px 20px;
    border-radius: 12px;
    font-weight: 500;
    box-shadow: var(--shadow-strong);
    backdrop-filter: blur(10px);
    animation: slide-in-right 0.3s ease-out;
}

.notification.success {
    background: rgba(72, 187, 120, 0.95);
    color: white;
    border-left: 4px solid #38a169;
}

.notification.error {
    background: rgba(245, 101, 101, 0.95);
    color: white;
    border-left: 4px solid #e53e3e;
}

.notification.info {
    background: rgba(66, 153, 225, 0.95);
    color: white;
    border-left: 4px solid #3182ce;
}

@keyframes slide-in-right {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Gradientes de fondo dinámicos */
.bg-gradient-dynamic {
    background: linear-gradient(-45deg, #667eea, #764ba2, #f093fb, #f5576c);
    background-size: 400% 400%;
    animation: gradient-animation 15s ease infinite;
}

@keyframes gradient-animation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Efectos de partículas de fondo */
.particles-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.1;
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
        opacity: 0.3;
    }
}

/* Estilos para móviles */
@media (max-width: 768px) {
    .container {
        padding-left: 16px;
        padding-right: 16px;
    }
    
    .card-enhanced {
        margin: 16px 0;
        border-radius: 16px;
    }
    
    .answer-btn {
        font-size: 18px;
        padding: 20px 16px;
        margin: 8px 0;
    }
    
    .notification {
        right: 16px;
        left: 16px;
        min-width: auto;
    }
    
    .form-input {
        font-size: 16px; /* Evita zoom en iOS */
    }
}

/* Modo oscuro (preparado para futuras mejoras) */
@media (prefers-color-scheme: dark) {
    .card-enhanced {
        background: rgba(45, 55, 72, 0.95);
        color: #f7fafc;
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .form-input {
        background: rgba(45, 55, 72, 0.9);
        color: #f7fafc;
        border-color: #4a5568;
    }
    
    .form-input:focus {
        background: rgba(45, 55, 72, 1);
        border-color: #667eea;
    }
}

/* Accesibilidad mejorada */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus visible para navegación con teclado */
.focus-visible:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Estilos para el estado de carga */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: var(--shadow-strong);
    max-width: 300px;
}

/* Animaciones de confeti */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    overflow: hidden;
}

.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #ff6b6b;
    animation: confetti-fall 3s linear forwards;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Mejoras de rendimiento */
.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}

/* Utilidades adicionales */
.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.backdrop-blur {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Estados específicos del quiz */
.question-container {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.answer-buttons-container {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.progress-text {
    font-weight: 600;
    color: #4a5568;
    font-size: 14px;
}

/* Transiciones suaves para cambios de estado */
.smooth-transition {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Efectos especiales para celebración */
.celebration-text {
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #feca57);
    background-size: 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: rainbow-text 3s ease-in-out infinite;
}

@keyframes rainbow-text {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Optimizaciones finales */
.optimize-rendering {
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    perspective: 1000;
}