/* ==========================================================
   ClutchTask – Notifications (notifications.css)
   Ładowany globalnie w base.html – obejmuje dzwonek + dropdown
   w navbarze oraz stronę "All Notifications".
   Używa wyłącznie klas obecnych w szablonach.
   ========================================================== */

.clutch-notif-container,
.clutch-notif-container-wrapper {
    --primary-dark: #3638c5;
    --primary-soft: #f1e9ff;
    --cn-unread-bg: #f3f7ff;
}

.clutch-notif-badge.hidden,
.clutch-notif-dropdown.hidden {
    display: none !important;
}

/* ==========================================================
   1. DZWONEK W NAVBARZE
   ========================================================== */
.clutch-notif-container {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.clutch-notif-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #3a3f63;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.clutch-notif-bell:hover,
.clutch-notif-bell:focus-visible {
    background: var(--primary-soft);
    color: var(--primary);
    outline: none;
}

.clutch-bell-icon {
    width: 24px;
    height: 24px;
}

.clutch-notif-badge {
    position: absolute;
    top: 0;
    right: -2px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(229, 23, 63, 0.35);
}

/* ==========================================================
   2. DROPDOWN W NAVBARZE
   ========================================================== */
.clutch-notif-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 1000;
    width: 420px;
    max-width: calc(100vw - 24px);
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 18px 50px rgba(40, 30, 110, 0.18), 0 3px 10px rgba(40, 30, 110, 0.08);
    overflow: hidden;
}

.clutch-notif-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: #fafaff;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
}

.clutch-notif-link {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
}

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

/* Lista – wspólna dla dropdownu i strony */
.clutch-notif-list {
    display: flex;
    flex-direction: column;
}

.clutch-notif-dropdown .clutch-notif-list {
    max-height: 420px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #c9cde4 transparent;
}

.clutch-notif-empty {
    padding: 36px 20px;
    text-align: center;
    color: var(--muted);
    font-size: 0.93rem;
}

/* ==========================================================
   3. POJEDYNCZE POWIADOMIENIE (notif-message.html)
   ========================================================== */
.clutch-notif-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 22px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-left: 4px solid transparent;
    border-radius: 14px;
    transition: box-shadow 0.15s ease, transform 0.15s ease, background-color 0.15s ease;
}

.clutch-notif-item:hover {
    box-shadow: 0 6px 20px rgba(60, 40, 140, 0.1);
    transform: translateY(-1px);
}

.clutch-notif-unread {
    background: var(--cn-unread-bg);
    border-left-color: var(--primary);
}

.clutch-notif-content-wrapper {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.clutch-notif-item-text {
    color: var(--text-main);
    font-size: 0.97rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.clutch-notif-unread .clutch-notif-item-text {
    font-weight: 600;
}

.clutch-notif-item-time {
    font-size: 0.78rem;
    color: var(--muted);
}

.clutch-notif-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

/* Przycisk "View" */
.clutch-btn-sm {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: 1px solid #d8d2f3;
    border-radius: 9px;
    background: #fff;
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.clutch-btn-sm:hover,
.clutch-btn-sm:focus-visible {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    outline: none;
}

.clutch-btn-arrow {
    width: 13px;
    height: 13px;
    transition: transform 0.15s ease;
}

.clutch-btn-sm:hover .clutch-btn-arrow {
    transform: translateX(2px);
}

/* Wariant kompaktowy w dropdownie */
.clutch-notif-dropdown .clutch-notif-item {
    padding: 13px 16px;
    gap: 12px;
    border: none;
    border-bottom: 1px solid var(--border-color);
    border-left: 3px solid transparent;
    border-radius: 0;
}

.clutch-notif-dropdown .clutch-notif-item:last-child {
    border-bottom: none;
}

.clutch-notif-dropdown .clutch-notif-unread {
    border-left-color: var(--primary);
}

.clutch-notif-dropdown .clutch-notif-item:hover {
    transform: none;
    box-shadow: none;
    background: #f7f5ff;
}

.clutch-notif-dropdown .clutch-notif-item-text {
    font-size: 0.88rem;
}

.clutch-notif-dropdown .clutch-btn-sm {
    padding: 6px 11px;
    font-size: 0.8rem;
}

/* ==========================================================
   4. STRONA "ALL NOTIFICATIONS"
   ========================================================== */
.clutch-notif-container-wrapper {
    max-width: 920px;
    margin: 0 auto;
    padding: 28px 16px 56px;
}

.clutch-notif-container-wrapper > .clutch-notif-list {
    gap: 10px;
}

.clutch-notif-page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 22px;
}

.clutch-notif-header-left {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.clutch-notif-header-left h1 {
    margin: 0;
    font-size: 1.9rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text-main);
}

/* Zakładki All / Unread */
.clutch-filter-tabs {
    display: inline-flex;
    padding: 4px;
    gap: 4px;
    background: #eceefa;
    border-radius: 12px;
}

.clutch-tab-link {
    padding: 7px 18px;
    border-radius: 9px;
    color: #4a5075;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.clutch-tab-link:hover {
    color: var(--primary);
}

.clutch-tab-link.active {
    background: #fff;
    color: var(--primary);
    box-shadow: 0 2px 6px rgba(60, 40, 140, 0.12);
}

/* Mark all as read */
.clutch-btn-mark-all {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border: 1px solid #d8d2f3;
    border-radius: 10px;
    background: #fff;
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.clutch-btn-mark-all i {
    font-size: 1.15rem;
    line-height: 1;
}

.clutch-btn-mark-all:hover,
.clutch-btn-mark-all:focus-visible {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 14px rgba(106, 13, 234, 0.3);
    outline: none;
}

/* ==========================================================
   5. PAGINACJA
   ========================================================== */
.clutch-pagination {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 28px;
}

.clutch-page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    box-sizing: border-box;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: #fff;
    color: #3a3f63;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

a.clutch-page-link:hover {
    background: var(--primary-soft);
    border-color: #d8d2f3;
    color: var(--primary);
}

.clutch-page-link.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(106, 13, 234, 0.3);
}

.clutch-page-disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* ==========================================================
   6. MOBILE
   ========================================================== */
@media (max-width: 640px) {
    .clutch-notif-dropdown {
        position: fixed;
        top: 70px;
        right: 12px;
        left: 12px;
        width: auto;
        max-width: none;
    }

    .clutch-notif-container-wrapper {
        padding: 18px 10px 40px;
    }

    .clutch-notif-header-left h1 {
        font-size: 1.5rem;
    }

    .clutch-notif-container-wrapper > .clutch-notif-list .clutch-notif-item {
        flex-wrap: wrap;
        padding: 14px 16px;
    }

    .clutch-btn-mark-all {
        width: 100%;
        justify-content: center;
    }
}