/* ============================================
   MODAL DE RESULTADOS - DISEÑO NEÓN PROFESIONAL
   ============================================ */

/* Overlay del modal con blur */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Contenedor del modal con glassmorphism */
.modal-content {
    background: linear-gradient(135deg, rgba(19, 19, 26, 0.95) 0%, rgba(26, 26, 36, 0.9) 100%);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    padding: 50px 40px;
    border-radius: 20px;
    border: 3px solid var(--neon-pink, #ff007f);
    text-align: center;
    max-width: 650px;
    width: 90%;
    box-shadow: 
        0 0 60px rgba(255, 0, 127, 0.6),
        0 0 100px rgba(255, 0, 127, 0.4),
        0 20px 60px rgba(0, 0, 0, 0.8),
        inset 0 0 80px rgba(255, 0, 127, 0.1);
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-100px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Efecto de brillo animado en el borde */
.modal-content::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: linear-gradient(
        45deg,
        var(--neon-pink),
        var(--neon-pink-bright, #ff0095),
        var(--neon-pink)
    );
    border-radius: 20px;
    z-index: -1;
    opacity: 0;
    animation: borderGlow 3s ease-in-out infinite;
}

@keyframes borderGlow {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

/* Título del modal */
.modal h2 {
    font-family: var(--font-display, 'Orbitron', sans-serif);
    color: var(--neon-pink, #ff007f);
    margin-bottom: 30px;
    font-size: 42px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow: 
        0 0 20px rgba(255, 0, 127, 0.8),
        0 0 40px rgba(255, 0, 127, 0.6),
        0 0 60px rgba(255, 0, 127, 0.4),
        0 4px 8px rgba(0, 0, 0, 0.5);
    animation: titlePulse 2s ease-in-out infinite;
}

@keyframes titlePulse {
    0%, 100% {
        text-shadow: 
            0 0 20px rgba(255, 0, 127, 0.8),
            0 0 40px rgba(255, 0, 127, 0.6),
            0 0 60px rgba(255, 0, 127, 0.4);
    }
    50% {
        text-shadow: 
            0 0 30px rgba(255, 0, 127, 1),
            0 0 60px rgba(255, 0, 127, 0.8),
            0 0 90px rgba(255, 0, 127, 0.6);
    }
}

.modal h3 {
    font-family: var(--font-display, 'Orbitron', sans-serif);
    color: var(--neon-pink, #ff007f);
    margin-bottom: 20px;
    font-size: 28px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 
        0 0 15px rgba(255, 0, 127, 0.6),
        0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Contenedor de estadísticas */
.results-summary {
    margin: 30px 0;
    padding: 30px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    border: 2px solid rgba(255, 0, 127, 0.3);
    box-shadow: 
        0 0 30px rgba(255, 0, 127, 0.2),
        inset 0 0 30px rgba(0, 0, 0, 0.5);
}

/* Líneas de estadísticas */
.stat-line {
    margin: 18px 0;
    font-size: 20px;
    font-weight: 600;
    font-family: var(--font-body, 'Rajdhani', sans-serif);
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    border-left: 4px solid var(--neon-pink, #ff007f);
    transition: all 0.3s ease;
}

.stat-line:hover {
    background: rgba(255, 255, 255, 0.05);
    border-left-color: var(--neon-pink-bright, #ff0095);
    transform: translateX(5px);
    box-shadow: 0 0 20px rgba(255, 0, 127, 0.2);
}

.stat-line:nth-child(1) {
    border-left-color: var(--neon-pink, #ff007f);
}

.stat-line:nth-child(2) {
    border-left-color: var(--neon-red, #ff0055);
}

.stat-line:nth-child(3) {
    border-left-color: var(--neon-blue, #00d4ff);
}

.stat-line:nth-child(4) {
    border-left-color: var(--neon-green, #00ff88);
}

.stat-line strong {
    font-family: var(--font-display, 'Orbitron', sans-serif);
    font-size: 24px;
    font-weight: 900;
    color: var(--neon-pink, #ff007f);
    text-shadow: 
        0 0 10px rgba(255, 0, 127, 0.6),
        0 2px 4px rgba(0, 0, 0, 0.5);
}

.stat-line:nth-child(2) strong {
    color: var(--neon-red, #ff0055);
    text-shadow: 
        0 0 10px rgba(255, 0, 85, 0.6),
        0 2px 4px rgba(0, 0, 0, 0.5);
}

.stat-line:nth-child(3) strong {
    color: var(--neon-blue, #00d4ff);
    text-shadow: 
        0 0 10px rgba(0, 212, 255, 0.6),
        0 2px 4px rgba(0, 0, 0, 0.5);
}

.stat-line:nth-child(4) strong {
    color: var(--neon-green, #00ff88);
    text-shadow: 
        0 0 10px rgba(0, 255, 136, 0.6),
        0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Botón para mostrar/ocultar detalles */
.details-toggle {
    width: 100%;
    margin: 30px 0 20px 0;
    padding: 18px 35px;
    font-size: 16px;
    font-weight: 700;
    font-family: var(--font-display, 'Orbitron', sans-serif);
    text-transform: uppercase;
    letter-spacing: 2px;
    border: 3px solid var(--neon-pink, #ff007f);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, rgba(255, 0, 127, 0.2), rgba(255, 0, 127, 0.1));
    color: var(--neon-pink, #ff007f);
    box-shadow: 
        0 0 30px rgba(255, 0, 127, 0.3),
        inset 0 0 20px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.details-toggle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.details-toggle:hover::before {
    width: 400px;
    height: 400px;
}

.details-toggle:hover {
    background: linear-gradient(135deg, rgba(255, 0, 127, 0.3), rgba(255, 0, 127, 0.15));
    border-color: var(--neon-pink-bright, #ff0095);
    transform: translateY(-3px);
    box-shadow: 
        0 0 50px rgba(255, 0, 127, 0.5),
        0 0 80px rgba(255, 0, 127, 0.3),
        inset 0 0 20px rgba(0, 0, 0, 0.2);
}

.details-toggle:active {
    transform: translateY(-1px);
}

/* Lista de respuestas */
.answers-list {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 20px;
}

.answers-list.show {
    max-height: 700px;
    overflow-y: auto;
}

/* Scrollbar personalizado */
.answers-list::-webkit-scrollbar {
    width: 10px;
}

.answers-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

.answers-list::-webkit-scrollbar-thumb {
    background: var(--neon-pink, #ff007f);
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(255, 0, 127, 0.5);
}

.answers-list::-webkit-scrollbar-thumb:hover {
    background: var(--neon-pink-bright, #ff0095);
}

/* Items de respuestas */
.answer-item {
    padding: 18px 20px;
    margin: 12px 0;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
    border-left: 5px solid rgba(255, 255, 255, 0.2);
    text-align: left;
    font-family: var(--font-body, 'Rajdhani', sans-serif);
    font-size: 16px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.answer-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 5px;
    height: 100%;
    background: currentColor;
    filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.answer-item:hover::before {
    opacity: 0.6;
}

.answer-item:hover {
    transform: translateX(8px);
    background: rgba(0, 0, 0, 0.5);
}

/* Item correcto */
.answer-item.correct {
    border-left-color: var(--neon-green, #00ff88);
    background: linear-gradient(90deg, rgba(0, 255, 136, 0.15), rgba(0, 0, 0, 0.4));
    color: var(--neon-green);
}

.answer-item.correct:hover {
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}

/* Item incorrecto */
.answer-item.incorrect {
    border-left-color: var(--neon-red, #ff0055);
    background: linear-gradient(90deg, rgba(255, 0, 85, 0.15), rgba(0, 0, 0, 0.4));
    color: var(--neon-red);
}

.answer-item.incorrect:hover {
    box-shadow: 0 0 20px rgba(255, 0, 85, 0.3);
}

/* Item sin responder */
.answer-item.unanswered {
    border-left-color: var(--neon-pink, #ff007f);
    background: linear-gradient(90deg, rgba(255, 0, 127, 0.15), rgba(0, 0, 0, 0.4));
    color: var(--neon-pink);
}

.answer-item.unanswered:hover {
    box-shadow: 0 0 20px rgba(255, 0, 127, 0.3);
}

.answer-item strong {
    font-weight: 700;
    font-size: 18px;
    font-family: var(--font-display, 'Orbitron', sans-serif);
}

/* Respuesta correcta mostrada */
.correct-answer {
    display: block;
    margin-top: 8px;
    font-weight: 600;
    font-style: italic;
    font-size: 15px;
    color: inherit;
    opacity: 0.9;
}

/* Botón de jugar de nuevo */
.modal-content > .btn {
    margin-top: 30px;
    padding: 18px 50px;
    font-size: 18px;
    font-weight: 700;
    font-family: var(--font-display, 'Orbitron', sans-serif);
    text-transform: uppercase;
    letter-spacing: 2px;
    border: 3px solid var(--neon-green, #00ff88);
    border-radius: 12px;
    cursor: pointer;
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.2), rgba(0, 255, 136, 0.1));
    color: var(--neon-green, #00ff88);
    box-shadow: 
        0 0 30px rgba(0, 255, 136, 0.3),
        inset 0 0 20px rgba(0, 0, 0, 0.3);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.modal-content > .btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.modal-content > .btn:hover::before {
    width: 400px;
    height: 400px;
}

.modal-content > .btn:hover {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.3), rgba(0, 255, 136, 0.15));
    border-color: var(--neon-green, #00ff88);
    transform: translateY(-3px);
    box-shadow: 
        0 0 50px rgba(0, 255, 136, 0.5),
        0 0 80px rgba(0, 255, 136, 0.3),
        inset 0 0 20px rgba(0, 0, 0, 0.2);
}

.modal-content > .btn:active {
    transform: translateY(-1px);
}

/* ============================================
   RESPONSIVE - MODAL
   ============================================ */

@media (max-width: 768px) {
    .modal-content {
        padding: 40px 30px;
        max-width: 95%;
    }
    
    .modal h2 {
        font-size: 32px;
        margin-bottom: 25px;
    }
    
    .modal h3 {
        font-size: 24px;
    }
    
    .results-summary {
        padding: 25px 20px;
    }
    
    .stat-line {
        font-size: 18px;
        padding: 10px 15px;
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }
    
    .stat-line strong {
        font-size: 22px;
    }
    
    .details-toggle {
        padding: 16px 30px;
        font-size: 14px;
    }
    
    .answers-list.show {
        max-height: 500px;
    }
    
    .answer-item {
        padding: 15px 16px;
        font-size: 15px;
    }
    
    .modal-content > .btn {
        padding: 16px 40px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .modal-content {
        padding: 30px 20px;
    }
    
    .modal h2 {
        font-size: 26px;
        letter-spacing: 2px;
    }
    
    .modal h3 {
        font-size: 20px;
    }
    
    .results-summary {
        padding: 20px 15px;
    }
    
    .stat-line {
        font-size: 16px;
        padding: 8px 12px;
    }
    
    .stat-line strong {
        font-size: 20px;
    }
    
    .details-toggle {
        padding: 14px 25px;
        font-size: 13px;
        letter-spacing: 1.5px;
    }
    
    .answer-item {
        padding: 12px 14px;
        font-size: 14px;
    }
    
    .answer-item strong {
        font-size: 16px;
    }
    
    .correct-answer {
        font-size: 14px;
    }
    
    .modal-content > .btn {
        padding: 14px 35px;
        font-size: 15px;
    }
}
