/* ============================================
   NOTIFICATION DROPDOWN - 2026 MODERN DESIGN
   ============================================ */

/* Dropdown Container Reset */
[id^="notifDropdownWrapper"] .dropdown-menu {
    padding: 0 !important;
    overflow: hidden !important;
    min-width: min(360px, calc(100vw - 24px)) !important;
    max-width: min(400px, calc(100vw - 24px)) !important;
    border: none !important;
    border-radius: 8px !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.18) !important;
    background: #ffffff !important;
}

@media (max-width: 991px) {
    [id^="notifDropdownWrapper"] .dropdown-menu.show:has(.notif-dropdown-header-wrapper),
    [id^="notifDropdownWrapper"] .dropdown-menu.nav-notif-dropdown-menu.show {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100dvh !important;
        border-radius: 0 !important;
        transform: none !important;
        max-height: 100dvh !important;
        display: flex !important;
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        z-index: 1050 !important;
        border: none !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #ffffff !important;
    }

    [id^="notifDropdownWrapper"] .notif-dropdown-header-wrapper {
        padding: 30px 15px 20px 15px !important;
        background: #f8fafc !important;
        border-bottom: 1px solid #e2e8f0 !important;
        flex-shrink: 0 !important;
    }

    [id^="notifDropdownWrapper"] .notif-dropdown-title {
        font-size: 1.4rem !important;
        font-weight: 800 !important;
    }

    [id^="notifDropdownWrapper"] .notif-list-wrapper {
        flex: 1 1 auto !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        background: #fff !important;
    }

    [id^="notifDropdownWrapper"] .notif-item {
        padding: 20px 15px !important;
        border-bottom: 1px solid #f1f5f9 !important;
    }

    [id^="notifDropdownWrapper"] .notif-footer-wrapper {
        padding: 20px 15px calc(20px + env(safe-area-inset-bottom)) 15px !important;
        background: #f8fafc !important;
        border-top: 1px solid #e2e8f0 !important;
        flex-shrink: 0 !important;
        margin-top: auto !important;
    }

    [id^="notifDropdownWrapper"] .notif-footer-link {
        font-size: 1.15rem !important;
        font-weight: 700 !important;
        width: 100% !important;
        display: flex !important;
        justify-content: space-between !important;
        color: #0d6efd !important;
    }
}

/* Reset all li elements inside */
[id^="notifDropdownWrapper"] .dropdown-menu > li {
    padding: 0 !important;
    margin: 0 !important;
    list-style: none !important;
    border: none !important;
}

/* Header Wrapper */
[id^="notifDropdownWrapper"] .notif-dropdown-header-wrapper {
    background: transparent !important;
}

[id^="notifDropdownWrapper"] .notif-dropdown-header {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e2e8f0;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

[id^="notifDropdownWrapper"] .notif-dropdown-title {
    font-size: 0.85rem;
    font-weight: 800;
    color: #1e293b;
    letter-spacing: 0;
    text-transform: uppercase;
    margin: 0;
    background: none;
    padding: 0;
}

[id^="notifDropdownWrapper"] .notif-dropdown-title i {
    color: #3b82f6;
}

[id^="notifDropdownWrapper"] .notif-mark-all-btn {
    font-size: 0.8rem;
    font-weight: 700;
    color: #3b82f6;
    background: none;
    border: none;
    padding: 8px 12px;
    min-height: 44px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

[id^="notifDropdownWrapper"] .notif-mark-all-btn:hover {
    background: #dbeafe;
    color: #1d4ed8;
}

/* List Wrapper */
[id^="notifDropdownWrapper"] .notif-list-wrapper {
    background: transparent !important;
}

[id^="notifDropdownWrapper"] .notif-list-container {
    max-height: 380px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
    background: #ffffff;
}

[id^="notifDropdownWrapper"] .notif-list-container::-webkit-scrollbar {
    width: 5px;
}

[id^="notifDropdownWrapper"] .notif-list-container::-webkit-scrollbar-track {
    background: transparent;
}

[id^="notifDropdownWrapper"] .notif-list-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

/* Notification Item */
[id^="notifDropdownWrapper"] .notif-item {
    display: flex !important;
    gap: 12px !important;
    padding: 14px 16px !important;
    border-bottom: 1px solid #f1f5f9 !important;
    text-decoration: none !important;
    transition: background-color 0.15s ease, border-color 0.15s ease !important;
    position: relative !important;
    background: #ffffff !important;
    color: inherit !important;
}

[id^="notifDropdownWrapper"] .notif-item:last-child {
    border-bottom: none !important;
}

[id^="notifDropdownWrapper"] .notif-item:hover {
    background: #f8fafc !important;
}

[id^="notifDropdownWrapper"] .notif-item.unread {
    background: linear-gradient(90deg, #eff6ff 0%, #ffffff 100%) !important;
    border-left: 3px solid #3b82f6 !important;
}

[id^="notifDropdownWrapper"] .notif-item.unread:hover {
    background: linear-gradient(90deg, #dbeafe 0%, #f1f5f9 100%) !important;
}

/* Notification Icon — 2026 soft gradient + subtle shadow (notification_list.css ile uyumlu) */
[id^="notifDropdownWrapper"] .notif-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    box-shadow: 0 2px 6px -2px rgba(15, 23, 42, 0.1);
}

[id^="notifDropdownWrapper"] .notif-icon.connections { background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%); color: #2563eb; }
[id^="notifDropdownWrapper"] .notif-icon.messages    { background: linear-gradient(135deg, #cffafe 0%, #a5f3fc 100%); color: #0891b2; }
[id^="notifDropdownWrapper"] .notif-icon.tenders     { background: linear-gradient(135deg, #fed7aa 0%, #fdba74 100%); color: #c2410c; }
[id^="notifDropdownWrapper"] .notif-icon.purchases   { background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%); color: #16a34a; }
[id^="notifDropdownWrapper"] .notif-icon.properties  { background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%); color: #059669; }
[id^="notifDropdownWrapper"] .notif-icon.documents   { background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%); color: #4f46e5; }
[id^="notifDropdownWrapper"] .notif-icon.payments    { background: linear-gradient(135deg, #d1fae5 0%, #6ee7b7 100%); color: #047857; }
[id^="notifDropdownWrapper"] .notif-icon.consultations { background: linear-gradient(135deg, #f3e8ff 0%, #d8b4fe 100%); color: #7c3aed; }
[id^="notifDropdownWrapper"] .notif-icon.gamification { background: linear-gradient(135deg, #fef3c7 0%, #fde047 100%); color: #a16207; }
[id^="notifDropdownWrapper"] .notif-icon.talent      { background: linear-gradient(135deg, #ccfbf1 0%, #5eead4 100%); color: #0d9488; }
[id^="notifDropdownWrapper"] .notif-icon.system      { background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%); color: #b45309; }
[id^="notifDropdownWrapper"] .notif-icon.other       { background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%); color: #64748b; }

/* Notification Content */
[id^="notifDropdownWrapper"] .notif-content {
    flex: 1;
    min-width: 0;
}

[id^="notifDropdownWrapper"] .notif-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 4px;
}

[id^="notifDropdownWrapper"] .notif-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.3;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 180px;
    background: none;
    padding: 0;
}

[id^="notifDropdownWrapper"] .notif-time {
    font-size: 0.68rem;
    color: #94a3b8;
    white-space: nowrap;
    margin-left: 8px;
    flex-shrink: 0;
}

[id^="notifDropdownWrapper"] .notif-message {
    font-size: 0.78rem;
    color: #64748b;
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

[id^="notifDropdownWrapper"] .notif-unread-dot {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: #3b82f6;
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Empty State */
[id^="notifDropdownWrapper"] .notif-empty {
    padding: 40px 20px;
    text-align: center;
    background: #ffffff;
}

[id^="notifDropdownWrapper"] .notif-loading {
    padding: 40px 20px;
    text-align: center;
}

[id^="notifDropdownWrapper"] .notif-empty-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #f1f5f9;
    color: #667085;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 12px;
}

[id^="notifDropdownWrapper"] .notif-empty-text {
    font-size: 0.85rem;
    color: #64748b;
    margin: 0 0 8px;
}

[id^="notifDropdownWrapper"] .notif-empty-link {
    font-size: 0.8rem;
    font-weight: 700;
    color: #1d4ed8 !important;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    background: none !important;
}

[id^="notifDropdownWrapper"] .notif-empty-icon-error {
    background: #fee2e2;
    color: #b42318;
}

[id^="notifDropdownWrapper"] .notif-empty-link-btn {
    border: none;
    background: none;
    cursor: pointer;
}

[id^="notifDropdownWrapper"] .notif-empty-link:hover {
    color: #1d4ed8 !important;
}

/* Footer */
[id^="notifDropdownWrapper"] .notif-footer-wrapper {
    background: transparent !important;
}

[id^="notifDropdownWrapper"] .notif-footer {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-top: 1px solid #e2e8f0;
    padding: 10px 16px;
    text-align: center;
}

[id^="notifDropdownWrapper"] .notif-footer-link {
    font-size: 0.8rem;
    font-weight: 700;
    color: #3b82f6 !important;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s ease;
    padding: 0;
    background: none !important;
}

[id^="notifDropdownWrapper"] .notif-footer-link:hover {
    color: #1d4ed8 !important;
}

/* ============================================
   DARK MODE SUPPORT
   ============================================ */

html[data-theme='dark'] [id^="notifDropdownWrapper"] .dropdown-menu {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
}

html[data-theme='dark'] [id^="notifDropdownWrapper"] .notif-dropdown-header {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    border-bottom-color: #475569;
}

html[data-theme='dark'] [id^="notifDropdownWrapper"] .notif-dropdown-title {
    color: #f1f5f9;
}

html[data-theme='dark'] [id^="notifDropdownWrapper"] .notif-list-container {
    background: #1e293b;
}

html[data-theme='dark'] [id^="notifDropdownWrapper"] .notif-item {
    border-bottom-color: #334155 !important;
    background: #1e293b !important;
}

html[data-theme='dark'] [id^="notifDropdownWrapper"] .notif-item:hover {
    background: #334155 !important;
}

html[data-theme='dark'] [id^="notifDropdownWrapper"] .notif-item.unread {
    background: linear-gradient(90deg, #1e3a5f 0%, #1e293b 100%) !important;
}

html[data-theme='dark'] [id^="notifDropdownWrapper"] .notif-title {
    color: #f1f5f9;
}

html[data-theme='dark'] [id^="notifDropdownWrapper"] .notif-message {
    color: #94a3b8;
}

html[data-theme='dark'] [id^="notifDropdownWrapper"] .notif-footer {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    border-top-color: #475569;
}

html[data-theme='dark'] [id^="notifDropdownWrapper"] .notif-empty {
    background: #1e293b;
}

html[data-theme='dark'] [id^="notifDropdownWrapper"] .notif-empty-icon {
    background: #334155;
    color: #cbd5e1;
}

html[data-theme='dark'] [id^="notifDropdownWrapper"] .notif-empty-text {
    color: #94a3b8;
}

/* ============================================
   MOBİL UYUMLULUK
   ============================================ */
@media (max-width: 575.98px) {
    [id^="notifDropdownWrapper"] .dropdown-menu {
        position: fixed !important;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        min-width: 100% !important;
        max-width: 100% !important;
        border-radius: 8px 8px 0 0 !important;
        box-shadow: 0 -8px 40px rgba(0,0,0,0.2) !important;
        transform: none !important;
        max-height: 80vh;
        max-height: 80dvh;
        max-height: calc(var(--visual-viewport-height, 100dvh) - 8px);
        padding-bottom: env(safe-area-inset-bottom, 0px);
        overscroll-behavior: contain;
    }

    [id^="notifDropdownWrapper"] .notif-list-container {
        max-height: 55vh;
        max-height: 55dvh;
        max-height: calc(var(--visual-viewport-height, 100dvh) - 168px);
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    [id^="notifDropdownWrapper"] .notif-dropdown-header {
        position: sticky;
        top: 0;
        z-index: 2;
    }

    [id^="notifDropdownWrapper"] .notif-footer {
        position: sticky;
        bottom: 0;
        z-index: 2;
        padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    }

    [id^="notifDropdownWrapper"] .notif-item {
        padding: 12px 14px !important;
    }

    [id^="notifDropdownWrapper"] .notif-title {
        max-width: 65vw;
    }

    [id^="notifDropdownWrapper"] .notif-icon {
        width: 36px;
        height: 36px;
        border-radius: 8px;
    }

    [id^="notifDropdownWrapper"] .notif-item,
    [id^="notifDropdownWrapper"] .notif-mark-all-btn,
    [id^="notifDropdownWrapper"] .notif-footer-link {
        min-height: 44px;
    }
}

html.mobile-keyboard-open [id^="notifDropdownWrapper"] .dropdown-menu {
    max-height: calc(var(--visual-viewport-height, 100dvh) - 8px) !important;
}

/* Tablet (576px - 991px) */
@media (min-width: 576px) and (max-width: 991.98px) {
    [id^="notifDropdownWrapper"] .dropdown-menu {
        min-width: 340px !important;
        max-width: 380px !important;
    }
}

/* ── Touch Cihazlar ──────────────────────────────────────────── */
@media (pointer: coarse) {
    [id^="notifDropdownWrapper"] .notif-item {
        min-height: 56px;
    }

    [id^="notifDropdownWrapper"] .notif-mark-all-btn {
        min-height: 44px;
    }

    [id^="notifDropdownWrapper"] .notif-footer-link {
        min-height: 44px;
    }

    /* Touch hover devre dışı */
    [id^="notifDropdownWrapper"] .notif-item:hover {
        background: inherit !important;
    }

    [id^="notifDropdownWrapper"] .notif-item.unread:hover {
        background: linear-gradient(90deg, #eff6ff 0%, #ffffff 100%) !important;
    }

    [id^="notifDropdownWrapper"] .notif-mark-all-btn:hover {
        background: none;
    }

    /* Touch scroll */
    [id^="notifDropdownWrapper"] .notif-list-container {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
}

/* ── Reduced Motion ──────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    [id^="notifDropdownWrapper"] .notif-item,
    [id^="notifDropdownWrapper"] .notif-mark-all-btn,
    [id^="notifDropdownWrapper"] .notif-footer-link,
    [id^="notifDropdownWrapper"] .notif-unread-dot {
        transition: none !important;
    }

    [id^="notifDropdownWrapper"] .dropdown-menu {
        transition: none !important;
    }
}

/* ── Retina / HiDPI ──────────────────────────────────────────── */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    [id^="notifDropdownWrapper"] .notif-item {
        border-bottom-width: 0.5px !important;
    }

    [id^="notifDropdownWrapper"] .notif-dropdown-header {
        border-bottom-width: 0.5px;
    }

    [id^="notifDropdownWrapper"] .notif-footer {
        border-top-width: 0.5px;
    }
}

/* ============================================
   HEADER ACTIONS (Mark-all + Close)
   ============================================ */
[id^="notifDropdownWrapper"] .notif-dropdown-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

[id^="notifDropdownWrapper"] .notif-dropdown-close {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 8px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    line-height: 1;
    transition: background-color 0.2s ease, color 0.2s ease;
}

[id^="notifDropdownWrapper"] .notif-dropdown-close:hover,
[id^="notifDropdownWrapper"] .notif-dropdown-close:focus-visible {
    background: #f1f5f9;
    color: #0f172a;
    outline: none;
}

html[data-theme='dark'] [id^="notifDropdownWrapper"] .notif-dropdown-close {
    color: #94a3b8;
}

html[data-theme='dark'] [id^="notifDropdownWrapper"] .notif-dropdown-close:hover,
html[data-theme='dark'] [id^="notifDropdownWrapper"] .notif-dropdown-close:focus-visible {
    background: #334155;
    color: #f1f5f9;
}

/* Final dropdown contrast pass. Small timestamps need a readable light-theme
   tone, and the mobile wrapper surfaces have important light declarations near
   the top of this file that must be resolved last in dark mode. */
[id^="notifDropdownWrapper"] .notif-time {
    color: #64748b;
    font-weight: 600;
}

html[data-theme='dark'] [id^="notifDropdownWrapper"] .notif-time {
    color: #cbd5e1;
}

@media (max-width: 991px) {
    html[data-theme='dark'] [id^="notifDropdownWrapper"] .dropdown-menu.show:has(.notif-dropdown-header-wrapper),
    html[data-theme='dark'] [id^="notifDropdownWrapper"] .dropdown-menu.nav-notif-dropdown-menu.show,
    html[data-theme='dark'] [id^="notifDropdownWrapper"] .notif-list-wrapper {
        background: #1e293b !important;
    }

    html[data-theme='dark'] [id^="notifDropdownWrapper"] .dropdown-menu > .notif-dropdown-header-wrapper,
    html[data-theme='dark'] [id^="notifDropdownWrapper"] .dropdown-menu > .notif-footer-wrapper {
        background: #1e293b !important;
        border-color: #475569 !important;
    }

    html[data-theme='dark'] [id^="notifDropdownWrapper"] .dropdown-menu > .notif-dropdown-header-wrapper {
        border-bottom: 1px solid #475569 !important;
    }

    html[data-theme='dark'] [id^="notifDropdownWrapper"] .dropdown-menu > .notif-footer-wrapper {
        border-top: 1px solid #475569 !important;
    }
}

@media (pointer: coarse) {
    html[data-theme='dark'] [id^="notifDropdownWrapper"] .notif-item.unread:hover {
        background: linear-gradient(90deg, #1e3a5f 0%, #1e293b 100%) !important;
    }
}
