/**
 * Bildirim çekmecesi — premium UI (PC + mobil, sağdan sola)
 */

.notification-drawer-root {
    /* Site header ile aynı zemin (--header-strip-bg body'de tanımlı) */
    --nd-bg: var(--header-strip-bg, #14151a);
    --nd-surface: var(--surface-card, #1a1c23);
    --nd-surface-2: var(--surface-elevated, #1e1f26);
    --nd-surface-elevated: var(--surface-hover, #25272f);
    --nd-border: var(--header-strip-border, #2d3139);
    --nd-border-strong: rgba(255, 255, 255, 0.12);
    --nd-text: #f0f3f8;
    --nd-muted: #8b95a8;
    --nd-muted-2: #6b7280;
    --nd-accent: #5eb0ff;
    --nd-accent-dim: rgba(94, 176, 255, 0.14);
    --nd-accent-glow: rgba(59, 102, 255, 0.35);
    --nd-danger: #f87171;
    --nd-danger-dim: rgba(248, 113, 113, 0.12);
    --nd-radius-lg: 14px;
    --nd-radius-md: 12px;
    --nd-radius-sm: 10px;
    --nd-font: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --nd-shadow-panel: -16px 0 48px rgba(0, 0, 0, 0.55);
    --nd-shadow-card: 0 2px 12px rgba(0, 0, 0, 0.22);

    position: fixed;
    inset: 0;
    z-index: 100048;
    pointer-events: none;
    font-family: var(--nd-font);
}

.notification-drawer-root.is-open {
    pointer-events: auto;
}

.notification-drawer-overlay {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.notification-drawer-root.is-open .notification-drawer-overlay {
    opacity: 1;
}

.notification-drawer-root .notification-panel {
    position: absolute;
    top: 0;
    right: 0;
    left: auto;
    bottom: 0;
    z-index: 1;
    width: min(440px, 100%);
    max-width: 100%;
    height: 100%;
    max-height: none;
    margin: 0;
    padding: 0;
    padding-top: env(safe-area-inset-top, 0px);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--nd-bg) !important;
    background-color: var(--nd-bg) !important;
    border: none;
    border-left: 1px solid var(--nd-border);
    border-radius: 0;
    box-shadow: var(--nd-shadow-panel);
    color: var(--nd-text);
    color-scheme: dark;
    transform: translateX(100%);
    transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
    animation: none;
}

.notification-drawer-root.is-open .notification-panel {
    transform: translateX(0);
}

.notification-drawer-root .notification-panel.active {
    display: flex;
}

/* —— Üst başlık (liste ile aynı zemin) —— */
.notification-drawer-root header.notification-drawer__head {
    flex-shrink: 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin: 0 !important;
    padding: 20px 20px 16px !important;
    border-top: none !important;
    border-bottom: 1px solid var(--nd-border) !important;
    box-shadow: none !important;
    position: static;
    z-index: auto;
    overflow: visible;
    background: var(--nd-bg) !important;
    background-color: var(--nd-bg) !important;
}

.notification-drawer__brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.notification-drawer__icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--nd-radius-md);
    background: linear-gradient(145deg, rgba(59, 102, 255, 0.28) 0%, rgba(59, 102, 255, 0.08) 100%);
    border: 1px solid rgba(94, 176, 255, 0.35);
    color: var(--nd-accent);
    box-shadow: 0 4px 16px var(--nd-accent-glow);
}

.notification-drawer__icon svg {
    width: 21px;
    height: 21px;
    display: block;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.notification-drawer__title-wrap {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.notification-drawer__head h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.notification-drawer__subtitle {
    margin: 0;
    font-size: 12px;
    font-weight: 500;
    color: var(--nd-muted);
    letter-spacing: 0.01em;
}

.notification-drawer-root button.notification-drawer__close {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    margin: 0;
    border: none !important;
    border-radius: 0 !important;
    -webkit-border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #9ca3af;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-appearance: none;
    appearance: none;
    transition: color 0.2s, opacity 0.2s, transform 0.15s;
}

.notification-drawer-root button.notification-drawer__close:hover {
    color: #ffffff;
    background: transparent !important;
    border: none !important;
    opacity: 1;
}

.notification-drawer-root button.notification-drawer__close:active {
    transform: scale(0.92);
    background: transparent !important;
}

/* —— Hızlı işlemler —— */
.notification-drawer__toolbar {
    flex-shrink: 0;
    margin: 14px 16px 0;
    padding: 12px 14px;
    border-radius: var(--nd-radius-md);
    background: var(--nd-surface);
    border: 1px solid var(--nd-border);
    box-shadow: var(--nd-shadow-card);
}

.notification-drawer__toolbar-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 12px;
}

.notification-drawer__toolbar-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--nd-muted);
}

.notification-drawer__toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-left: auto;
}

/* Hızlı işlem butonları — global 0px radius override’ını geçersiz kıl */
.notification-drawer-root button.notification-drawer__pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 16px;
    min-height: 38px;
    border-radius: 12px !important;
    -webkit-border-radius: 12px !important;
    -moz-border-radius: 12px !important;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    isolation: isolate;
    -webkit-appearance: none;
    appearance: none;
    background-clip: padding-box;
    transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.notification-drawer-root button.notification-drawer__pill i {
    font-size: 11px;
    opacity: 0.92;
    line-height: 1;
}

.notification-drawer-root button.notification-drawer__pill:active {
    transform: scale(0.98);
}

.notification-drawer-root button.notification-drawer__pill--read {
    background: var(--nd-surface-2) !important;
    border: 1px solid var(--nd-border-strong) !important;
    color: #e5e9f2 !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.notification-drawer-root button.notification-drawer__pill--read:hover {
    background: var(--nd-accent-dim) !important;
    border-color: rgba(94, 176, 255, 0.45) !important;
    color: var(--nd-title) !important;
    box-shadow: 0 2px 12px rgba(59, 102, 255, 0.18);
}

.notification-drawer-root button.notification-drawer__pill--delete {
    background: var(--nd-danger-dim) !important;
    border: 1px solid rgba(248, 113, 113, 0.4) !important;
    color: #fca5a5 !important;
}

.notification-drawer-root button.notification-drawer__pill--delete:hover {
    background: rgba(239, 68, 68, 0.2) !important;
    border-color: rgba(248, 113, 113, 0.58) !important;
    color: #fecaca !important;
    box-shadow: 0 2px 12px rgba(239, 68, 68, 0.14);
}

/* —— Arama (köşe: dış kapsayıcıda, input düz) —— */
.notification-drawer__search {
    flex-shrink: 0;
    position: relative;
    margin: 12px 16px 10px;
    display: flex;
    align-items: center;
    border-radius: 14px !important;
    -webkit-border-radius: 14px !important;
    border: 1px solid var(--nd-border);
    background: var(--nd-surface);
    overflow: hidden;
    isolation: isolate;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.12);
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.notification-drawer__search:focus-within {
    border-color: rgba(94, 176, 255, 0.5);
    background: var(--nd-surface-2);
    box-shadow:
        inset 0 1px 2px rgba(0, 0, 0, 0.08),
        0 0 0 3px rgba(94, 176, 255, 0.14);
}

.notification-drawer__search > i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    color: var(--nd-muted-2);
    pointer-events: none;
    z-index: 1;
}

.notification-drawer-root .notification-drawer__search-input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 16px 12px 42px;
    border: none !important;
    border-radius: 0 !important;
    -webkit-border-radius: 0 !important;
    background: transparent !important;
    color: var(--nd-text) !important;
    font-size: 13px;
    font-family: inherit;
    outline: none !important;
    box-shadow: none !important;
    -webkit-appearance: none;
    appearance: none;
}

.notification-drawer-root .notification-drawer__search-input::placeholder {
    color: var(--nd-muted-2);
}

/* WebKit arama iptal ikonu */
.notification-drawer-root .notification-drawer__search-input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
}

/* —— Liste —— */
.notification-drawer-root .notification-list {
    flex: 1;
    min-height: 0;
    max-height: none;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--nd-bg);
    padding: 6px 12px 16px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scroll-padding-bottom: 16px;
    scrollbar-width: thin;
    scrollbar-color: rgba(94, 176, 255, 0.35) transparent;
}

.notification-drawer-root .notification-list::-webkit-scrollbar {
    width: 5px;
}

.notification-drawer-root .notification-list::-webkit-scrollbar-thumb {
    background: rgba(94, 176, 255, 0.35);
    border-radius: 8px;
}

.notification-drawer-root .notification-list::-webkit-scrollbar-thumb:hover {
    background: rgba(94, 176, 255, 0.5);
}

/* Liste öğeleri — kart */
.notification-drawer-root .notification-item {
    margin: 0 0 8px;
    padding: 12px 14px;
    gap: 12px;
    border-radius: var(--nd-radius-md);
    border: 1px solid var(--nd-border);
    background: var(--nd-surface);
    box-shadow: var(--nd-shadow-card);
    transition: background 0.2s, border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}

.notification-drawer-root .notification-item:hover {
    background: var(--nd-surface-2);
    border-color: var(--nd-border-strong);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
}

.notification-drawer-root .notification-item.unread {
    background: linear-gradient(90deg, rgba(59, 102, 255, 0.12) 0%, var(--nd-surface) 42%);
    border-color: rgba(94, 176, 255, 0.22);
    border-left: 3px solid var(--nd-accent);
    padding-left: 12px;
}

.notification-drawer-root .notification-item.unread:hover {
    background: linear-gradient(90deg, rgba(59, 102, 255, 0.16) 0%, var(--nd-surface-2) 42%);
    border-color: rgba(94, 176, 255, 0.32);
}

.notification-drawer-root .notification-avatar,
.notification-drawer-root .notification-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--nd-radius-sm);
}

.notification-drawer-root .notification-brand,
.notification-drawer-root .notification-avatar.admin-avatar {
    border-radius: var(--nd-radius-sm);
}

.notification-drawer-root .notification-title,
.notification-drawer-root .notification-title--system {
    font-size: 13px;
    font-weight: 600;
    color: #f8fafc;
    letter-spacing: -0.01em;
}

.notification-drawer-root .notification-message {
    font-size: 12px;
    color: var(--nd-muted);
    line-height: 1.45;
}

.notification-drawer-root .notification-time {
    font-size: 11px;
    color: var(--nd-muted-2);
    font-weight: 500;
}

.notification-drawer-root .unread-dot {
    top: 14px;
    right: 14px;
    width: 7px;
    height: 7px;
    background: var(--nd-accent);
    box-shadow: 0 0 0 3px rgba(94, 176, 255, 0.2);
}

.notification-drawer-root .notification-item.kyc-notification {
    margin: 0 0 8px;
    border-left-width: 3px;
}

/* Boş / yükleme — panel ile aynı zemin */
.notification-drawer-root .notification-empty,
.notification-drawer-root .notification-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex: 1;
    min-height: min(320px, 50vh);
    width: 100%;
    box-sizing: border-box;
    padding: 48px 24px 40px;
    margin: 0;
    border: none;
    border-radius: 0;
    background: var(--nd-bg);
}

.notification-drawer-root .notification-empty__icon {
    width: 52px;
    height: 52px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--nd-surface);
    border: 1px solid var(--nd-border);
    color: var(--nd-muted);
    font-size: 20px;
}

.notification-drawer-root .notification-empty p {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--nd-muted);
    line-height: 1.5;
    max-width: 220px;
}

.notification-drawer-root .notification-empty__hint {
    margin: 8px 0 0;
    font-size: 12px;
    color: var(--nd-muted-2);
    font-weight: 400;
}

.notification-drawer-root .notification-empty--search {
    margin: 0;
    padding: 32px 20px;
    min-height: 0;
    flex: 0 0 auto;
}

.notification-drawer-root .notification-empty--search .notification-empty__icon {
    color: var(--nd-accent);
    border-color: rgba(94, 176, 255, 0.25);
    background: var(--nd-accent-dim);
}

.notification-drawer-root .notification-loading {
    gap: 12px;
    color: var(--nd-muted);
    font-size: 13px;
    font-weight: 500;
}

.notification-drawer-root .notification-loading i {
    font-size: 22px;
    color: var(--nd-accent);
}

/* Alt — Tümünü gör */
.notification-drawer-root .notification-footer {
    flex-shrink: 0;
    padding: 14px 16px;
    padding-bottom: max(14px, env(safe-area-inset-bottom, 0));
    background: transparent;
    border-top: 1px solid var(--nd-border);
}

.notification-drawer-root .notification-view-all {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 13px 18px;
    border-radius: var(--nd-radius-md);
    font-size: 13px;
    font-weight: 600;
    color: #ffffff; /* gradient buton — her modda beyaz metin */
    text-decoration: none;
    background: linear-gradient(135deg, #3b66ff 0%, #5b8cff 50%, #4f7cff 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow:
        0 4px 14px rgba(59, 102, 255, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transition: transform 0.15s, box-shadow 0.2s, filter 0.2s;
}

.notification-drawer-root .notification-view-all:hover {
    opacity: 1;
    filter: brightness(1.06);
    box-shadow:
        0 6px 20px rgba(59, 102, 255, 0.42),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.notification-drawer-root .notification-view-all:active {
    transform: scale(0.99);
}

.notification-drawer-root .notification-view-all i {
    font-size: 11px;
    opacity: 0.9;
    transition: transform 0.2s;
}

.notification-drawer-root .notification-view-all:hover i {
    transform: translateX(3px);
}

html.notification-drawer-open,
body.notification-drawer-open {
    overflow: hidden !important;
    overscroll-behavior: none;
}

/* Beyaz mod — header ile aynı arka plan */
body.light-mode .notification-drawer-root {
    --nd-bg: var(--header-strip-bg, #ffffff);
    --nd-surface: #f8f9fa;
    --nd-surface-2: #f1f3f5;
    --nd-surface-elevated: #e9ecef;
    --nd-border: var(--header-strip-border, rgba(74, 158, 255, 0.15));
    --nd-border-strong: rgba(0, 0, 0, 0.1);
    --nd-text: #1f2937;
    --nd-muted: #6b7280;
    --nd-muted-2: #9ca3af;
    --nd-shadow-panel: -16px 0 40px rgba(0, 0, 0, 0.12);
    --nd-shadow-card: 0 1px 4px rgba(0, 0, 0, 0.06);
}

body.light-mode .notification-drawer-root .notification-panel {
    color-scheme: light;
    border-left-color: var(--nd-border);
}

body.light-mode .notification-drawer-root .notification-drawer__head h2 {
    color: #111827;
}

body.light-mode .notification-drawer-root .notification-title,
body.light-mode .notification-drawer-root .notification-title--system {
    color: #111827;
}

body.light-mode .notification-drawer-root .notification-item.unread {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.08) 0%, var(--nd-surface) 42%);
    border-color: rgba(37, 99, 235, 0.2);
}

body.light-mode .notification-drawer-root .notification-drawer__icon {
    background: linear-gradient(145deg, rgba(37, 99, 235, 0.12) 0%, rgba(37, 99, 255, 0.05) 100%);
    border-color: rgba(37, 99, 235, 0.25);
    color: #2563eb;
}

body.light-mode .notification-drawer-root .notification-drawer__search {
    background: var(--nd-surface);
    border-color: var(--nd-border);
}

body.dark-mode .notification-drawer-root .notification-panel {
    color-scheme: dark;
    border-left-color: var(--nd-border);
}

@media (max-width: 480px) {
    .notification-drawer-root .notification-panel {
        width: 100%;
    }

    .notification-drawer__head {
        padding: 18px 16px 14px;
    }

    .notification-drawer__toolbar {
        margin-left: 12px;
        margin-right: 12px;
    }

    .notification-drawer__search {
        margin-left: 12px;
        margin-right: 12px;
    }

    .notification-drawer__toolbar-row {
        flex-direction: column;
        align-items: stretch;
    }

    .notification-drawer__toolbar-actions {
        margin-left: 0;
        width: 100%;
    }

    .notification-drawer-root button.notification-drawer__pill {
        flex: 1;
        justify-content: center;
    }

    .notification-drawer-root .notification-list {
        padding-left: 10px;
        padding-right: 10px;
    }
}

@media (min-width: 600px) and (max-width: 1024px) {
    .notification-drawer-root .notification-panel {
        width: min(440px, 92vw);
    }
}

@media (prefers-reduced-motion: reduce) {
    .notification-drawer-root .notification-panel,
    .notification-drawer-overlay,
    .notification-drawer-root .notification-item {
        transition: none;
    }
}
