/**
 * Bildirim paneli — referans tasarım (Notifications dropdown)
 * Badge zil ikonunun üzerinde, panel modern liste görünümü.
 */

/* --- Tetikleyici buton: sadece zil, badge zilin üstünde --- */
.notif-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.notif-trigger__icon {
  font-size: 1.35rem;
  display: block;
  line-height: 1;
}

/* Badge: zil ikonunun sağ üst köşesinde, üzerinde duracak — okunaklı ve şık */
.notif-trigger__badge,
.topbar-badge.notif-trigger__badge {
  position: absolute;
  top: -3px !important;
  right: 0px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: #fff;
  background: linear-gradient(180deg, #f06548 0%, #e85538 100%);
  border-radius: 10px;
  /* border: 2px solid var(--vz-topbar-bg, #fff); */
  box-sizing: border-box;
  box-shadow: 0 1px 4px rgba(240, 101, 72, 0.4), 0 2px 8px rgba(0, 0, 0, 0.12);
}

[data-bs-theme="dark"] .notif-trigger__badge,
[data-bs-theme="dark"] .topbar-badge.notif-trigger__badge {
  box-shadow: 0 1px 4px rgba(240, 101, 72, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3);
}

.notif-trigger__badge[data-notif-count="0"],
.topbar-badge[data-notif-count="0"] {
  display: none !important;
}

/* --- Panel container --- */
.notif-panel {
  width: 400px;
  max-width: calc(100vw - 24px);
  margin-top: 10px;
  padding: 0;
  border: 1px solid var(--vz-border-color);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1), 0 4px 12px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  background: var(--vz-body-bg);
}

/* --- Panel başlık: Bildirimler + Tümünü okundu işaretle --- */
.notif-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--vz-border-color);
  background: var(--vz-body-bg);
}

.notif-panel__head-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.notif-panel__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--vz-primary);
  color: #fff;
  font-size: 1.125rem;
}

.notif-panel__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--vz-body-color);
  letter-spacing: -0.02em;
}

.notif-panel__mark-all {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--vz-primary);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.notif-panel__mark-all:hover {
  color: var(--vz-primary);
  opacity: 0.85;
  text-decoration: underline;
}

.notif-panel__mark-all:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* --- Tab bar --- */
.notif-panel__tabs {
  display: flex;
  border-bottom: 2px solid var(--vz-border-color);
  background: var(--vz-body-bg);
  padding: 0 20px;
  gap: 0;
}

.notif-panel__tab {
  position: relative;
  flex: 1;
  padding: 10px 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--vz-secondary);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.notif-panel__tab:hover {
  color: var(--vz-body-color);
}

.notif-panel__tab--active {
  color: var(--vz-primary);
  border-bottom-color: var(--vz-primary);
}

.notif-panel__tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 18px;
  color: #fff;
  background: var(--vz-danger);
  border-radius: 9px;
}

.notif-panel__tab-badge:empty {
  display: none;
}

/* --- Panel body (liste alanı) --- */
.notif-panel__body,
.notification-dropdown-body,
.notification-dropdown-body-read {
  max-height: 380px;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--vz-body-bg);
  scrollbar-width: thin;
  scrollbar-color: var(--vz-border-color) transparent;
}

.notif-panel__body::-webkit-scrollbar,
.notification-dropdown-body::-webkit-scrollbar,
.notification-dropdown-body-read::-webkit-scrollbar {
  width: 6px;
}

.notif-panel__body::-webkit-scrollbar-track,
.notification-dropdown-body::-webkit-scrollbar-track,
.notification-dropdown-body-read::-webkit-scrollbar-track {
  background: transparent;
}

.notif-panel__body::-webkit-scrollbar-thumb,
.notification-dropdown-body::-webkit-scrollbar-thumb,
.notification-dropdown-body-read::-webkit-scrollbar-thumb {
  background: var(--vz-border-color);
  border-radius: 3px;
}

/* --- Load more (scroll ile daha fazla yükle) --- */
.notif-load-more {
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 24px;
  text-align: center;
  border-bottom: 1px solid var(--vz-border-color);
  background: var(--vz-body-bg);
}

.notif-load-more .notif-loading__text {
  font-size: 0.8125rem;
}

/* --- Loading --- */
.notif-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 24px;
  text-align: center;
}

.notif-loading__spinner {
  display: block;
  width: 32px;
  height: 32px;
  border: 3px solid var(--vz-border-color);
  border-top-color: var(--vz-primary);
  border-radius: 50%;
  animation: notif-spin 0.7s linear infinite;
}

@keyframes notif-spin {
  to { transform: rotate(360deg); }
}

.notif-loading__text {
  font-size: 0.875rem;
  color: var(--vz-secondary);
}

/* --- Liste: her öğe çizgi ile ayrılmış, referans görsel gibi --- */
.notif-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--vz-border-color);
  transition: background-color 0.15s ease;
}

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

.notif-item:hover {
  background-color: var(--vz-gray-100);
}

.notif-item--unread {
  background-color: rgba(var(--vz-primary-rgb, 75, 56, 179), 0.06);
}

.notif-item--unread:hover {
  background-color: rgba(var(--vz-primary-rgb, 75, 56, 179), 0.1);
}

/* Avatar/ikon alanı: okunmamışta nokta --- */
.notif-item__avatar {
  position: relative;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--vz-gray-200);
  color: var(--vz-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
}

.notif-item--unread .notif-item__avatar::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--vz-danger);
  border: 2px solid var(--vz-body-bg);
}

.notif-item__content {
  flex: 1;
  min-width: 0;
}

.notif-item__link {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.notif-item__link--static {
  cursor: default;
}

.notif-item__link:hover .notif-item__title {
  color: var(--vz-primary);
}

/* Zaman: küçük, soluk (örn. "8 dk önce") */
.notif-item__time {
  display: block;
  font-size: 0.75rem;
  color: var(--vz-secondary);
  margin-bottom: 4px;
}

/* Başlık: kalın */
.notif-item__title {
  display: block;
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--vz-body-color);
  margin-bottom: 4px;
  transition: color 0.15s ease;
}

/* Mesaj: normal, 2 satır clamp */
.notif-item__message {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--vz-secondary);
  margin: 0 0 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Okunma zamanı etiketi */
.notif-item__read-time {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--vz-success);
  margin-bottom: 4px;
}

.notif-item__read-time i {
  font-size: 0.875rem;
}

/* Detay linki */
.notif-item__cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--vz-primary);
  transition: color 0.2s ease;
}

.notif-item__cta i {
  font-size: 1rem;
}

/* Okundu butonu */
.notif-item__read {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--vz-secondary);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.notif-item__read:hover {
  color: var(--vz-success);
  background: rgba(var(--vz-success-rgb, 69, 203, 133), 0.12);
}

/* --- Boş durum --- */
.notif-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 24px;
  text-align: center;
}

.notif-empty__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--vz-gray-200);
  color: var(--vz-secondary);
  font-size: 1.5rem;
}

.notif-empty__p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--vz-secondary);
}

/* --- Footer: klavye ipucu + Bildirimleri yönet --- */
.notif-panel__footer {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-top: 1px solid var(--vz-border-color);
  background: var(--vz-gray-100, #f1f3f5);
  font-size: 0.6875rem;
  color: var(--vz-secondary);
}

.notif-panel__footer-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
  width: 100%;
}

.notif-panel__footer-stat {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 0.6875rem;
  color: var(--vz-secondary);
  border-right: 1px solid var(--vz-border-color);
}

.notif-panel__footer-stat:last-child {
  border-right: none;
}

.notif-panel__footer-stat strong {
  margin-left: 2px;
  color: var(--vz-body-color);
  font-weight: 600;
  min-width: 1.25em;
  text-align: right;
}

.notif-panel__footer-hint {
  margin: 0;
}

.notif-panel__footer-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--vz-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.notif-panel__footer-link:hover {
  color: var(--vz-primary);
  opacity: 0.9;
}

/* --- Dark theme --- */
[data-bs-theme="dark"] .notif-item:hover {
  background-color: rgba(255, 255, 255, 0.06);
}

[data-bs-theme="dark"] .notif-item--unread {
  background-color: rgba(var(--vz-primary-rgb, 75, 56, 179), 0.12);
}

[data-bs-theme="dark"] .notif-item--unread:hover {
  background-color: rgba(var(--vz-primary-rgb, 75, 56, 179), 0.18);
}

[data-bs-theme="dark"] .notif-item__read:hover {
  background: rgba(var(--vz-success-rgb, 69, 203, 133), 0.15);
}

[data-bs-theme="dark"] .notif-empty__icon {
  background: rgba(255, 255, 255, 0.1);
  color: var(--vz-secondary);
}

[data-bs-theme="dark"] .notif-panel__footer {
  background: rgba(255, 255, 255, 0.06);
}

[data-bs-theme="dark"] .notif-panel__footer-stat {
  border-right-color: rgba(255, 255, 255, 0.12);
}
