/* ===================================================
   SISTEMA DE NOTIFICACIONES (Topbar Action Buttons & Panel)
   =================================================== */
.notification-fab {
    position: relative !important;
    bottom: auto !important;
    left: auto !important;
    width: 38px !important;
    height: 38px !important;
    min-width: 38px;
    min-height: 38px;
    border-radius: 50%;
    /* Un gradiente cyan vibrante que contrasta perfecto */
    background: linear-gradient(135deg, #00c6ff 0%, #0072ff 100%); 
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(0, 114, 255, 0.35);
    cursor: pointer;
    z-index: 101;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.notification-fab.has-notifications {
    /* Animación de resplandor (glow pulse) continuo cuando hay notificaciones */
    animation: glow-pulse 2s infinite;
}

@keyframes glow-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 198, 255, 0.7), 0 3px 10px rgba(0, 114, 255, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(0, 198, 255, 0), 0 3px 14px rgba(0, 114, 255, 0.7);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 198, 255, 0), 0 3px 10px rgba(0, 114, 255, 0.4);
    }
}

.notification-fab:hover {
    transform: scale(1.08) translateY(-1px);
    background: linear-gradient(135deg, #00b4e6 0%, #0061da 100%); 
}

.notification-fab .material-icons-outlined {
    font-size: 20px;
}

.notification-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    background: #ff3b30;
    color: white;
    font-size: 10px;
    font-weight: bold;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(255, 59, 48, 0.4);
    animation: bounce 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Panel flotante de notificaciones desplegable desde el Topbar */
.notification-panel {
    position: fixed;
    top: 65px;
    right: 200px;
    bottom: auto;
    left: auto;
    width: 360px;
    max-height: 75vh;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(-10px) scale(0.95);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-origin: top right;
}

.notification-panel.open {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: all;
}

.notification-header {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8f9fa;
}

.notification-header h3 {
    margin: 0;
    font-size: 16px;
    color: var(--primary-color, #1a2f26);
    display: flex;
    align-items: center;
    gap: 8px;
}

.notification-list {
    padding: 10px;
    overflow-y: auto;
    flex: 1;
}

/* Estilos de items de notificacion */
.notif-item {
    padding: 14px;
    border-radius: 12px;
    margin-bottom: 8px;
    display: flex;
    gap: 12px;
    background: #fff;
    border: 1px solid #eee;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    transition: all 0.2s;
}

.notif-item:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    transform: translateX(4px);
}

.notif-item:last-child {
    margin-bottom: 0;
}

.notif-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notif-icon .material-icons-outlined {
    font-size: 20px;
}

.notif-content h4 {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.notif-content p {
    margin: 0;
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

.notif-empty {
    padding: 30px;
    text-align: center;
    color: #999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.notif-empty .material-icons-outlined {
    font-size: 40px;
    color: #ccc;
}

/* Colores por tipo */
.notif-info .notif-icon { background: #e3f2fd; color: #1976d2; }
.notif-warning .notif-icon { background: #fff3e0; color: #f57c00; }
.notif-danger .notif-icon { background: #ffebee; color: #d32f2f; }
.notif-success .notif-icon { background: #e8f5e9; color: #388e3c; }

/* Animaciones */
@keyframes pulse-danger {
    0% { box-shadow: 0 0 0 0 rgba(211, 47, 47, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(211, 47, 47, 0); }
    100% { box-shadow: 0 0 0 0 rgba(211, 47, 47, 0); }
}

@keyframes pulse-info {
    0% { box-shadow: 0 0 0 0 rgba(25, 118, 210, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(25, 118, 210, 0); }
    100% { box-shadow: 0 0 0 0 rgba(25, 118, 210, 0); }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.pulse-danger {
    animation: pulse-danger 2s infinite;
    background: #d32f2f !important; /* Cambia a rojo si hay peligro */
}
.pulse-danger:hover {
    background: #b71c1c !important;
}

.pulse-info {
    animation: pulse-info 2s 1;
}

/* Estilos del FAB de IA en Topbar */
.ia-fab {
    position: relative !important;
    bottom: auto !important;
    left: auto !important;
    width: 38px !important;
    height: 38px !important;
    min-width: 38px;
    min-height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #27a87c 0%, #156649 100%);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(39, 168, 124, 0.35);
    cursor: pointer;
    z-index: 101;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ia-fab:hover {
    transform: scale(1.08) translateY(-1px);
    background: linear-gradient(135deg, #2ecc71 0%, #27a87c 100%);
    box-shadow: 0 5px 15px rgba(39, 168, 124, 0.5);
}

.ia-fab.pulse-active {
    animation: ia-pulse-glow 2s infinite;
}

@keyframes ia-pulse-glow {
    0% { box-shadow: 0 0 0 0 rgba(39, 168, 124, 0.7), 0 3px 10px rgba(39, 168, 124, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(39, 168, 124, 0), 0 3px 14px rgba(39, 168, 124, 0.6); }
    100% { box-shadow: 0 0 0 0 rgba(39, 168, 124, 0), 0 3px 10px rgba(39, 168, 124, 0.4); }
}

/* Estilos de burbujas de chat de IA */
.ia-message-bubble {
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 85%;
    word-wrap: break-word;
    font-size: 14.5px;
    line-height: 1.5;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    display: inline-block;
}

.ia-message-user-container {
    display: flex;
    justify-content: flex-end;
    width: 100%;
    margin-bottom: 5px;
}

.ia-message-bot-container {
    display: flex;
    justify-content: flex-start;
    width: 100%;
    margin-bottom: 5px;
}

.ia-message-user {
    background: #e3f2fd;
    color: #0d47a1;
    border-bottom-right-radius: 2px;
}

.ia-message-bot {
    background: #ffffff;
    color: #2c3e50;
    border-bottom-left-radius: 2px;
    border: 1px solid #e2e8f0;
}

/* Responsividad Móvil */
@media (max-width: 768px) {
    .notification-panel {
        top: 60px;
        left: 15px;
        right: 15px;
        width: auto;
        transform-origin: top center;
    }
}
