/* ========== ESTILOS PARA MODALES DE CONFIRMACIÓN ========== */

/* Modal de confirmación de pago exitoso */
#paymentSuccessModal .modal-content,
#receiptConfirmModal .modal-content,
#customAlertDialog .modal-content {
    border: none;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.35);
    animation: modalZoomIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

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

/* Header del modal de confirmación */
#paymentSuccessModal .modal-header,
#receiptConfirmModal .modal-header,
#customAlertDialog .modal-header {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 40px 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Header para modales de error */
#customAlertDialog.error-modal .modal-header {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

/* Animación de fondo en el header */
#paymentSuccessModal .modal-header::before,
#receiptConfirmModal .modal-header::before,
#customAlertDialog .modal-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
    animation: rotate360 20s linear infinite;
}

@keyframes rotate360 {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Título del modal de confirmación */
#paymentSuccessModal .modal-title,
#receiptConfirmModal .modal-title,
#customAlertDialog .modal-title {
    font-size: 1.8rem;
    font-weight: 700;
    width: 100%;
    text-align: center;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    line-height: 1.3;
}

#paymentSuccessModal .modal-title i,
#receiptConfirmModal .modal-title i,
#customAlertDialog .modal-title i {
    font-size: 5rem;
    display: block;
    animation: iconBounce 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.3));
}

@keyframes iconBounce {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.3) rotate(20deg);
    }
    70% {
        transform: scale(0.9) rotate(-10deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* Body del modal de confirmación */
#paymentSuccessModal .modal-body,
#receiptConfirmModal .modal-body,
#customAlertDialog .modal-body {
    padding: 40px 35px;
    text-align: center;
    background: linear-gradient(to bottom, #ffffff 0%, #f8f9fa 100%);
}

#paymentSuccessModal .modal-body p,
#receiptConfirmModal .modal-body p,
#customAlertDialog .modal-body p {
    font-size: 1.15rem;
    color: #374151;
    line-height: 1.7;
    margin-bottom: 15px;
}

/* Información de referencia destacada */
#paymentSuccessModal .modal-body p[style*="background"],
#receiptConfirmModal .modal-body p[style*="background"] {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%) !important;
    border: 2px solid #10b981 !important;
    border-radius: 12px !important;
    padding: 20px !important;
    margin-top: 25px !important;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
    animation: slideUp 0.5s ease 0.3s both;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#paymentSuccessModal .modal-body p strong,
#receiptConfirmModal .modal-body p strong,
#customAlertDialog .modal-body p strong {
    color: #059669;
    font-size: 1.1rem;
}

/* Footer del modal de confirmación */
#paymentSuccessModal .modal-footer,
#receiptConfirmModal .modal-footer,
#customAlertDialog .modal-footer {
    padding: 25px 35px;
    border: none;
    background: #ffffff;
    justify-content: center;
}

/* Botón de aceptar mejorado */
#paymentSuccessModal .modal-footer .btn,
#receiptConfirmModal .modal-footer .btn,
#customAlertDialog .modal-footer .btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 15px 50px;
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#customAlertDialog .modal-footer .btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

#paymentSuccessModal .modal-footer .btn::before,
#receiptConfirmModal .modal-footer .btn::before,
#customAlertDialog .modal-footer .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

#paymentSuccessModal .modal-footer .btn:hover::before,
#receiptConfirmModal .modal-footer .btn:hover::before,
#customAlertDialog .modal-footer .btn:hover::before {
    left: 100%;
}

#paymentSuccessModal .modal-footer .btn:hover,
#receiptConfirmModal .modal-footer .btn:hover,
#customAlertDialog .modal-footer .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.5);
}

#customAlertDialog .modal-footer .btn-danger:hover {
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.5);
}

#paymentSuccessModal .modal-footer .btn:active,
#receiptConfirmModal .modal-footer .btn:active,
#customAlertDialog .modal-footer .btn:active {
    transform: translateY(-1px);
}

#paymentSuccessModal .modal-footer .btn i,
#receiptConfirmModal .modal-footer .btn i,
#customAlertDialog .modal-footer .btn i {
    margin-right: 10px;
    font-size: 1.3rem;
}

/* Modal de confirmación de comprobante con imagen */
#receiptConfirmModal .modal-body img {
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    margin-bottom: 25px;
    border: 3px solid #e5e7eb;
    transition: transform 0.3s ease;
}

#receiptConfirmModal .modal-body img:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

/* Información adicional en el modal de comprobante */
#receiptConfirmModal .modal-body div[style*="background"] {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%) !important;
    border-left: 4px solid #0ea5e9 !important;
    border-radius: 8px !important;
    padding: 20px !important;
    margin-top: 25px !important;
    text-align: left;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.1);
}

#receiptConfirmModal .modal-body div[style*="background"] p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.6;
}

#receiptConfirmModal .modal-body div[style*="background"] i {
    color: #0ea5e9;
    margin-right: 8px;
}

#receiptConfirmModal .modal-body div[style*="background"] strong {
    color: #0369a1;
}

/* Botones del modal de comprobante */
#receiptConfirmModal .modal-footer {
    display: flex;
    gap: 15px;
    justify-content: center;
}

#receiptConfirmModal .modal-footer .btn-secondary {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
    border: none;
    padding: 15px 35px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3);
    transition: all 0.3s ease;
}

#receiptConfirmModal .modal-footer .btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(107, 114, 128, 0.4);
}

#receiptConfirmModal .modal-footer .btn-primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    padding: 15px 40px;
}

/* Responsive para modales de confirmación */
@media (max-width: 768px) {
    #paymentSuccessModal .modal-title,
    #receiptConfirmModal .modal-title,
    #customAlertDialog .modal-title {
        font-size: 1.5rem;
    }
    
    #paymentSuccessModal .modal-title i,
    #receiptConfirmModal .modal-title i,
    #customAlertDialog .modal-title i {
        font-size: 4rem;
    }
    
    #paymentSuccessModal .modal-body,
    #receiptConfirmModal .modal-body,
    #customAlertDialog .modal-body {
        padding: 30px 25px;
    }
    
    #paymentSuccessModal .modal-body p,
    #receiptConfirmModal .modal-body p,
    #customAlertDialog .modal-body p {
        font-size: 1.05rem;
    }
    
    #paymentSuccessModal .modal-footer .btn,
    #receiptConfirmModal .modal-footer .btn,
    #customAlertDialog .modal-footer .btn {
        padding: 14px 40px;
        font-size: 1.1rem;
        width: 100%;
    }
    
    #receiptConfirmModal .modal-footer {
        flex-direction: column;
    }
    
    #receiptConfirmModal .modal-footer .btn-secondary,
    #receiptConfirmModal .modal-footer .btn-primary {
        width: 100%;
    }
}

@media (max-width: 480px) {
    #paymentSuccessModal .modal-header,
    #receiptConfirmModal .modal-header,
    #customAlertDialog .modal-header {
        padding: 30px 20px;
    }
    
    #paymentSuccessModal .modal-title,
    #receiptConfirmModal .modal-title,
    #customAlertDialog .modal-title {
        font-size: 1.3rem;
        gap: 15px;
    }
    
    #paymentSuccessModal .modal-title i,
    #receiptConfirmModal .modal-title i,
    #customAlertDialog .modal-title i {
        font-size: 3.5rem;
    }
    
    #paymentSuccessModal .modal-body,
    #receiptConfirmModal .modal-body,
    #customAlertDialog .modal-body {
        padding: 25px 20px;
    }
    
    #paymentSuccessModal .modal-footer,
    #receiptConfirmModal .modal-footer,
    #customAlertDialog .modal-footer {
        padding: 20px;
    }
}

/* Animación de entrada del backdrop */
.modal.fade .modal-dialog {
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.modal.show .modal-dialog {
    transform: none;
}

/* Mejora del backdrop */
.modal-backdrop.show {
    opacity: 0.7;
    backdrop-filter: blur(5px);
}
