/* ==============================================
   SISTEMA UNIFICADO DE NOTIFICACIONES HELPPETS
   ============================================== */

/* Contenedor de notificaciones - posicionado estratégicamente */
.helppets-notifications-container {
    position: fixed;
    top: 85px; /* Debajo del header (70px) + margen */
    right: 20px;
    z-index: 999999 !important; /* Por encima de todo: modales, headers, etc. */
    pointer-events: none; /* No interfiere con clics en la página */
    max-width: 400px;
    width: calc(100% - 40px);
}

/* Notificación individual */
.helppets-notification {
    background: white;
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
    margin-bottom: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: auto; /* La notificación sí es clickeable */
    transform: translateX(450px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border-left: 4px solid #ccc;
    font-family: 'Poppins', 'Inter', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
    overflow: hidden;
}

/* Animación de entrada */
.helppets-notification.show {
    transform: translateX(0);
    opacity: 1;
}

/* Animación de salida */
.helppets-notification.hide {
    transform: translateX(450px);
    opacity: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    max-height: 0;
}

/* Tipos de notificación - Colores */
.helppets-notification.success {
    border-left-color: #10b981;
    background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
}

.helppets-notification.error,
.helppets-notification.danger {
    border-left-color: #ef4444;
    background: linear-gradient(135deg, #ffffff 0%, #fef2f2 100%);
}

.helppets-notification.warning {
    border-left-color: #f59e0b;
    background: linear-gradient(135deg, #ffffff 0%, #fffbeb 100%);
}

.helppets-notification.info {
    border-left-color: #3b82f6;
    background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%);
}

/* Icono de la notificación */
.helppets-notification-icon {
    flex-shrink: 0;
    font-size: 20px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.helppets-notification.success .helppets-notification-icon {
    background: #10b981;
    color: white;
}

.helppets-notification.error .helppets-notification-icon,
.helppets-notification.danger .helppets-notification-icon {
    background: #ef4444;
    color: white;
}

.helppets-notification.warning .helppets-notification-icon {
    background: #f59e0b;
    color: white;
}

.helppets-notification.info .helppets-notification-icon {
    background: #3b82f6;
    color: white;
}

/* Contenido del mensaje */
.helppets-notification-content {
    flex: 1;
    color: #1f2937;
    font-weight: 500;
}

/* Botón de cerrar */
.helppets-notification-close {
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #6b7280;
    font-size: 18px;
    font-weight: 600;
    transition: all 0.2s ease;
    padding: 0;
    line-height: 1;
}

.helppets-notification-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #1f2937;
    transform: scale(1.1);
}

/* Barra de progreso (auto-cierre) */
.helppets-notification-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: currentColor;
    opacity: 0.3;
    transition: width linear;
}

.helppets-notification.success .helppets-notification-progress {
    color: #10b981;
}

.helppets-notification.error .helppets-notification-progress,
.helppets-notification.danger .helppets-notification-progress {
    color: #ef4444;
}

.helppets-notification.warning .helppets-notification-progress {
    color: #f59e0b;
}

.helppets-notification.info .helppets-notification-progress {
    color: #3b82f6;
}

/* ============================================
   RESPONSIVE - MÓVIL
   ============================================ */

@media (max-width: 768px) {
    .helppets-notifications-container {
        top: 75px; /* Más cerca del header en móvil */
        right: 12px;
        left: 12px;
        width: auto;
        max-width: none;
    }

    .helppets-notification {
        padding: 14px 16px;
        font-size: 13px;
        border-radius: 10px;
        margin-bottom: 10px;
    }

    .helppets-notification-icon {
        font-size: 18px;
        width: 24px;
        height: 24px;
    }

    .helppets-notification-close {
        width: 24px;
        height: 24px;
        font-size: 16px;
    }
}

/* ============================================
   COMPATIBILIDAD CON SISTEMAS ANTIGUOS
   ============================================ */

/* Toast de mapa.css */
.toast {
    position: fixed;
    top: 85px !important;
    right: 20px !important;
    left: auto !important;
    bottom: auto !important;
    z-index: 999999 !important;
    padding: 16px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
    transform: translateX(450px);
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    max-width: 400px;
    font-size: 14px;
}

.toast.show {
    transform: translateX(0);
}

.toast-success {
    border-left: 4px solid #10b981;
    background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
}

.toast-error,
.toast-danger {
    border-left: 4px solid #ef4444;
    background: linear-gradient(135deg, #ffffff 0%, #fef2f2 100%);
}

.toast-info {
    border-left: 4px solid #3b82f6;
    background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%);
}

.toast-warning {
    border-left: 4px solid #f59e0b;
    background: linear-gradient(135deg, #ffffff 0%, #fffbeb 100%);
}

/* Mensaje de helppets-unified.js */
.helppets-message {
    position: fixed;
    top: 85px !important;
    right: 20px !important;
    z-index: 999999 !important;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
    font-family: 'Poppins', 'Inter', sans-serif;
    font-size: 14px;
    max-width: 400px;
    animation: slideInRight 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.helppets-message-success {
    background: white;
    border-left: 4px solid #10b981;
    background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
    color: #1f2937;
}

.helppets-message-error,
.helppets-message-danger {
    background: white;
    border-left: 4px solid #ef4444;
    background: linear-gradient(135deg, #ffffff 0%, #fef2f2 100%);
    color: #1f2937;
}

.helppets-message-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.helppets-message-content i {
    font-size: 20px;
}

.helppets-message-success .helppets-message-content i {
    color: #10b981;
}

.helppets-message-error .helppets-message-content i,
.helppets-message-danger .helppets-message-content i {
    color: #ef4444;
}

.helppets-message-close {
    background: rgba(0, 0, 0, 0.05);
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-size: 18px;
    margin-left: auto;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.helppets-message-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #1f2937;
}

@keyframes slideInRight {
    from {
        transform: translateX(450px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Toast container de noticias.css */
.toast-container {
    position: fixed;
    top: 85px !important;
    right: 20px;
    z-index: 999999 !important;
    max-width: 400px;
}

/* Notificaciones de mapa (showNotification) */
#map-notifications {
    position: fixed;
    top: 85px !important;
    right: 20px;
    z-index: 999999 !important;
    max-width: 400px;
}

.map-notification {
    background: white;
    border-left: 4px solid;
    padding: 16px 20px;
    margin-bottom: 12px;
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
    animation: slideInRight 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    color: #1f2937;
    font-size: 14px;
    line-height: 1.5;
}

.map-notification-success {
    border-left-color: #10b981;
    background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
}

.map-notification-error {
    border-left-color: #ef4444;
    background: linear-gradient(135deg, #ffffff 0%, #fef2f2 100%);
}

.map-notification-info {
    border-left-color: #3b82f6;
    background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%);
}

/* ============================================
   RESPONSIVE MÓVIL PARA COMPATIBILIDAD
   ============================================ */

@media (max-width: 768px) {
    .toast,
    .helppets-message,
    .toast-container,
    #map-notifications {
        top: 75px !important;
        right: 12px !important;
        left: 12px !important;
        max-width: none !important;
        width: auto !important;
    }

    .helppets-message,
    .toast,
    .map-notification {
        font-size: 13px;
        padding: 14px 16px;
    }
}

/* ============================================
   MODALES - ASEGURAR QUE NOTIFICACIONES
   ESTÉN POR ENCIMA
   ============================================ */

/* Las notificaciones siempre están por encima de modales */
.modal-overlay {
    z-index: 99999 !important; /* Modales en 99999 */
}

.helppets-notifications-container,
.toast,
.helppets-message,
#map-notifications {
    z-index: 999999 !important; /* Notificaciones en 999999 (por encima) */
}
