/* ==========================================================
   notifications.css — Notification dropdown panel & items
   ========================================================== */

/* ── Wrapper (anchored to bell button) ─────────────────── */
.notif-wrapper {
    position: relative;
    display: inline-block;
}

/* ── Dropdown panel ─────────────────────────────────────── */
.notif-panel {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 360px;
    max-height: 480px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
    z-index: 1050;
    overflow: hidden;
    animation: notifSlideIn 0.18s ease;
}

.notif-panel.is-open {
    display: flex;
    flex-direction: column;
}

@keyframes notifSlideIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0);    }
}

/* ── Panel header ───────────────────────────────────────── */
.notif-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 12px;
    border-bottom: 1px solid #f3f4f6;
    flex-shrink: 0;
}

.notif-header h6 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #111827;
}

.notif-mark-all-btn {
    font-size: 12px;
    color: #6366f1;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-weight: 500;
    transition: color 0.15s;
}

.notif-mark-all-btn:hover { color: #4f46e5; }

/* ── Scrollable list ────────────────────────────────────── */
.notif-list {
    overflow-y: auto;
    flex: 1;
    overscroll-behavior: contain;
}

/* ── Individual item ────────────────────────────────────── */
.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.12s;
    border-bottom: 1px solid #f9fafb;
    text-decoration: none;
    color: inherit;
}

.notif-item:last-child { border-bottom: none; }

.notif-item:hover { background: #f5f3ff; }

.notif-item.is-unread { background: #faf5ff; }

.notif-item.is-unread:hover { background: #f0ebff; }

/* ── Icon circle ────────────────────────────────────────── */
.notif-icon {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    background: #ede9fe;
    color: #7c3aed;
    margin-top: 1px;
}

/* Type-specific icon colours */
.notif-icon--streak   { background: #fff7ed; color: #ea580c; }
.notif-icon--goal     { background: #ecfdf5; color: #059669; }
.notif-icon--badge    { background: #fefce8; color: #ca8a04; }
.notif-icon--admin    { background: #f0f9ff; color: #0284c7; }

/* ── Item body ──────────────────────────────────────────── */
.notif-body {
    flex: 1;
    min-width: 0;
}

.notif-title {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notif-msg {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notif-time {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 4px;
}

/* ── Unread dot ─────────────────────────────────────────── */
.notif-unread-dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #6366f1;
    margin-top: 5px;
    align-self: flex-start;
}

/* ── Panel footer ───────────────────────────────────────── */
.notif-footer {
    border-top: 1px solid #f3f4f6;
    padding: 10px 16px;
    text-align: center;
    flex-shrink: 0;
}

.notif-footer a {
    font-size: 13px;
    color: #6366f1;
    font-weight: 500;
    text-decoration: none;
}

.notif-footer a:hover { text-decoration: underline; }

/* ── Loading skeleton ───────────────────────────────────── */
.notif-skeleton {
    padding: 12px 16px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.skeleton-circle {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(90deg, #f0f0f0 25%, #e4e4e4 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
}

.skeleton-lines { flex: 1; display: flex; flex-direction: column; gap: 6px; }

.skeleton-line {
    height: 10px;
    border-radius: 6px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e4e4e4 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
}

.skeleton-line.short { width: 55%; }

@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Empty state ────────────────────────────────────────── */
.notif-empty {
    padding: 36px 20px;
    text-align: center;
    color: #9ca3af;
}

.notif-empty i   { font-size: 32px; margin-bottom: 10px; display: block; }
.notif-empty p   { margin: 0; font-size: 13px; }

/* ── Load More button ───────────────────────────────────── */
.notif-load-more {
    width: 100%;
    padding: 10px;
    font-size: 12px;
    color: #6366f1;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.12s;
}

.notif-load-more:hover { background: #f5f3ff; }

/* ── Mobile: full-width dropdown ────────────────────────── */
@media (max-width: 575.98px) {
    .notif-panel {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        width: 100%;
        max-height: calc(100dvh - 70px);
        border-radius: 0 0 12px 12px;
        border-left: none;
        border-right: none;
    }
}
