/* ===================================
   LOGOUT SWEETALERT2 PERSONALIZADOS
   =================================== */

/* Icono de logout */
.logout-icon-wrapper {
    width: 80px;
    height: 80px;
    margin: 0 auto;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(238, 90, 36, 0.3);
    transition: all 0.3s ease;
}

.logout-icon-wrapper:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(238, 90, 36, 0.4);
}

.logout-icon-wrapper::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
            45deg,
            transparent 30%,
            rgba(255, 255, 255, 0.3) 50%,
            transparent 70%
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

.logout-icon {
    font-size: 2.5rem;
    color: white;
    z-index: 1;
    animation: logoutIconPulse 2s ease-in-out infinite;
}

@keyframes logoutIconPulse {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(5px);
    }
}

/* Loader de logout */
.logout-loader {
    position: relative;
}

.logout-loader .spinner-border {
    width: 3rem !important;
    height: 3rem !important;
    border-width: 0.3em !important;
}

/* Animación de éxito en logout */
.success-logout-animation {
    width: 100px;
    height: 100px;
    margin: 0 auto;
    position: relative;
}

.logout-success-icon {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0);
    opacity: 0;
    box-shadow: 0 5px 20px rgba(76, 175, 80, 0.3);
}

.logout-success-icon.animate {
    animation: successBounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

.logout-success-icon i {
    font-size: 3rem;
    color: white;
}

@keyframes successBounce {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Estilos generales para los modales personalizados */
.custom-swal-popup {
    border-radius: 15px !important;
    padding: 0 !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15) !important;
}

.custom-swal-title {
    font-size: 1.5rem !important;
    font-weight: 600 !important;
    color: #333 !important;
    padding: 1.5rem 1.5rem 0.5rem !important;
}

.custom-swal-content {
    padding: 1rem 1.5rem 1.5rem !important;
    font-size: 1rem !important;
}

/* IMPORTANTE: Contenedor de acciones personalizado para separar botones */
.custom-swal-actions {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 1.5rem !important; /* Aumentado el espacio entre botones */
    padding: 1.5rem !important;
    margin: 0 !important;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    background-color: #f8f9fa;
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;
}

/* Asegurar que los botones no se peguen */
.swal2-actions > button {
    margin: 0 0.5rem !important; /* Espacio adicional entre botones */
}

/* Botones personalizados */
.custom-swal-confirm,
.custom-swal-cancel {
    padding: 0.75rem 2rem !important;
    font-size: 0.9375rem !important;
    font-weight: 500 !important;
    border-radius: 0.5rem !important;
    transition: all 0.2s ease !important;
    white-space: nowrap !important;
    min-width: 150px !important;
    border: none !important;
    cursor: pointer !important;
    outline: none !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1) !important;
}

/* Botón de confirmación de logout */
.custom-swal-confirm.btn-danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%) !important;
    border: none !important;
    color: white !important;
    position: relative;
    overflow: hidden;
}

.custom-swal-confirm.btn-danger::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: left 0.3s ease;
}

.custom-swal-confirm.btn-danger:hover {
    background: linear-gradient(135deg, #ff5252 0%, #d84315 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(238, 90, 36, 0.3) !important;
}

.custom-swal-confirm.btn-danger:hover::before {
    left: 100%;
}

.custom-swal-confirm.btn-danger:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(238, 90, 36, 0.3) !important;
}

/* Botón de cancelar */
.custom-swal-cancel.btn-secondary {
    background: #6c757d !important;
    color: white !important;
    border: none !important;
    position: relative;
    overflow: hidden;
}

.custom-swal-cancel.btn-secondary:hover {
    background: #5a6268 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3) !important;
}

.custom-swal-cancel.btn-secondary:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(108, 117, 125, 0.3) !important;
}

/* Fix para el estado focus de los botones */
.custom-swal-confirm:focus,
.custom-swal-cancel:focus {
    outline: none !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25) !important;
}

/* Animación de error */
.error-shake {
    display: inline-block;
}

/* Estilos para los toasts */
.swal-toast {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    border-radius: 8px !important;
}

.swal-toast-icon {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.swal-toast-success {
    background-color: #d4edda !important;
    color: #155724 !important;
    border-left: 4px solid #4CAF50 !important;
}

.swal-toast-error {
    background-color: #f8d7da !important;
    color: #721c24 !important;
    border-left: 4px solid #f44336 !important;
}

.swal-toast-info {
    background-color: #d1ecf1 !important;
    color: #0c5460 !important;
    border-left: 4px solid #2196F3 !important;
}

.swal-toast-warning {
    background-color: #fff3cd !important;
    color: #856404 !important;
    border-left: 4px solid #ff9800 !important;
}

/* Progress bar personalizada */
.progress {
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    transition: width 0.3s ease;
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .custom-swal-popup {
        margin: 1rem !important;
        width: calc(100% - 2rem) !important;
    }

    .custom-swal-actions {
        flex-direction: column !important;
        gap: 0.75rem !important;
    }

    .custom-swal-confirm,
    .custom-swal-cancel {
        width: 100% !important;
        min-width: unset !important;
    }

    .logout-icon-wrapper {
        width: 60px;
        height: 60px;
    }

    .logout-icon {
        font-size: 2rem;
    }
}

/* Animaciones adicionales */
@keyframes fadeInScale {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.swal2-show {
    animation: fadeInScale 0.3s ease-out !important;
}

/* Fix para evitar el problema del botón gris */
.swal2-styled:focus {
    box-shadow: none !important;
}

.swal2-styled.swal2-cancel:focus {
    box-shadow: 0 0 0 3px rgba(108, 117, 125, 0.5) !important;
}

.swal2-styled.swal2-confirm:focus {
    box-shadow: 0 0 0 3px rgba(238, 90, 36, 0.5) !important;
}

/* Asegurar que los botones sean clickeables */
.swal2-actions button {
    pointer-events: auto !important;
    opacity: 1 !important;
}

/* Fix específico para el botón cancelar */
.swal2-cancel {
    background-color: #6c757d !important;
}

.swal2-cancel:not(:disabled):hover {
    background-color: #5a6268 !important;
}

/* Overlay personalizado */
.swal2-backdrop-show {
    background: rgba(0, 0, 0, 0.4) !important;
}

/* Timer progress bar */
.swal2-timer-progress-bar {
    background: linear-gradient(to right, #4CAF50, #45a049) !important;
}

/* Icon animations */
.bi-box-arrow-right {
    transition: transform 0.3s ease;
}

.custom-swal-confirm:hover .bi-box-arrow-right {
    transform: translateX(3px);
}

.bi-x-lg {
    transition: transform 0.3s ease;
}

.custom-swal-cancel:hover .bi-x-lg {
    transform: rotate(90deg);
}

/* Asegurar z-index apropiado */
.swal2-container {
    z-index: 9999 !important;
}