/* ==================== NOTIFICATION CENTER ==================== */

/* Overlay */
.notification-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 9998;
}

.notification-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Drawer */
.notification-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(400px, 90vw);
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.98));
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.notification-drawer.open {
    transform: translateX(0);
}

/* Header */
.notification-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.notification-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    flex: 1;
}

.notification-header .unread-badge {
    background: var(--primary-green);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 12px;
    min-width: 24px;
    text-align: center;
}

.notification-close {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.notification-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* Mark all as read button */
.mark-all-read {
    margin: 16px 20px;
    padding: 10px 16px;
    background: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52, 211, 153, 0.2);
    border-radius: 10px;
    color: var(--primary-green);
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.mark-all-read:hover {
    background: rgba(52, 211, 153, 0.15);
    border-color: rgba(52, 211, 153, 0.3);
}

.mark-all-read i {
    font-size: 0.9rem;
}

/* Notifications list */
.notifications-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 20px 20px 20px;
}

/* Custom scrollbar */
.notifications-list::-webkit-scrollbar {
    width: 6px;
}

.notifications-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

.notifications-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.notifications-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Empty state */
.notifications-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.notifications-empty i {
    font-size: 3rem;
    opacity: 0.3;
    margin-bottom: 16px;
}

.notifications-empty p {
    font-size: 0.95rem;
    margin: 0;
}

/* Notification groups */
.notification-group {
    margin-bottom: 24px;
}

.notification-date-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding-left: 4px;
}

/* Individual notification */
.notification-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.notification-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateX(-2px);
}

.notification-item.unread {
    background: rgba(52, 211, 153, 0.05);
    border-color: rgba(52, 211, 153, 0.15);
}

.notification-item.unread:hover {
    background: rgba(52, 211, 153, 0.08);
    border-color: rgba(52, 211, 153, 0.2);
}

/* Avatar */
.notification-avatar {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: linear-gradient(135deg, #475569, #64748b);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.notification-avatar.follow {
    background: linear-gradient(135deg, var(--primary-green), #10b981);
}

.notification-avatar.like {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.notification-avatar.comment {
    background: linear-gradient(135deg, var(--primary-blue), #2563eb);
}

.notification-avatar.request {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

/* Content */
.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-message {
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 4px;
    display: flex;
    align-items: start;
    gap: 8px;
}

.notification-message i {
    font-size: 0.85rem;
    margin-top: 2px;
    opacity: 0.7;
    flex-shrink: 0;
}

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

.notification-message .post-ref {
    color: var(--primary-green);
    font-weight: 500;
}

.notification-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Mark as read button */
.notification-mark-read {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: transparent;
    border: none;
    color: var(--primary-green);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    align-self: center;
}

.notification-mark-read:hover {
    background: rgba(52, 211, 153, 0.1);
}

.notification-mark-read i {
    font-size: 0.5rem;
}

/* Badge en navegación */
.nav-notification-badge {
    display: none;
    position: absolute;
    top: 8px;
    right: 8px;
    min-width: 18px;
    height: 18px;
    background: #ef4444;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: white;
    padding: 0 5px;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
    animation: badge-pulse 2s ease-in-out infinite;
}

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

/* Responsive */
@media (max-width: 480px) {
    .notification-drawer {
        width: 100vw;
        border-left: none;
    }
    
    .notification-header h2 {
        font-size: 1.1rem;
    }
    
    .notifications-list {
        padding: 0 16px 16px 16px;
    }
    
    .mark-all-read {
        margin: 12px 16px;
    }
}

/* Dark mode adjustments (ya está en dark por defecto, pero por si acaso) */
@media (prefers-color-scheme: dark) {
    .notification-drawer {
        background: linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.98));
    }
}

/* iPhone - Notification drawer header */
.notification-drawer {
    padding-top: env(safe-area-inset-top);
}

.notification-header {
    padding-top: 20px !important; /* Mantener padding original */
}

/* ==========================================
   LIGHT MODE ADJUSTMENTS - NOTIFICATIONS
   Copiar AL FINAL de notifications.css
   ========================================== */

/* Overlay */
body.light-mode .notification-overlay {
    background: rgba(0, 0, 0, 0.4);
}

/* Drawer principal */
body.light-mode .notification-drawer {
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.98), rgba(241, 245, 249, 0.98));
    border-left: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.15);
}

/* Header */
body.light-mode .notification-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

body.light-mode .notification-header h2 {
    color: var(--text-primary);
}

body.light-mode .notification-header .unread-badge {
    background: var(--primary-green);
    /* El badge mantiene su color */
}

body.light-mode .notification-close {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--text-secondary);
}

body.light-mode .notification-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-primary);
}

/* Mark all as read button */
body.light-mode .mark-all-read {
    background: rgba(5, 150, 105, 0.08);
    border: 1px solid rgba(5, 150, 105, 0.2);
    color: var(--primary-green);
}

body.light-mode .mark-all-read:hover {
    background: rgba(5, 150, 105, 0.12);
    border-color: rgba(5, 150, 105, 0.3);
}

/* Lista de notificaciones */
body.light-mode .notifications-list {
    /* El fondo lo hereda del drawer */
}

/* Scrollbar */
body.light-mode .notifications-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.02);
}

body.light-mode .notifications-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
}

body.light-mode .notifications-list::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

/* Empty state */
body.light-mode .notifications-empty {
    color: var(--text-muted);
}

body.light-mode .notifications-empty i {
    /* Se mantiene igual */
}

body.light-mode .notifications-empty p {
    /* Se mantiene igual */
}

/* Date label */
body.light-mode .notification-date-label {
    color: var(--text-muted);
}

/* Notificación individual */
body.light-mode .notification-item {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

body.light-mode .notification-item:hover {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .notification-item.unread {
    background: rgba(5, 150, 105, 0.08);
    border-color: rgba(5, 150, 105, 0.2);
}

body.light-mode .notification-item.unread:hover {
    background: rgba(5, 150, 105, 0.12);
    border-color: rgba(5, 150, 105, 0.25);
}

/* Avatar de notificación */
body.light-mode .notification-avatar {
    background: linear-gradient(135deg, #64748b, #94a3b8);
    /* Los gradientes de color se mantienen iguales */
}

body.light-mode .notification-avatar.follow {
    background: linear-gradient(135deg, var(--primary-green), #10b981);
}

body.light-mode .notification-avatar.like {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

body.light-mode .notification-avatar.comment {
    background: linear-gradient(135deg, var(--primary-blue), #2563eb);
}

body.light-mode .notification-avatar.request {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

/* Contenido */
body.light-mode .notification-message {
    color: var(--text-primary);
}

body.light-mode .notification-message i {
    /* Se mantiene igual */
}

body.light-mode .notification-message strong {
    color: var(--text-primary);
}

body.light-mode .notification-message .post-ref {
    color: var(--primary-green);
}

body.light-mode .notification-time {
    color: var(--text-muted);
}

/* Mark as read button */
body.light-mode .notification-mark-read {
    background: transparent;
    border: none;
    color: var(--primary-green);
}

body.light-mode .notification-mark-read:hover {
    background: rgba(5, 150, 105, 0.1);
}

/* Badge en navegación */
body.light-mode .nav-notification-badge {
    background: #ef4444;
    /* El rojo se mantiene para visibilidad */
}