/**
 * ALELUYEMOS - Estilos de Notificaciones
 * Webapp Social Cristiana
 */

/* ============================================
   CONTENEDOR DE NOTIFICACIONES EN NAVBAR
   ============================================ */
.notifications-container {
    position: relative;
    margin: 0 var(--spacing-sm);
    z-index: 1003; /* Por encima del buscador (1001) para que los clics lleguen al botón */
    flex-shrink: 0; /* Evitar que se comprima y quede oculto */
}

.notifications-btn {
    position: relative;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: var(--spacing-sm);
    border-radius: var(--border-radius-md);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
}

.notifications-btn:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.notifications-btn svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    fill: none;
}

.notifications-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background-color: var(--like-color);
    color: white;
    border-radius: 50%;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    padding: 0 4px;
    border: 2px solid var(--bg-secondary);
    z-index: 1;
}

.notifications-badge.hidden {
    display: none;
}

/* ============================================
   PANEL DE NOTIFICACIONES
   ============================================ */
.notifications-panel {
    position: absolute;
    top: calc(100% + var(--spacing-sm));
    right: 0;
    width: 360px;
    max-width: calc(100vw - var(--spacing-lg));
    max-height: 500px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    z-index: 1002;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.notifications-panel.active {
    display: flex;
}

.notifications-header {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.notifications-header h3 {
    margin: 0;
    font-size: var(--font-size-lg);
    color: var(--text-primary);
}

.notifications-actions {
    display: flex;
    gap: var(--spacing-sm);
}

.btn-mark-all-read {
    background: none;
    border: none;
    color: var(--like-color);
    cursor: pointer;
    font-size: var(--font-size-sm);
    font-weight: 600;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--border-radius-md);
    transition: background-color 0.2s ease;
}

.btn-mark-all-read:hover {
    background-color: var(--bg-tertiary);
}

.notifications-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: var(--font-size-xl);
    padding: var(--spacing-xs);
    line-height: 1;
    transition: color 0.2s ease;
}

.notifications-close:hover {
    color: var(--text-primary);
}

/* ============================================
   LISTA DE NOTIFICACIONES
   ============================================ */
.notifications-list {
    flex: 1;
    overflow-y: auto;
    max-height: 400px;
}

.notifications-list::-webkit-scrollbar {
    width: 6px;
}

.notifications-list::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

.notifications-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.notifications-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.notification-item {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    gap: var(--spacing-md);
    align-items: flex-start;
    position: relative;
}

.notification-item:hover {
    background-color: var(--bg-tertiary);
}

.notification-item.unread {
    background-color: rgba(225, 54, 83, 0.05);
}

.notification-item.unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background-color: var(--like-color);
}

.notification-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--like-color), var(--accent-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: var(--font-size-sm);
    overflow: hidden;
}

.notification-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-message {
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    line-height: 1.5;
    margin-bottom: var(--spacing-xs);
    word-wrap: break-word;
}

.notification-message strong {
    color: var(--text-primary);
    font-weight: 600;
}

.notification-time {
    color: var(--text-muted);
    font-size: var(--font-size-xs);
}

.notifications-empty {
    padding: var(--spacing-xl);
    text-align: center;
    color: var(--text-muted);
}

.notifications-empty svg {
    width: 48px;
    height: 48px;
    margin-bottom: var(--spacing-md);
    opacity: 0.5;
}

.notifications-loading {
    padding: var(--spacing-xl);
    text-align: center;
    color: var(--text-muted);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .notifications-container {
        margin: 0 var(--spacing-xs);
    }
    
    .notifications-btn {
        min-width: 36px;
        min-height: 36px;
        padding: var(--spacing-xs);
    }
    
    .notifications-btn svg {
        width: 20px;
        height: 20px;
    }
    
    .notifications-panel {
        width: 320px;
        right: -10px;
    }
    
    .notifications-list {
        max-height: 300px;
    }
}

@media (max-width: 480px) {
    .notifications-panel {
        width: calc(100vw - var(--spacing-lg));
        right: var(--spacing-sm);
    }
}
