/* ──────────────────────────────────────────────────────────────
   notifications.css — bell + shared feed (Q1 D shape, prototype
   validated 2026-08-25). Class prefix: .notif-*. Renders in three
   surfaces: NotificationsBell (desktop dropdown + mobile modal)
   and the /pranesimai history page. Both surfaces share the
   NotificationsFeed component.
   ────────────────────────────────────────────────────────────── */

/* ── Bell button + badge ──────────────────────────────────── */

.notif-bell-wrapper {
    position: relative;
}

.notif-bell-btn {
    position: relative;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.85);
    background: transparent;
    border: none;
    padding: 0;
    font-size: 1.05rem;
    transition: background 0.15s cubic-bezier(0.4, 0, 0.2, 1),
                color 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.notif-bell-btn:hover,
.notif-bell-btn.is-open {
    background: rgba(13, 202, 240, 0.12);
    color: #0dcaf0;
}

.notif-bell-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #dc3545;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 2px rgba(15, 22, 33, 0.95);
}

/* ── Panel wrapper (desktop dropdown / mobile modal) ─────── */

.notif-panel-wrap {
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    z-index: 1050;
}

.notif-panel-backdrop {
    display: none;
}

.notif-panel {
    width: min(420px, 92vw);
    max-height: 70vh;
    background: rgba(15, 22, 33, 0.96);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(13, 202, 240, 0.18);
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Mobile: full-screen modal (Q2a/Q2b — <=767.98px) */
@media (max-width: 767.98px) {
    .notif-panel-wrap {
        position: fixed;
        inset: 0;
        top: 0;
        right: 0;
        z-index: 2000;
    }

    .notif-panel-backdrop {
        display: block;
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(4px);
    }

    .notif-panel {
        position: relative;
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        border: none;
    }
}

.notif-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(13, 202, 240, 0.04);
    color: #fff;
    flex-shrink: 0;
}

.notif-panel-header h5 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.notif-panel-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.notif-panel-mark-all {
    background: none;
    border: none;
    padding: 0;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.78rem;
    cursor: pointer;
    transition: color 0.15s;
}

.notif-panel-mark-all:hover {
    color: #0dcaf0;
}

.notif-panel-close {
    padding: 0.25rem;
}

.notif-panel-body {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
    overflow: hidden;
}

.notif-panel-footer {
    padding: 0.6rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.35);
    text-align: center;
    flex-shrink: 0;
    font-size: 0.82rem;
}

.notif-panel-footer-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.2s;
}

.notif-panel-footer-link:hover {
    color: #0dcaf0;
}

/* ── Filter chip strip ────────────────────────────────────── */

.notif-filter-strip {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.75rem 1rem;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    scrollbar-width: thin;
    flex-shrink: 0;              /* prototype-validated fix — chip strip cannot be squished */
}

.notif-filter-strip::-webkit-scrollbar {
    height: 6px;
    width: 0;
}

.notif-filter-strip::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 3px;
}

.notif-filter-strip::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.28);
}

.notif-chip {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    font-size: 0.82rem;
    line-height: 1.2;
    min-height: 30px;
    box-sizing: border-box;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex: 0 0 auto;
}

.notif-chip:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.15);
}

.notif-chip.is-active {
    background: #0dcaf0;
    border-color: #0dcaf0;
    color: #052029;
}

.notif-chip-count {
    background: rgba(0, 0, 0, 0.25);
    padding: 0.05rem 0.4rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
}

.notif-chip:not(.is-active) .notif-chip-count {
    background: rgba(255, 255, 255, 0.15);
}

/* ── Feed body ────────────────────────────────────────────── */

.notif-feed {
    flex: 1;
    overflow-y: auto;
    padding: 0.25rem 0;
}

.notif-feed::-webkit-scrollbar {
    width: 6px;
}

.notif-feed::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

.notif-feed-empty,
.notif-feed-loading {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    text-align: center;
}

.notif-feed-loading {
    align-items: stretch;
    justify-content: flex-start;
    padding: 0.5rem 0;
    gap: 0.35rem;
}

/* ── Card + stack ─────────────────────────────────────────── */

.notif-card,
.notif-stack {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.12s;
    border-left: 3px solid transparent;
    position: relative;
}

.notif-card:hover,
.notif-stack:hover {
    background: rgba(255, 255, 255, 0.03);
}

.notif-card.is-indented {
    padding-left: 3rem;
    border-left-color: transparent;
}

/* Three-state visuals (Q3a) */
.notif-card.state-unseen,
.notif-stack.state-unseen {
    border-left-color: #0dcaf0;
    background: rgba(13, 202, 240, 0.05);
}

.notif-card.state-unseen .notif-card-title,
.notif-stack.state-unseen .notif-card-title {
    font-weight: 700;
    color: #fff;
}

.notif-card.state-seen .notif-card-title,
.notif-stack.state-seen .notif-card-title {
    font-weight: 600;
    color: #e5e7eb;
}

.notif-card.state-read,
.notif-stack.state-read {
    opacity: 0.55;
}

.notif-card.state-read .notif-card-title {
    font-weight: 400;
}

/* Icon column */
.notif-card-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    font-size: 1.1rem;
    /* No overflow:hidden — lets .notif-stack-count-badge visibly overlap the corner. Avatar imgs below carry their own border-radius. */
}

.notif-card-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.notif-icon-char {
    line-height: 1;
    font-size: 1.3rem;
}

.notif-stack-count-badge {
    position: absolute;
    bottom: -4px;
    right: -4px;
    background: #0dcaf0;
    color: #052029;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(15, 22, 33, 1);
    padding: 0 4px;
    line-height: 1;
}

/* Main column */
.notif-card-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.notif-card-title {
    font-size: 0.9rem;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.notif-card-subtitle {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.55);
    margin-top: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notif-card-badge {
    display: inline-block;
    margin-top: 0.2rem;
    padding: 0.1rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1.4;
    align-self: flex-start;
}

.notif-card-custom {
    margin-top: 0.35rem;
}

.notif-quote {
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
    background: rgba(255, 255, 255, 0.04);
    padding: 0.4rem 0.55rem;
    border-radius: 6px;
    border-left: 2px solid rgba(13, 202, 240, 0.4);
}

/* Meta column */
.notif-card-meta {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
    white-space: nowrap;
}

.notif-card-time {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.45);
}

.notif-card-dismiss {
    background: transparent;
    border: none;
    color: #6b7280;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    padding: 0;
    transition: opacity 0.15s, background 0.15s, color 0.15s;
}

.notif-card:hover .notif-card-dismiss {
    opacity: 1;
}

.notif-card-dismiss:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

/* Touch devices: always show dismiss (no hover) */
@media (hover: none) {
    .notif-card-dismiss {
        opacity: 0.6;
    }
}

/* ── Load-more (history page) ─────────────────────────────── */

.notif-load-more-wrap {
    padding: 1rem;
    text-align: center;
}

.notif-load-more {
    min-width: 200px;
}

/* ── History page wrapper ─────────────────────────────────── */

.notif-history-card {
    display: flex;
    flex-direction: column;
    min-height: 60vh;
    max-height: calc(100vh - 220px);
    padding: 0;
    overflow: hidden;
}

.notif-history-toolbar {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    justify-content: flex-end;
    flex-shrink: 0;
}

/* ── Skeleton loading ─────────────────────────────────────── */

.notif-skeleton-card {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
}

.notif-skeleton-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.12) 50%, rgba(255, 255, 255, 0.05) 100%);
    background-size: 200% 100%;
    animation: notifShimmer 1.5s infinite;
    flex-shrink: 0;
}

.notif-skeleton-lines {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding-top: 0.3rem;
}

.notif-skeleton-line {
    height: 10px;
    border-radius: 4px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.12) 50%, rgba(255, 255, 255, 0.05) 100%);
    background-size: 200% 100%;
    animation: notifShimmer 1.5s infinite;
}

@keyframes notifShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Settings page mute list ──────────────────────────────── */

.notif-prefs-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.notif-prefs-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.6rem 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
}

.notif-prefs-label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: #fff;
    min-width: 0;
    flex: 1;
}
