/**
 * Trivia Master - Custom Styles
 * Estilos personalizados para el juego de trivia
 */

/* ========== BOTONES DE CATEGORÍA ========== */
.category-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background-color: rgba(51, 65, 85, 0.3);
    border: 1px solid rgba(71, 85, 105, 0.5);
    border-radius: 0.75rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.category-btn:hover {
    background-color: rgba(51, 65, 85, 0.5);
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
}

.category-btn.active {
    background: linear-gradient(to bottom right, rgba(99, 102, 241, 0.3), rgba(236, 72, 153, 0.3));
    border-color: #6366f1;
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.2);
}

.category-btn i {
    color: #6366f1;
    transition: color 0.3s ease;
}

.category-btn.active i {
    color: #ec4899;
}

.category-btn span {
    font-size: 0.875rem;
    font-weight: 500;
    margin-top: 0.25rem;
}

/* ========== BOTONES DE DIFICULTAD ========== */
.difficulty-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    background-color: rgba(51, 65, 85, 0.3);
    border: 1px solid rgba(71, 85, 105, 0.5);
    border-radius: 0.75rem;
    transition: all 0.3s ease;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
}

.difficulty-btn:hover {
    background-color: rgba(51, 65, 85, 0.5);
    border-color: rgba(99, 102, 241, 0.5);
}

.difficulty-btn.active {
    background: linear-gradient(to right, #6366f1, #ec4899);
    color: white;
    border-color: transparent;
}

.difficulty-btn[data-difficulty="facil"].active {
    background: linear-gradient(to right, #10b981, #34d399);
}

.difficulty-btn[data-difficulty="dificil"].active {
    background: linear-gradient(to right, #ef4444, #f97316);
}

/* ========== BOTONES DE OPCIÓN ========== */
.option-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background-color: rgba(51, 65, 85, 0.4);
    border: 2px solid rgba(71, 85, 105, 0.5);
    border-radius: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: left;
    min-height: 80px;
}

.option-btn:hover:not(:disabled) {
    border-color: rgba(99, 102, 241, 0.7);
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.1);
    transform: translateX(5px);
}

.option-btn:disabled {
    cursor: not-allowed;
}

.option-btn .option-letter {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(71, 85, 105, 0.5);
    border-radius: 0.75rem;
    font-weight: 700;
    font-size: 1.125rem;
    transition: all 0.3s ease;
}

.option-btn:hover:not(:disabled) .option-letter {
    background-color: #6366f1;
    color: white;
}

.option-btn .option-text {
    flex: 1;
    font-weight: 500;
}

/* Estado: Correcto */
.option-btn.correct {
    background-color: rgba(16, 185, 129, 0.2);
    border-color: #10b981;
    animation: pulse-correct 0.5s ease-out;
}

.option-btn.correct .option-letter {
    background-color: #10b981;
    color: white;
}

@keyframes pulse-correct {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* Estado: Incorrecto */
.option-btn.incorrect {
    background-color: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    animation: shake 0.5s ease-out;
}

.option-btn.incorrect .option-letter {
    background-color: #ef4444;
    color: white;
}

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

/* ========== ANIMACIONES DE CARGA ========== */
.loading-dot {
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* ========== TEMPORIZADOR ========== */
#timer-circle {
    transition: stroke-dashoffset 1s linear, stroke 0.3s ease;
}

#timer-text {
    transition: color 0.3s ease;
}

/* ========== PANTALLA DE RESULTADOS ========== */
#result-emoji {
    animation: bounce-in 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

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

#final-score {
    animation: count-up 1s ease-out;
}

@keyframes count-up {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== EFECTOS HOVER GLOBALES ========== */
button {
    outline: none;
}

button:focus-visible {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

/* ========== SCROLLBAR PERSONALIZADO ========== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #1e293b;
}

::-webkit-scrollbar-thumb {
    background: #6366f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #818cf8;
}

/* ========== SELECCIÓN DE TEXTO ========== */
::selection {
    background: rgba(99, 102, 241, 0.3);
    color: white;
}

/* ========== RESPONSIVE AJUSTES ========== */
@media (max-width: 768px) {
    .option-btn {
        padding: 1rem;
        min-height: 70px;
    }
    
    .option-btn .option-letter {
        width: 2rem;
        height: 2rem;
        font-size: 1rem;
    }
    
    #question-text {
        font-size: 1.125rem;
    }
}

/* ========== ANIMACIONES DE TRANSICIÓN ========== */
.screen-transition-enter {
    opacity: 0;
    transform: translateY(20px);
}

.screen-transition-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 300ms, transform 300ms;
}

.screen-transition-exit {
    opacity: 1;
}

.screen-transition-exit-active {
    opacity: 0;
    transition: opacity 200ms;
}

/* ========== EFECTO DE BRILLO EN BOTONES ========== */
.glow-button {
    position: relative;
    overflow: hidden;
}

.glow-button::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;
}

.glow-button:hover::before {
    left: 100%;
}

/* ========== TOOLTIP ========== */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 1rem;
    background: #1e293b;
    color: white;
    font-size: 0.75rem;
    border-radius: 0.5rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
}

/* ========== EFECTO GLASSMORPHISM ========== */
.glass {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ========== PULSACIÓN DEL BOTÓN DE AUDIO ========== */
#play-audio-btn {
    transition: transform 0.2s, color 0.2s;
}

#play-audio-btn:hover {
    transform: scale(1.1);
}

#play-audio-btn:active {
    transform: scale(0.95);
}

/* ========== BADGE DE CATEGORÍA ========== */
#category-badge {
    animation: fade-in-right 0.5s ease-out;
}

@keyframes fade-in-right {
    0% {
        opacity: 0;
        transform: translateX(-10px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}
