/**
 * Estilos para el Toast de Conectividad
 * Notificación no invasiva en la esquina superior izquierda
 */

.connectivity-toast {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 9999;
    display: none;
    min-width: 320px;
    max-width: 400px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.connectivity-toast.toast-show {
    opacity: 1;
    transform: translateX(0);
}

.toast-content {
    display: flex;
    align-items: flex-start;
    padding: 16px;
    gap: 12px;
}

.toast-icon {
    font-size: 24px;
    line-height: 1;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    min-width: 0;
}

.toast-message strong {
    display: block;
    color: #dc2626;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.toast-message p {
    color: #64748b;
    font-size: 13px;
    margin: 0;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 24px;
    line-height: 1;
    padding: 0;
    width: 24px;
    height: 24px;
    cursor: pointer;
    flex-shrink: 0;
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-close:hover {
    background-color: #f1f5f9;
    color: #475569;
}

.toast-close:active {
    background-color: #e2e8f0;
}

/* Borde izquierdo de advertencia */
.connectivity-toast::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 100%);
    border-radius: 8px 0 0 8px;
}

/* Animación de pulsación sutil para llamar la atención */
@keyframes pulse-subtle {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    }
    50% {
        box-shadow: 0 4px 16px rgba(251, 191, 36, 0.3), 0 0 0 1px rgba(251, 191, 36, 0.2);
    }
}

.connectivity-toast.toast-show {
    animation: pulse-subtle 2s ease-in-out 2;
}

/* Responsive: ajustar en pantallas pequeñas */
@media (max-width: 480px) {
    .connectivity-toast {
        left: 10px;
        right: 10px;
        top: 10px;
        min-width: unset;
        max-width: unset;
    }

    .toast-content {
        padding: 12px;
    }

    .toast-message strong {
        font-size: 13px;
    }

    .toast-message p {
        font-size: 12px;
    }
}

/* Asegurar que no interfiera con modales u otros elementos */
.connectivity-toast {
    pointer-events: auto;
}

/* Dark mode (opcional, si tu aplicación lo soporta) */
@media (prefers-color-scheme: dark) {
    .connectivity-toast {
        background: #1e293b;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
    }

    .toast-message strong {
        color: #fca5a5;
    }

    .toast-message p {
        color: #cbd5e1;
    }

    .toast-close {
        color: #64748b;
    }

    .toast-close:hover {
        background-color: #334155;
        color: #cbd5e1;
    }

    .toast-close:active {
        background-color: #475569;
    }
}
