/**
 * SVisual Custom Alerts - Sistema de alertas personalizado
 * Estilos exclusivos para modales y notificaciones
 */

/* ========================================
   OVERLAY Y CONTENEDOR BASE
   ======================================== */
.svisual-alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(26, 82, 89, 0.75);
    backdrop-filter: blur(3px);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: svisualFadeIn 0.3s ease forwards;
}

/* ========================================
   MODAL PRINCIPAL
   ======================================== */
.svisual-alert-modal {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    position: relative;
    z-index: 9999;
    overflow: hidden;
    transform: scale(0.7);
    opacity: 0;
    animation: svisualModalAppear 0.3s ease forwards;
}

/* Borde superior de color según tipo */
.svisual-alert-modal.success {
    border-top: 4px solid #28a745;
}

.svisual-alert-modal.error {
    border-top: 4px solid #dc3545;
}

.svisual-alert-modal.warning {
    border-top: 4px solid #ffc107;
}

.svisual-alert-modal.info {
    border-top: 4px solid #1a5259;
}

.svisual-alert-modal.question {
    border-top: 4px solid #17a2b8;
}

/* ========================================
   CONTENIDO DEL MODAL
   ======================================== */
.svisual-alert-header {
    padding: 30px 30px 20px 30px;
    text-align: center;
}

.svisual-alert-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px auto;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    animation: svisualIconBounce 0.5s ease;
}

.svisual-alert-modal.success .svisual-alert-icon {
    background-color: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.svisual-alert-modal.error .svisual-alert-icon {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.svisual-alert-modal.warning .svisual-alert-icon {
    background-color: rgba(255, 193, 7, 0.1);
    color: #ffc107;
}

.svisual-alert-modal.info .svisual-alert-icon {
    background-color: rgba(26, 82, 89, 0.1);
    color: #1a5259;
}

.svisual-alert-modal.question .svisual-alert-icon {
    background-color: rgba(23, 162, 184, 0.1);
    color: #17a2b8;
}

.svisual-alert-title {
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 10px 0;
}

.svisual-alert-body {
    padding: 0 30px 30px 30px;
    text-align: center;
}

.svisual-alert-text {
    font-size: 16px;
    color: #6c757d;
    line-height: 1.5;
    margin: 0;
}

/* ========================================
   BOTONES
   ======================================== */
.svisual-alert-footer {
    padding: 20px 30px 30px 30px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.svisual-alert-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.svisual-alert-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.svisual-alert-btn:active {
    transform: translateY(0);
}

.svisual-alert-btn-confirm {
    background-color: #1a5259;
    color: white;
}

.svisual-alert-btn-confirm:hover {
    background-color: #143f45;
}

.svisual-alert-btn-confirm.success {
    background-color: #28a745;
}

.svisual-alert-btn-confirm.success:hover {
    background-color: #218838;
}

.svisual-alert-btn-confirm.error {
    background-color: #dc3545;
}

.svisual-alert-btn-confirm.error:hover {
    background-color: #c82333;
}

.svisual-alert-btn-confirm.warning {
    background-color: #ffc107;
    color: #212529;
}

.svisual-alert-btn-confirm.warning:hover {
    background-color: #e0a800;
}

.svisual-alert-btn-cancel {
    background-color: #6c757d;
    color: white;
}

.svisual-alert-btn-cancel:hover {
    background-color: #5a6268;
}

/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */
.svisual-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}

.svisual-toast {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    transform: translateX(400px);
    opacity: 0;
    animation: svisualToastSlideIn 0.3s ease forwards;
    border-left: 4px solid #1a5259;
}

.svisual-toast.success {
    border-left-color: #28a745;
}

.svisual-toast.error {
    border-left-color: #dc3545;
}

.svisual-toast.warning {
    border-left-color: #ffc107;
}

.svisual-toast.info {
    border-left-color: #17a2b8;
}

.svisual-toast-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.svisual-toast.success .svisual-toast-icon {
    color: #28a745;
}

.svisual-toast.error .svisual-toast-icon {
    color: #dc3545;
}

.svisual-toast.warning .svisual-toast-icon {
    color: #ffc107;
}

.svisual-toast.info .svisual-toast-icon {
    color: #17a2b8;
}

.svisual-toast-content {
    flex: 1;
}

.svisual-toast-title {
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 4px 0;
    font-size: 15px;
}

.svisual-toast-message {
    color: #6c757d;
    margin: 0;
    font-size: 14px;
}

.svisual-toast-close {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    font-size: 20px;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.svisual-toast-close:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: #2c3e50;
}

/* ========================================
   CENTERED TOAST (Modal con barra de progreso)
   ======================================== */
.svisual-centered-toast-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: svisualFadeIn 0.2s ease forwards;
    pointer-events: none;
}

.svisual-centered-toast {
    background: white;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    min-width: 320px;
    max-width: 400px;
    width: 90%;
    position: relative;
    overflow: hidden;
    transform: scale(0.9);
    opacity: 0;
    animation: svisualCenteredToastAppear 0.3s ease forwards;
    pointer-events: auto;
}

.svisual-centered-toast-content {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.svisual-centered-toast-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.svisual-centered-toast.success .svisual-centered-toast-icon {
    background-color: #28a745;
    color: white;
}

.svisual-centered-toast.error .svisual-centered-toast-icon {
    background-color: #dc3545;
    color: white;
}

.svisual-centered-toast.warning .svisual-centered-toast-icon {
    background-color: #ffc107;
    color: #212529;
}

.svisual-centered-toast.info .svisual-centered-toast-icon {
    background-color: #1a5259;
    color: white;
}

.svisual-centered-toast-text {
    flex: 1;
}

.svisual-centered-toast-title {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 4px 0;
}

.svisual-centered-toast-message {
    font-size: 14px;
    color: #6c757d;
    margin: 0;
    line-height: 1.4;
}

.svisual-centered-toast-progress {
    height: 3px;
    background-color: rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.svisual-centered-toast-progress-bar {
    height: 100%;
    width: 100%;
    transform-origin: left;
    animation: svisualProgressBar linear forwards;
}

.svisual-centered-toast.success .svisual-centered-toast-progress-bar {
    background-color: #28a745;
}

.svisual-centered-toast.error .svisual-centered-toast-progress-bar {
    background-color: #dc3545;
}

.svisual-centered-toast.warning .svisual-centered-toast-progress-bar {
    background-color: #ffc107;
}

.svisual-centered-toast.info .svisual-centered-toast-progress-bar {
    background-color: #1a5259;
}

/* ========================================
   ANIMACIONES
   ======================================== */
@keyframes svisualFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes svisualModalAppear {
    from {
        transform: scale(0.7);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes svisualIconBounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

@keyframes svisualToastSlideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes svisualToastSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.svisual-toast.hiding {
    animation: svisualToastSlideOut 0.3s ease forwards;
}

/* ========================================
   LOADING SPINNER
   ======================================== */
.svisual-alert-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.svisual-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(26, 82, 89, 0.2);
    border-top-color: #1a5259;
    border-radius: 50%;
    animation: svisualSpin 0.8s linear infinite;
}

@keyframes svisualSpin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes svisualProgressBar {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}

@keyframes svisualCenteredToastAppear {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 576px) {
    .svisual-alert-modal {
        width: 95%;
        max-width: none;
    }

    .svisual-alert-header,
    .svisual-alert-body,
    .svisual-alert-footer {
        padding: 20px;
    }

    .svisual-alert-icon {
        width: 60px;
        height: 60px;
        font-size: 30px;
    }

    .svisual-alert-title {
        font-size: 20px;
    }

    .svisual-alert-text {
        font-size: 14px;
    }

    .svisual-alert-footer {
        flex-direction: column;
    }

    .svisual-alert-btn {
        width: 100%;
    }

    .svisual-toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .svisual-toast {
        min-width: auto;
    }

    .svisual-centered-toast {
        width: 95%;
        min-width: auto;
    }

    .svisual-centered-toast-content {
        padding: 20px;
    }

    .svisual-centered-toast-icon {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }

    .svisual-centered-toast-title {
        font-size: 18px;
    }

    .svisual-centered-toast-message {
        font-size: 14px;
    }
}