/**
 * Estilos estandarizados para SweetAlert2
 * Sistema consistente para popups y notificaciones
 */

/* ========================================
   CONFIGURACIÓN BÁSICA DE POPUPS
======================================== */
.swal2-popup {
    border-radius: 12px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
    padding: 1.5rem !important;
    min-height: auto !important;
    max-width: 450px !important;
    width: 400px !important;
}

.swal2-title {
    font-weight: 600 !important;
    color: #113F67 !important;
    font-size: 1.4rem !important;
    margin-bottom: 1rem !important;
    margin-top: 0.75rem !important;
}

.swal2-html-container {
    font-size: 1rem !important;
    line-height: 1.5 !important;
    color: #34699A !important;
    margin: 0.75rem 0 1.25rem 0 !important;
}

/* ========================================
   BOTONES ESTANDARIZADOS
======================================== */
.swal2-actions {
    margin-top: 1rem !important;
    gap: 0.5rem !important;
}

.swal2-confirm.btn,
.swal2-cancel.btn {
    padding: 0.5rem 1.25rem !important;
    font-weight: 500 !important;
    border-radius: 6px !important;
    transition: all 0.2s ease !important;
    font-size: 0.875rem !important;
    text-transform: none !important;
    min-width: 90px !important;
}

.swal2-confirm.btn:hover,
.swal2-cancel.btn:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

/* Botones específicos por tipo */
.swal2-confirm.btn-danger {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    color: white !important;
}

.swal2-confirm.btn-danger:hover {
    background-color: #c82333 !important;
    border-color: #bd2130 !important;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3) !important;
}

.swal2-confirm.btn-success {
    background-color: #28a745 !important;
    border-color: #28a745 !important;
    color: white !important;
}

.swal2-confirm.btn-success:hover {
    background-color: #218838 !important;
    border-color: #1e7e34 !important;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3) !important;
}

.swal2-confirm.btn-primary {
    background-color: #113F67 !important;
    border-color: #113F67 !important;
    color: white !important;
}

.swal2-confirm.btn-primary:hover {
    background-color: #0d2f4f !important;
    border-color: #0d2f4f !important;
    box-shadow: 0 4px 12px rgba(17, 63, 103, 0.3) !important;
}

.swal2-confirm.btn-warning {
    background-color: #ffc107 !important;
    border-color: #ffc107 !important;
    color: #212529 !important;
}

.swal2-confirm.btn-warning:hover {
    background-color: #e0a800 !important;
    border-color: #d39e00 !important;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3) !important;
}

.swal2-confirm.btn-info {
    background-color: #17a2b8 !important;
    border-color: #17a2b8 !important;
    color: white !important;
}

.swal2-confirm.btn-info:hover {
    background-color: #138496 !important;
    border-color: #117a8b !important;
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.3) !important;
}

.swal2-cancel.btn-secondary {
    background-color: #34699A !important;
    border-color: #34699A !important;
    color: white !important;
}

.swal2-cancel.btn-secondary:hover {
    background-color: #2a5580 !important;
    border-color: #2a5580 !important;
    box-shadow: 0 4px 12px rgba(52, 105, 154, 0.3) !important;
}

/* ========================================
   ICONOS UNIFORMES Y SIMPLES
======================================== */
.swal2-icon {
    margin: 0.75rem auto 1.25rem !important;
    width: 4rem !important;
    height: 4rem !important;
    border: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    font-size: 1.8rem !important;
    position: relative !important;
}

/* Icono de éxito - Check simple */
.swal2-icon.swal2-success {
    background-color: #28a745 !important;
    color: white !important;
}

.swal2-icon.swal2-success::before {
    content: '\f00c' !important; /* FontAwesome check */
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    font-size: 1.8rem !important;
}

/* Limpiar elementos innecesarios del check */
.swal2-icon.swal2-success .swal2-success-ring,
.swal2-icon.swal2-success .swal2-success-fix,
.swal2-icon.swal2-success [class^='swal2-success-line'],
.swal2-icon.swal2-success .swal2-success-circular-line-left,
.swal2-icon.swal2-success .swal2-success-circular-line-right {
    display: none !important;
}

/* Icono de error - X simple */
.swal2-icon.swal2-error {
    background-color: #dc3545 !important;
    color: white !important;
}

.swal2-icon.swal2-error::before {
    content: '\f00d' !important; /* FontAwesome times */
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    font-size: 1.8rem !important;
}

/* Limpiar elementos innecesarios del error */
.swal2-icon.swal2-error .swal2-x-mark {
    display: none !important;
}

/* Icono de advertencia */
.swal2-icon.swal2-warning {
    background-color: #ffc107 !important;
    color: #212529 !important;
}

.swal2-icon.swal2-warning::before {
    content: '\f071' !important; /* FontAwesome exclamation-triangle */
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    font-size: 1.8rem !important;
}

/* Icono de información */
.swal2-icon.swal2-info {
    background-color: #17a2b8 !important;
    color: white !important;
}

.swal2-icon.swal2-info::before {
    content: '\f05a' !important; /* FontAwesome info-circle */
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    font-size: 1.8rem !important;
}

/* Icono de pregunta */
.swal2-icon.swal2-question {
    background-color: #007bff !important;
    color: white !important;
}

.swal2-icon.swal2-question::before {
    content: '\f059' !important; /* FontAwesome question-circle */
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    font-size: 1.8rem !important;
}

/* ========================================
   LOADING Y SPINNER
======================================== */
.swal2-loader {
    border-color: #007bff transparent #007bff transparent !important;
}

/* ========================================
   TIMER Y PROGRESS BAR
======================================== */
.swal2-timer-progress-bar {
    background: rgba(0, 123, 255, 0.8) !important;
}

/* ========================================
   RESPONSIVE
======================================== */
@media (max-width: 768px) {
    .swal2-popup {
        width: 90% !important;
        padding: 1rem !important;
    }
    
    .swal2-title {
        font-size: 1.2rem !important;
    }
    
    .swal2-html-container {
        font-size: 0.9rem !important;
    }
    
    .swal2-confirm.btn,
    .swal2-cancel.btn {
        padding: 0.5rem 1rem !important;
        font-size: 0.85rem !important;
        min-width: 80px !important;
    }
}

/* ========================================
   ANIMACIONES PERSONALIZADAS
======================================== */
.swal2-show {
    animation: swal2-show 0.3s ease-out !important;
}

.swal2-hide {
    animation: swal2-hide 0.15s ease-in !important;
}

@keyframes swal2-show {
    0% {
        transform: scale(0.7) translateY(-20px);
        opacity: 0;
    }
    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

@keyframes swal2-hide {
    0% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
    100% {
        transform: scale(0.95) translateY(-10px);
        opacity: 0;
    }
}

/* ========================================
   CONTENIDO PERSONALIZADO
======================================== */
.swal2-html-container .badge {
    font-size: 0.8rem !important;
    padding: 0.4rem 0.8rem !important;
}

.swal2-html-container .text-muted {
    color: #6c757d !important;
}

.swal2-html-container h5 {
    color: #2c3e50 !important;
    font-weight: 600 !important;
    margin-bottom: 0.5rem !important;
}

/* ========================================
   BACKDROP
======================================== */
.swal2-backdrop-show {
    animation: swal2-backdrop-show 0.3s ease-out !important;
}

.swal2-backdrop-hide {
    animation: swal2-backdrop-hide 0.15s ease-in !important;
}

@keyframes swal2-backdrop-show {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 0.4;
    }
}

@keyframes swal2-backdrop-hide {
    0% {
        opacity: 0.4;
    }
    100% {
        opacity: 0;    }
}

/* ========================================
   RESPONSIVIDAD
======================================== */
@media (max-width: 768px) {
    .swal2-popup {
        margin: 0.5rem !important;
        width: calc(100% - 1rem) !important;
        max-width: none !important;
        padding: 1rem !important;
    }
    
    .swal2-icon {
        width: 3rem !important;
        height: 3rem !important;
        font-size: 1.4rem !important;
        margin: 0.25rem auto 0.75rem !important;
    }
    
    .swal2-icon-content svg {
        width: 1.5rem !important;
        height: 1.5rem !important;
    }
    
    .swal2-title {
        font-size: 1.1rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .swal2-header {
        padding: 0.75rem 0.75rem 0.25rem !important;
    }
    
    .swal2-content {
        padding: 0 0.75rem !important;
    }
    
    .swal2-actions {
        padding: 0.75rem !important;
        margin-top: 0.25rem !important;
    }
}

/* ========================================
   ICONOS PERSONALIZADOS SVG
======================================== */
.swal-custom-icon-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 0.5rem auto;
}

.swal-custom-icon-container svg {
    width: 64px !important;
    height: 64px !important;
    display: block;
}

/* Responsivo para móviles */
@media (max-width: 768px) {    .swal-custom-icon-container svg {
        width: 56px !important;
        height: 56px !important;
    }
}

/* Estilos para iconos SVG personalizados */
.swal2-icon-content {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
}

.swal2-icon-content svg {
    width: 2rem !important;
    height: 2rem !important;
    fill: white !important;
}

/* Contenedor compacto para popups */
.swal2-container {
    padding: 0.75rem !important;
}

.swal2-popup {
    margin: 0 auto !important;
    max-width: 32rem !important;
}

/* Reducir espacios adicionales */
.swal2-header {
    padding: 1rem 1rem 0.5rem !important;
}

.swal2-content {
    padding: 0 1rem !important;
}

.swal2-actions {
    padding: 1rem !important;
    margin-top: 0.5rem !important;
}

/* ========================================
   OCULTAR ELEMENTOS INNECESARIOS
======================================== */
.swal2-popup .swal2-close,
.swal2-popup .swal2-progress-steps,
.swal2-popup .swal2-icon,
.swal2-popup .swal2-image,
.swal2-popup .swal2-input,
.swal2-popup .swal2-file,
.swal2-popup .swal2-range,
.swal2-popup .swal2-select,
.swal2-popup .swal2-radio,
.swal2-popup .swal2-checkbox,
.swal2-popup .swal2-textarea,
.swal2-popup .swal2-validation-message,
.swal2-popup .swal2-footer,
.swal2-popup .swal2-timer-progress-bar-container {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Reducir espacios entre elementos */
.swal2-popup .swal2-title {
    margin-top: 0 !important;
    margin-bottom: 0.5rem !important;
    padding-top: 0 !important;
}

.swal2-popup .swal2-html-container {
    margin-top: 0 !important;
    margin-bottom: 0.5rem !important;
    padding: 0 !important;
}

.swal2-popup .swal2-actions {
    margin-top: 0.5rem !important;
    margin-bottom: 0 !important;
    padding: 0 !important;
}

/* Forzar que el popup se adapte al contenido */
.swal2-container {
    padding: 1rem !important;
}

.swal2-popup {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: stretch !important;
    gap: 0 !important;
}

/* Eliminar espacios por defecto de SweetAlert2 */
.swal2-popup > * {
    margin: 0 !important;
}

.swal2-popup .swal2-title + .swal2-html-container {
    margin-top: 0.5rem !important;
}

.swal2-popup .swal2-html-container + .swal2-actions {
    margin-top: 0.75rem !important;
}
