/* ── Notification Bell & Offcanvas ─────────────────────────────────────────── */

/* Bell button */
.notif-bell-btn {
    position: relative;
    background: none;
    border: none;
    padding: 6px 8px;
    border-radius: 10px;
    color: var(--text-color);
    cursor: pointer;
    transition: background 0.18s, color 0.18s;
    line-height: 1;
}
.notif-bell-btn:hover {
    background: var(--light-bg-color);
    color: #0d6efd;
}

/* Unread badge on the bell */
.notif-bell-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    background: #dc3545;
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-color, #fff);
    line-height: 1;
}
.notif-bell-badge--pulse {
    animation: notif-pulse 1.8s ease infinite;
}
@keyframes notif-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220,53,69,.6); }
    50%       { box-shadow: 0 0 0 5px rgba(220,53,69,0); }
}

/* ── Offcanvas panel ──────────────────────────────────────────────────────── */

#notifOffcanvas {
    width: 420px;
    background-color: var(--card-bg-color, #fff);
    border-left: none;
}
@media (max-width: 480px) {
    #notifOffcanvas { width: 100vw; }
}

.notif-offcanvas-header {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    color: #fff;
    padding: 18px 20px;
    flex-shrink: 0;
}
.notif-offcanvas-header .btn-close {
    filter: invert(1);
}

/* Tabs */
.notif-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color, #dee2e6);
    background: var(--card-bg-color);
    flex-shrink: 0;
}
.notif-tab {
    flex: 1;
    padding: 10px 0;
    text-align: center;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--subtle-text-color);
    cursor: pointer;
    border: none;
    background: none;
    border-bottom: 3px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}
.notif-tab:hover { color: #0d6efd; }
.notif-tab.active {
    color: #0d6efd;
    border-bottom-color: #0d6efd;
}

/* Toolbar */
.notif-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    border-bottom: 1px solid var(--border-color, #dee2e6);
    flex-shrink: 0;
    background: var(--card-bg-color);
}
.notif-toolbar-count {
    font-size: 0.78rem;
    color: var(--subtle-text-color);
}
.notif-toolbar-actions {
    display: flex;
    gap: 6px;
}
.notif-toolbar-btn {
    font-size: 0.75rem;
    padding: 3px 10px;
    border-radius: 6px;
    border: 1px solid var(--border-color, #dee2e6);
    background: var(--card-bg-color);
    color: var(--text-color);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.notif-toolbar-btn:hover {
    background: var(--light-bg-color);
    border-color: #0d6efd;
    color: #0d6efd;
}

/* Scrollable list */
.notif-list-wrap {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

/* ── Single notification row ────────────────────────────────────────────── */

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color, #dee2e6);
    transition: background 0.13s;
    position: relative;
    text-decoration: none;
    color: inherit;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--light-bg-color); }
.notif-item.unread { background: rgba(13, 110, 253, 0.04); }
.notif-item.unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #0d6efd;
    border-radius: 0 2px 2px 0;
}

/* Type icon bubble */
.notif-icon-bubble {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.88rem;
    flex-shrink: 0;
    margin-top: 1px;
}
.notif-icon-bubble--new_rule            { background: rgba(13,110,253,.12);  color: #0d6efd; }
.notif-icon-bubble--rule_update_found  { background: rgba(13,202,240,.12);  color: #0dcaf0; }
.notif-icon-bubble--job_created        { background: rgba(108,117,125,.12); color: #6c757d; }
.notif-icon-bubble--job_finished       { background: rgba(25,135,84,.12);   color: #198754; }
.notif-icon-bubble--job_failed         { background: rgba(220,53,69,.12);   color: #dc3545; }
.notif-icon-bubble--github_import_done { background: rgba(52,58,64,.12);    color: #495057; }
.notif-icon-bubble--github_update_done { background: rgba(102,16,242,.10);  color: #6610f2; }

/* Content */
.notif-content { flex: 1; min-width: 0; }
.notif-title {
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--text-color);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.notif-body {
    font-size: 0.77rem;
    color: var(--subtle-text-color);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.notif-time {
    font-size: 0.7rem;
    color: var(--subtle-text-color);
    margin-top: 4px;
    opacity: .75;
}

/* Job progress bar inside the notif row */
.notif-progress {
    margin-top: 6px;
    height: 4px;
    border-radius: 2px;
    background: var(--light-bg-color, #f0f0f0);
    overflow: hidden;
}
.notif-progress__fill {
    height: 100%;
    border-radius: 2px;
    background: #0d6efd;
    transition: width 0.4s ease;
}
.notif-progress__fill--done   { background: #198754; }
.notif-progress__fill--failed { background: #dc3545; }
.notif-progress__fill--indeterminate {
    width: 100%;
    background: linear-gradient(90deg, transparent, #0d6efd, transparent);
    background-size: 200%;
    animation: notif-indeterminate 1.4s ease infinite;
}
@keyframes notif-indeterminate {
    0%   { background-position: -100% 0; }
    100% { background-position: 200% 0; }
}

/* Action buttons on hover */
.notif-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-end;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.15s;
}
.notif-item:hover .notif-actions { opacity: 1; }
.notif-action-btn {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: none;
    background: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    cursor: pointer;
    transition: background 0.13s, color 0.13s;
    color: var(--subtle-text-color);
}
.notif-action-btn:hover { background: var(--light-bg-color); }
.notif-action-btn--delete:hover { background: rgba(220,53,69,.1); color: #dc3545; }
.notif-action-btn--read:hover   { background: rgba(25,135,84,.1); color: #198754; }

/* Footer */
.notif-footer {
    border-top: 1px solid var(--border-color, #dee2e6);
    padding: 10px 16px;
    text-align: center;
    flex-shrink: 0;
}
.notif-footer a {
    font-size: 0.8rem;
    font-weight: 600;
    color: #0d6efd;
    text-decoration: none;
}
.notif-footer a:hover { text-decoration: underline; }

/* Empty state */
.notif-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    color: var(--subtle-text-color);
    text-align: center;
}
.notif-empty__icon {
    font-size: 2.4rem;
    opacity: .25;
    margin-bottom: 12px;
}
.notif-empty__title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-color);
}
.notif-empty__sub {
    font-size: 0.77rem;
}

/* Loading skeleton */
.notif-skeleton {
    padding: 12px 16px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.notif-skeleton__bubble {
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--light-bg-color);
    animation: notif-shimmer 1.4s infinite;
    flex-shrink: 0;
}
.notif-skeleton__lines { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.notif-skeleton__line {
    height: 12px; border-radius: 6px;
    background: var(--light-bg-color);
    animation: notif-shimmer 1.4s infinite;
}
.notif-skeleton__line:nth-child(2) { width: 70%; }
@keyframes notif-shimmer {
    0%,100% { opacity: 1; } 50% { opacity: .4; }
}

/* ── Full notifications page ────────────────────────────────────────────── */

.notif-page-card {
    background: var(--card-bg-color);
    border-radius: 14px;
    box-shadow: 0 2px 16px rgba(0,0,0,.06);
    overflow: hidden;
}
.notif-page-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color, #dee2e6);
    transition: background 0.13s;
    position: relative;
}
.notif-page-item:last-child { border-bottom: none; }
.notif-page-item.unread { background: rgba(13,110,253,.035); }
.notif-page-item.unread::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: #0d6efd;
}
.notif-page-item:hover { background: var(--light-bg-color); }
.notif-page-title { font-size: 0.9rem; font-weight: 600; color: var(--text-color); }
.notif-page-body  { font-size: 0.82rem; color: var(--subtle-text-color); margin-top: 3px; }
.notif-page-time  { font-size: 0.73rem; color: var(--subtle-text-color); margin-top: 5px; }
.notif-page-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }

/* Follow button on user profile */
.btn-follow {
    font-size: 0.82rem;
    padding: 4px 14px;
    border-radius: 20px;
    font-weight: 600;
    transition: all 0.2s;
}
.btn-follow--following {
    background: transparent;
    border: 1.5px solid var(--border-color, #dee2e6);
    color: var(--subtle-text-color);
}
.btn-follow--following:hover {
    border-color: #dc3545;
    color: #dc3545;
    background: rgba(220,53,69,.06);
}
