/**
 * Notifications Module - Premium Styles
 * Glassmorphism slide-in panel with micro-animations
 */

/* ========== Badge in Navbar ========== */
.notif-badge-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notif-badge-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all 0.2s ease;
    position: relative;
}

.notif-badge-btn:hover {
    background: var(--hover);
    color: var(--text-primary);
}

.notif-badge-btn svg {
    width: 22px;
    height: 22px;
}

.notif-badge-count {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    background: #ef4444;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
    animation: badgeAppear 0.3s ease;
}

.notif-badge-count.hidden {
    display: none;
}

@keyframes badgeAppear {
    0% { transform: scale(0); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.notif-badge-count.pulse {
    animation: badgePulse 1s ease infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4); }
    50% { transform: scale(1.1); box-shadow: 0 4px 16px rgba(239, 68, 68, 0.6); }
}

/* ========== Overlay ========== */
.notif-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 9998;
}

.notif-overlay.visible {
    opacity: 1;
    visibility: visible;
}

/* ========== Panel ========== */
.notif-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 380px;
    max-width: 100vw;
    background: var(--surface);
    border-left: 1px solid var(--border);
    box-shadow: -20px 0 60px rgba(0, 0, 0, 0.3);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(20px);
}

.notif-panel.visible {
    transform: translateX(0);
}

/* ========== Header ========== */
.notif-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface-translucent, rgba(30, 30, 40, 0.9));
    backdrop-filter: blur(20px);
}

.notif-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.notif-title-icon {
    font-size: 1.2rem;
}

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

.notif-action-btn {
    padding: 8px 14px;
    border-radius: 8px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.notif-action-btn:hover {
    background: var(--hover);
    color: var(--text-primary);
    border-color: var(--accent);
}

.notif-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.2s ease;
}

.notif-close-btn:hover {
    background: var(--hover);
    color: var(--text-primary);
}

/* ========== List ========== */
.notif-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

/* ========== Item ========== */
.notif-item {
    display: flex;
    gap: 14px;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    animation: notifSlideIn 0.3s ease;
    background: var(--background);
    border: 1px solid transparent;
}

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

.notif-item:hover {
    background: var(--hover);
    transform: translateX(-4px);
}

.notif-item.unread {
    border-left: 3px solid var(--accent);
    background: var(--accent-muted, rgba(99, 102, 241, 0.08));
}

.notif-item.unread::before {
    content: '';
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent);
}

.notif-item.removing {
    animation: notifRemove 0.3s ease forwards;
}

@keyframes notifRemove {
    to { opacity: 0; transform: translateX(100%); height: 0; padding: 0; margin: 0; }
}

.notif-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.notif-icon.mention { background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%); }
.notif-icon.assignment { background: linear-gradient(135deg, #22c55e 0%, #15803d 100%); }
.notif-icon.achievement { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }
.notif-icon.task_due { background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%); }
.notif-icon.message { background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%); }

.notif-content {
    flex: 1;
    min-width: 0;
}

.notif-content-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
    margin-bottom: 4px;
    line-height: 1.3;
}

.notif-content-body {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notif-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
}

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

.notif-delete-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s ease;
}

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

.notif-delete-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* ========== Empty State ========== */
.notif-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    text-align: center;
    padding: 40px;
}

.notif-empty-icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.notif-empty-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.notif-empty-text {
    font-size: 0.85rem;
    max-width: 220px;
}

/* ========== Footer ========== */
.notif-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: center;
}

.notif-settings-link {
    font-size: 0.85rem;
    color: var(--accent);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.notif-settings-link:hover {
    text-decoration: underline;
}

/* ========== Responsive ========== */
@media (max-width: 480px) {
    .notif-panel {
        width: 100vw;
    }
}
