/* ═══════════════════════════════════════
   NOTIFICATION UI STYLES
   Estilos para el sistema de notificaciones push
   ═══════════════════════════════════════ */

/* Contenedor principal */
.notification-container {
    position: relative;
    display: inline-block;
    z-index: 1000;
}

/* Estilos especiales para header con fondo azul */
.page-header .notification-bell {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.page-header .notification-bell:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* ═══════════════════════════════════════
   BELL ICON (Campana)
   ═══════════════════════════════════════ */

.notification-bell {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #6B7280;
}

.notification-bell:hover {
    background: #F3F4F6;
    color: #3B82F6;
}

.notification-bell:active {
    transform: scale(0.95);
}

.notification-bell svg {
    width: 24px;
    height: 24px;
}

/* Badge de contador */
.notification-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    display: none;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
    color: white;
    font-size: 11px;
    font-weight: 700;
    border-radius: 9px;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.9;
    }
}

/* ═══════════════════════════════════════
   NOTIFICATION PANEL (Dropdown)
   ═══════════════════════════════════════ */

.notification-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 380px;
    max-height: 520px;
    background: white;
    border-radius: 16px;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06),
        0 20px 25px -5px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
    pointer-events: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Responsive para tablets y web */
@media (max-width: 1024px) and (min-width: 601px) {
    .notification-panel {
        width: 340px;
        right: -8px;
    }
}

/* Responsive para móviles */
@media (max-width: 600px) {
    .notification-panel {
        position: fixed;
        top: 60px !important;
        right: 8px;
        left: 8px;
        width: auto;
        max-width: none;
    }
}

/* Asegurar que el panel no se salga en pantallas pequeñas web */
@media (max-width: 1200px) and (min-width: 1025px) {
    .notification-panel {
        width: 360px;
    }
}

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

/* Header del panel */
.notification-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #E5E7EB;
    background: linear-gradient(135deg, #F9FAFB 0%, #FFFFFF 100%);
}

.notification-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #1F2937;
}

.btn-mark-all-read {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #6B7280;
}

.btn-mark-all-read:hover {
    background: #E5E7EB;
    color: #3B82F6;
}

.btn-mark-all-read svg {
    width: 16px;
    height: 16px;
}

/* Lista de notificaciones */
.notification-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
    max-height: 440px;
}

/* Scrollbar personalizado */
.notification-list::-webkit-scrollbar {
    width: 6px;
}

.notification-list::-webkit-scrollbar-track {
    background: #F3F4F6;
}

.notification-list::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 3px;
}

.notification-list::-webkit-scrollbar-thumb:hover {
    background: #9CA3AF;
}

/* ═══════════════════════════════════════
   NOTIFICATION ITEM
   ═══════════════════════════════════════ */

.notification-item {
    position: relative;
    display: flex;
    gap: 12px;
    padding: 14px 20px;
    cursor: pointer;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
}

.notification-item:hover {
    background: #F9FAFB;
}

.notification-item.unread {
    background: #EFF6FF;
    border-left-color: #3B82F6;
}

.notification-item.unread:hover {
    background: #DBEAFE;
}

/* Ícono de notificación */
.notification-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    flex-shrink: 0;
}

.notification-icon.new_emergency {
    background: #FEE2E2;
    color: #DC2626;
}

.notification-icon.new_incident {
    background: #FEF3C7;
    color: #D97706;
}

.notification-icon.comment_added {
    background: #DBEAFE;
    color: #2563EB;
}

.notification-icon.status_changed {
    background: #D1FAE5;
    color: #059669;
}

/* Contenido de notificación */
.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-size: 14px;
    font-weight: 600;
    color: #1F2937;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notification-body {
    font-size: 13px;
    color: #6B7280;
    line-height: 1.4;
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.notification-time {
    font-size: 11px;
    color: #9CA3AF;
    font-weight: 500;
}

/* Dot indicador de no leída */
.notification-dot {
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: #3B82F6;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* ═══════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════ */

.notification-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
}

.notification-empty svg {
    width: 48px;
    height: 48px;
    color: #D1D5DB;
    margin-bottom: 16px;
}

.notification-empty p {
    margin: 0;
    font-size: 14px;
    color: #9CA3AF;
    font-weight: 500;
}

/* ═══════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════ */

@media (max-width: 480px) {
    .notification-panel {
        width: calc(100vw - 32px);
        right: -16px;
    }

    .notification-item {
        padding: 12px 16px;
    }

    .notification-header {
        padding: 14px 16px;
    }

    .notification-icon {
        width: 36px;
        height: 36px;
    }
}

/* ═══════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════ */

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.notification-item {
    animation: slideIn 0.3s ease-out;
}

/* ═══════════════════════════════════════
   DARK MODE SUPPORT (opcional)
   ═══════════════════════════════════════ */

@media (prefers-color-scheme: dark) {
    .notification-panel {
        background: #1F2937;
        box-shadow:
            0 4px 6px -1px rgba(0, 0, 0, 0.3),
            0 2px 4px -1px rgba(0, 0, 0, 0.2),
            0 20px 25px -5px rgba(0, 0, 0, 0.3);
    }

    .notification-header {
        background: linear-gradient(135deg, #111827 0%, #1F2937 100%);
        border-bottom-color: #374151;
    }

    .notification-header h3 {
        color: #F9FAFB;
    }

    .notification-item {
        color: #E5E7EB;
    }

    .notification-item:hover {
        background: #374151;
    }

    .notification-item.unread {
        background: #1E3A5F;
        border-left-color: #60A5FA;
    }

    .notification-item.unread:hover {
        background: #1E40AF;
    }

    .notification-title {
        color: #F9FAFB;
    }

    .notification-body {
        color: #D1D5DB;
    }

    .notification-time {
        color: #9CA3AF;
    }

    .notification-list::-webkit-scrollbar-track {
        background: #374151;
    }

    .notification-list::-webkit-scrollbar-thumb {
        background: #6B7280;
    }

    .notification-bell {
        color: #D1D5DB;
    }

    .notification-bell:hover {
        background: #374151;
        color: #60A5FA;
    }
}
