/* ===== Notifications Sidebar ===== */

.notif-sidebar {
    width: 320px !important;
    max-width: 100vw;
    background: #fff;
    display: flex;
    flex-direction: column;
}

/* Header */
.notif-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--bs-border-color);
    background: #fff;
    flex-shrink: 0;
}

.notif-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 600;
}

.notif-header-title i {
    font-size: 1.3rem;
    color: var(--bs-primary);
}

.notif-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.notif-header-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--bs-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.15s ease;
    cursor: pointer;
    text-decoration: none;
}

.notif-header-btn:hover {
    background: var(--bs-light);
    color: var(--bs-dark);
}

.notif-close-btn:hover {
    background: #fee2e2;
    color: var(--bs-danger-text-emphasis);
}

/* Tabs */
.notif-sidebar-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--bs-border-color);
    background: #fafafa;
    flex-shrink: 0;
}

.notif-tab-btn {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--bs-border-color);
    background: #fff;
    color: var(--bs-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.notif-tab-btn:hover {
    border-color: var(--bs-primary);
    color: var(--bs-primary);
}

.notif-tab-btn.active {
    background: var(--bs-primary);
    border-color: var(--bs-primary);
    color: #fff;
}

.notif-tab-btn .notif-badge {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.2);
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.notif-tab-btn:not(.active) .notif-badge {
    background: var(--bs-primary);
    color: #fff;
}

/* Body */
.notif-sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* Notification List */
.notif-list {
    display: flex;
    flex-direction: column;
}

/* Loading State */
.notif-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px 20px;
    color: var(--bs-secondary);
    font-size: 0.9rem;
}

/* Empty State */
.notif-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 60px 20px;
    color: var(--bs-secondary);
}

.notif-empty i {
    font-size: 3rem;
    opacity: 0.3;
}

.notif-empty span {
    font-size: 0.95rem;
}

/* Notification Item */
.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--bs-border-color);
    cursor: pointer;
    transition: background 0.15s ease;
    position: relative;
}

.notif-item:hover {
    background: #f8f9fa;
}

.notif-item.notif-unread {
    background: #f0f7ff;
}

.notif-item.notif-unread:hover {
    background: #e5f0ff;
}

/* Removing animation */
.notif-item.notif-removing {
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.3s ease;
    overflow: hidden;
    padding-top: 0;
    padding-bottom: 0;
    height: 0 !important;
    border: none;
}

/* Avatar */
.notif-item-avatar {
    flex-shrink: 0;
}

.notif-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.notif-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.notif-icon-primary {
    background: #e0e7ff;
    color: #4f46e5;
}

.notif-icon-success {
    background: #d4efe5;
    color: #007a5c;
}

.notif-icon-warning {
    background: #fef3c7;
    color: #d2b491;
}

.notif-icon-danger {
    background: #fee2e2;
    color: var(--bs-danger-text-emphasis);
}

.notif-icon-info {
    background: #e0f2fe;
    color: #0284c7;
}

/* Content */
.notif-item-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.notif-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--bs-dark);
    margin-bottom: 2px;
    line-height: 1.4;
}

.notif-message {
    font-size: 0.85rem;
    color: var(--bs-secondary);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notif-time {
    font-size: 0.75rem;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 4px;
}

.notif-time i {
    font-size: 0.7rem;
}

/* Actions */
.notif-item-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.notif-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--bs-primary);
    flex-shrink: 0;
}

.notif-action-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--bs-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    opacity: 0;
    transition: all 0.15s ease;
    cursor: pointer;
}

.notif-item:hover .notif-action-btn {
    opacity: 1;
}

.notif-action-btn:hover {
    background: var(--bs-light);
    color: var(--bs-dark);
}

/* Footer */
.notif-sidebar-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--bs-border-color);
    background: #fafafa;
    flex-shrink: 0;
}

.notif-footer-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--bs-primary);
    text-decoration: none;
    transition: color 0.15s ease;
}

.notif-footer-link:hover {
    color: var(--bs-primary);
    text-decoration: underline;
}

/* Badge on topbar icon */
#notifBadge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--bs-danger-text-emphasis);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 600;
    display: none;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

#notifBadge.pulse {
    animation: badge-pulse 0.3s ease;
}

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

/* Dark Mode */
html[data-theme="dark"] .notif-sidebar {
    background: #1e1e1e;
}

html[data-theme="dark"] .notif-sidebar-header {
    background: #1e1e1e;
    border-color: #333;
}

html[data-theme="dark"] .notif-header-title {
    color: #fff;
}

html[data-theme="dark"] .notif-header-btn:hover {
    background: #333;
    color: #fff;
}

html[data-theme="dark"] .notif-close-btn:hover {
    background: #3d1f1f;
    color: var(--bs-danger-text-emphasis);
}

html[data-theme="dark"] .notif-sidebar-tabs {
    background: #262626;
    border-color: #333;
}

html[data-theme="dark"] .notif-tab-btn {
    background: #333;
    border-color: #444;
    color: #aaa;
}

html[data-theme="dark"] .notif-tab-btn:hover {
    border-color: var(--bs-primary);
    color: var(--bs-primary);
}

html[data-theme="dark"] .notif-tab-btn.active {
    background: var(--bs-primary);
    border-color: var(--bs-primary);
    color: #fff;
}

html[data-theme="dark"] .notif-item {
    border-color: #333;
}

html[data-theme="dark"] .notif-item:hover {
    background: #262626;
}

html[data-theme="dark"] .notif-item.notif-unread {
    background: #1e2a3a;
}

html[data-theme="dark"] .notif-item.notif-unread:hover {
    background: #253445;
}

html[data-theme="dark"] .notif-title {
    color: #fff;
}

html[data-theme="dark"] .notif-message {
    color: #888;
}

html[data-theme="dark"] .notif-sidebar-footer {
    background: #262626;
    border-color: #333;
}

html[data-theme="dark"] .notif-action-btn:hover {
    background: #333;
    color: #fff;
}

/* ===== Upcoming Reminders ===== */

.notif-reminder-counts {
    background: #f8fafc;
}

.notif-date-header {
    position: sticky;
    top: 0;
    z-index: 1;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.notif-reminder-item {
    cursor: pointer;
}

.notif-reminder-item:hover {
    background: #f1f5f9;
}

.bg-purple-subtle {
    background: rgba(139, 92, 246, 0.15) !important;
}

.text-purple {
    color: #8b5cf6 !important;
}

.pulse-badge {
    animation: pulse-badge 1.5s infinite;
}

@keyframes pulse-badge {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Dark mode */
html[data-theme="dark"] .notif-reminder-counts {
    background: #262626;
}

html[data-theme="dark"] .notif-date-header {
    background: #1e1e1e;
    border-color: #333;
}

html[data-theme="dark"] .notif-reminder-item:hover {
    background: #2d2d2d;
}

html[data-theme="dark"] .bg-success-subtle {
    background: rgba(16, 185, 129, 0.2) !important;
}

html[data-theme="dark"] .bg-warning-subtle {
    background: rgba(245, 158, 11, 0.2) !important;
}

html[data-theme="dark"] .bg-primary-subtle {
    background: rgba(99, 102, 241, 0.2) !important;
}

html[data-theme="dark"] .bg-purple-subtle {
    background: rgba(139, 92, 246, 0.2) !important;
}

/* Responsive */
@media (max-width: 576px) {
    .notif-sidebar {
        width: 100vw !important;
    }

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