/**
 * NOTIFICATIONS MODERN - Estilos tipo Facebook/Instagram
 * Versión: 2.0.0
 * Fecha: 16 de Marzo 2026
 * Diseño moderno y atractivo para notificaciones
 */

/* ========================================
   HEADER DE NOTIFICACIONES
   ======================================== */

.notifications-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-primary);
    background: var(--bg-card);
    position: sticky;
    top: 0;
    z-index: 100;
}

.notifications-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.notifications-title i {
    color: var(--primary-mid);
}

.notifications-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.notifications-filter-btn {
    background: transparent;
    border: 1px solid var(--border-primary);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.notifications-filter-btn.active {
    background: var(--primary-gradient);
    border-color: var(--primary-mid);
    color: white;
}

.notifications-filter-btn:hover:not(.active) {
    background: var(--bg-hover);
    border-color: var(--text-dim);
}

.filter-badge {
    background: white;
    color: var(--primary-mid);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
}

.notifications-filter-btn.active .filter-badge {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

.notifications-mark-all {
    background: var(--bg-tertiary);
    border: none;
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.notifications-mark-all:hover {
    background: var(--bg-hover);
    color: var(--primary-mid);
    transform: scale(1.1);
}

/* ========================================
   TABS DE CATEGORÍAS
   ======================================== */

.notifications-tabs {
    display: flex;
    gap: 8px;
    padding: 16px 24px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-primary);
    overflow-x: auto;
    scrollbar-width: none;
}

.notifications-tabs::-webkit-scrollbar {
    display: none;
}

.notif-tab {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    position: relative;
}

.notif-tab i {
    font-size: 16px;
}

.notif-tab.active {
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.notif-tab:hover:not(.active) {
    background: var(--bg-hover);
}

.tab-count {
    background: var(--danger);
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    text-align: center;
}

.notif-tab.active .tab-count {
    background: var(--primary-mid);
}

/* ========================================
   LISTA DE NOTIFICACIONES
   ======================================== */

.notifications-list-modern {
    display: flex;
    flex-direction: column;
}

/* ========================================
   CARD DE NOTIFICACIÓN
   ======================================== */

.notification-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-primary);
    background: var(--bg-card);
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
}

.notification-card:hover {
    background: var(--bg-hover);
}

.notification-card.unread {
    background: rgba(255, 60, 172, 0.05);
}

.notification-card.unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-gradient);
}

/* ========================================
   AVATAR STACK
   ======================================== */

.notification-avatar-stack {
    position: relative;
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notif-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 3px solid var(--bg-card);
    object-fit: cover;
    position: absolute;
}

.notif-avatar.single {
    position: relative;
}

/* Stack de 2 avatares */
.notification-avatar-stack .notif-avatar:nth-child(1) {
    left: 0;
    z-index: 2;
}

.notification-avatar-stack .notif-avatar:nth-child(2) {
    left: 20px;
    z-index: 1;
}

/* Stack de 3+ avatares */
.notification-avatar-stack .notif-avatar:nth-child(3) {
    left: 40px;
    z-index: 0;
}

/* Avatar especial para eventos */
.event-avatar,
.birthday-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
}

/* Badge de EN VIVO */
.live-badge {
    position: absolute;
    bottom: -4px;
    right: -4px;
    background: #FF3B30;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 10;
    animation: livePulse 2s ease-in-out infinite;
}

.live-badge i {
    font-size: 6px;
    animation: blink 1s ease-in-out infinite;
}

@keyframes livePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

/* ========================================
   CUERPO DE NOTIFICACIÓN
   ======================================== */

.notification-body {
    flex: 1;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    position: relative;
}

.notification-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: white;
    flex-shrink: 0;
    margin-top: 4px;
}

.like-icon {
    background: linear-gradient(135deg, #FF3B30, #FF6B6B);
}

.comment-icon {
    background: linear-gradient(135deg, #00D9FF, #33E3FF);
}

.follow-icon {
    background: linear-gradient(135deg, #784BA0, #9575CD);
}

.mention-icon {
    background: linear-gradient(135deg, #FFB800, #FFC952);
}

.share-icon {
    background: linear-gradient(135deg, #00E676, #69F0AE);
}

.event-icon {
    background: linear-gradient(135deg, #FF6B35, #FF8A65);
}

.suggestion-icon {
    background: linear-gradient(135deg, #1DA1F2, #42B4FF);
}

.birthday-icon {
    background: linear-gradient(135deg, #E91E63, #F06292);
}

.live-icon {
    background: linear-gradient(135deg, #FF3B30, #FF6B6B);
}

.notification-text {
    flex: 1;
}

.notification-text p {
    margin: 0 0 6px 0;
    font-size: 15px;
    line-height: 1.4;
    color: var(--text-primary);
}

.notification-text strong {
    font-weight: 600;
    color: var(--text-primary);
}

.notification-time {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--text-dim);
}

.notification-time i {
    font-size: 11px;
}

/* ========================================
   PREVIEW DE POST
   ======================================== */

.notification-preview {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    margin-left: auto;
}

.notification-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.notification-card:hover .notification-preview img {
    transform: scale(1.1);
}

/* ========================================
   ACCIONES EN NOTIFICACIÓN
   ======================================== */

.notification-action {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.notif-follow-btn,
.notif-action-btn {
    background: transparent;
    border: 1px solid var(--border-primary);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.notif-follow-btn:hover {
    background: var(--primary-gradient);
    border-color: var(--primary-mid);
    color: white;
}

.notif-action-btn.primary {
    background: var(--primary-gradient);
    border-color: var(--primary-mid);
    color: white;
}

.notif-action-btn.secondary {
    background: var(--bg-tertiary);
}

.notif-action-btn.live {
    background: #FF3B30;
    border-color: #FF3B30;
    color: white;
}

.notif-follow-btn.small {
    padding: 6px 12px;
    font-size: 13px;
}

/* ========================================
   MENÚ DE NOTIFICACIÓN
   ======================================== */

.notification-menu-btn {
    background: transparent;
    border: none;
    color: var(--text-dim);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    flex-shrink: 0;
    opacity: 0;
}

.notification-card:hover .notification-menu-btn {
    opacity: 1;
}

.notification-menu-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* ========================================
   DOT DE NO LEÍDO
   ======================================== */

.notification-unread-dot {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 10px;
    height: 10px;
    background: var(--primary-mid);
    border-radius: 50%;
    border: 2px solid var(--bg-card);
    animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

/* ========================================
   ESTADO VACÍO
   ======================================== */

.notifications-empty {
    text-align: center;
    padding: 80px 40px;
}

.empty-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: var(--bg-tertiary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-icon i {
    font-size: 36px;
    color: var(--text-dim);
}

.notifications-empty h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 12px 0;
}

.notifications-empty p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
    max-width: 300px;
    margin: 0 auto;
}

/* ========================================
   BOTÓN CARGAR MÁS
   ======================================== */

.notifications-load-more {
    padding: 20px;
    text-align: center;
}

.load-more-btn {
    background: var(--bg-tertiary);
    border: none;
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.load-more-btn:hover {
    background: var(--bg-hover);
    transform: translateY(-2px);
}

/* ========================================
   ANIMACIONES DE ENTRADA
   ======================================== */

.notification-card {
    animation: notifSlideIn 0.4s ease-out backwards;
}

.notification-card:nth-child(1) { animation-delay: 0.05s; }
.notification-card:nth-child(2) { animation-delay: 0.1s; }
.notification-card:nth-child(3) { animation-delay: 0.15s; }
.notification-card:nth-child(4) { animation-delay: 0.2s; }
.notification-card:nth-child(5) { animation-delay: 0.25s; }
.notification-card:nth-child(6) { animation-delay: 0.3s; }
.notification-card:nth-child(7) { animation-delay: 0.35s; }
.notification-card:nth-child(8) { animation-delay: 0.4s; }
.notification-card:nth-child(9) { animation-delay: 0.45s; }
.notification-card:nth-child(10) { animation-delay: 0.5s; }

@keyframes notifSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .notifications-header {
        padding: 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .notifications-title {
        font-size: 20px;
    }

    .notifications-actions {
        width: 100%;
        justify-content: space-between;
    }

    .notifications-filter-btn {
        flex: 1;
        justify-content: center;
    }

    .notifications-tabs {
        padding: 12px 16px;
        gap: 6px;
    }

    .notif-tab {
        padding: 8px 12px;
        font-size: 13px;
    }

    .notif-tab span:not(.tab-count) {
        display: none;
    }

    .notif-tab i {
        font-size: 18px;
    }

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

    .notification-avatar-stack {
        width: 48px;
        height: 48px;
    }

    .notif-avatar {
        width: 48px;
        height: 48px;
    }

    .notification-icon {
        width: 20px;
        height: 20px;
        font-size: 10px;
    }

    .notification-text p {
        font-size: 14px;
    }

    .notification-preview {
        width: 60px;
        height: 60px;
    }

    .notification-menu-btn {
        opacity: 1;
    }
}

@media (max-width: 480px) {
    .notifications-header {
        padding: 12px;
    }

    .notifications-title {
        font-size: 18px;
    }

    .notifications-actions {
        gap: 8px;
    }

    .notifications-filter-btn {
        padding: 6px 12px;
        font-size: 12px;
    }

    .filter-badge {
        font-size: 10px;
        padding: 1px 6px;
    }

    .notifications-tabs {
        padding: 8px 12px;
    }

    .notification-card {
        padding: 12px;
        gap: 8px;
    }

    .notification-avatar-stack {
        width: 40px;
        height: 40px;
    }

    .notif-avatar {
        width: 40px;
        height: 40px;
        border-width: 2px;
    }

    .notification-body {
        gap: 8px;
    }

    .notification-text p {
        font-size: 13px;
    }

    .notification-time {
        font-size: 12px;
    }

    .notification-preview {
        width: 50px;
        height: 50px;
    }

    .notif-follow-btn,
    .notif-action-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* ========================================
   ACCESIBILIDAD
   ======================================== */

.notification-card:focus {
    outline: 2px solid var(--accent-cyan);
    outline-offset: -2px;
}

@media (prefers-reduced-motion: reduce) {
    .notification-card,
    .live-badge,
    .notification-unread-dot {
        animation: none !important;
    }

    .notification-card:hover .notification-preview img {
        transform: none;
    }
}

/* ========================================
   MODO CLARO
   ======================================== */

[data-theme="light"] .notification-card.unread {
    background: rgba(255, 60, 172, 0.08);
}

[data-theme="light"] .notifications-empty {
    background: var(--bg-secondary);
}
