/* Katha Varnika — Notifications UI */
.kv-notif-wrap,
.kv-notif-page {
  --kv-notif-bg: #ffffff;
  --kv-notif-bg-soft: #fff8f4;
  --kv-notif-bg-muted: #fafafa;
  --kv-notif-border: #ececec;
  --kv-notif-border-strong: #e8ddd6;
  --kv-notif-text: #212529;
  --kv-notif-heading: #2d465e;
  --kv-notif-muted: #6c757d;
  --kv-notif-dim: #9aa3ab;
  --kv-notif-accent: #f75815;
  --kv-notif-accent-soft: #fff4ee;
  --kv-notif-accent-hover: #e04f10;
  --kv-notif-premium: #9a6700;
  --kv-notif-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
  --kv-notif-radius: 12px;
}

.kv-notif-scroll {
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: #d8d8d8 transparent;
}

.kv-notif-scroll::-webkit-scrollbar {
  width: 5px;
}

.kv-notif-scroll::-webkit-scrollbar-thumb {
  background: #d0d0d0;
  border-radius: 999px;
}

.kv-notif-scroll::-webkit-scrollbar-thumb:hover {
  background: #b8b8b8;
}

body.kv-notif-panel-open {
  overflow: hidden;
}

/* Bell */
.kv-notif-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  z-index: 100002;
}

.kv-notif-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid #f0d5c8;
  border-radius: 999px;
  background: #fff;
  color: var(--kv-notif-accent);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(247, 88, 21, 0.1);
}

.kv-notif-bell:hover,
.kv-notif-wrap--open .kv-notif-bell {
  background: var(--kv-notif-accent);
  border-color: var(--kv-notif-accent);
  color: #fff;
  box-shadow: 0 4px 14px rgba(247, 88, 21, 0.28);
}

.kv-notif-bell .bi {
  font-size: 18px;
  line-height: 1;
}

.kv-notif-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #e11d48;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 0 2px #fff;
}

/* Backdrop */
.kv-notif-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 100000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.kv-notif-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

/* Right drawer panel */
.kv-notif-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(400px, 100vw);
  height: 100vh;
  height: 100dvh;
  background: #fff;
  z-index: 100001;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -8px 0 40px rgba(0, 0, 0, 0.15);
  border-left: 1px solid #eee;
  overflow: hidden;
}

.kv-notif-panel.is-open {
  transform: translateX(0);
}

.kv-notif-panel[hidden]:not(.is-open) {
  display: none !important;
}

.kv-notif-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 20px 18px;
  background: linear-gradient(135deg, #f75815 0%, #ff7a2f 100%);
  flex: 0 0 auto;
}

.kv-notif-panel-head-text {
  min-width: 0;
}

.kv-notif-panel-title {
  margin: 0;
  font-family: var(--heading-font, "Nunito", sans-serif);
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.kv-notif-panel-subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.88);
  font-weight: 500;
}

.kv-notif-panel-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s ease;
}

.kv-notif-panel-close:hover {
  background: rgba(255, 255, 255, 0.32);
}

.kv-notif-panel-body {
  flex: 1 1 auto;
  min-height: 0;
  background: #fff;
  padding: 0;
}

.kv-notif-panel-push {
  flex: 0 0 auto;
  padding: 12px 16px 0;
  background: #fff;
  border-bottom: 1px solid var(--kv-notif-border);
}

.kv-notif-panel-push .kv-notif-push-prompt {
  margin-bottom: 12px;
}

.kv-notif-push-inlist {
  padding: 12px 14px 4px;
  background: #fff;
  border-bottom: 1px solid var(--kv-notif-border);
  position: sticky;
  top: 0;
  z-index: 2;
}

.kv-notif-push-inlist .kv-notif-push-prompt {
  margin-bottom: 0;
}

.kv-notif-panel-foot {
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--kv-notif-border);
  background: #fff;
  flex: 0 0 auto;
}

.kv-notif-view-all {
  display: block;
  text-align: center;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--kv-notif-accent);
  border: none;
  transition: background 0.2s ease;
}

.kv-notif-view-all:hover {
  background: var(--kv-notif-accent-hover);
  color: #fff;
}

/* Notification rows */
.kv-notif-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid #f2f2f2;
  background: #fff;
  color: inherit;
  text-decoration: none;
  transition: background 0.15s ease;
}

.kv-notif-row:last-child {
  border-bottom: 0;
}

.kv-notif-row:hover {
  background: #fafafa;
}

.kv-notif-row--unread {
  background: #fffaf7;
  box-shadow: inset 3px 0 0 var(--kv-notif-accent);
}

.kv-notif-row:not(.kv-notif-row--unread) .kv-notif-unread-dot {
  display: none;
}

.kv-notif-thumb {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  border-radius: 10px;
  overflow: hidden;
  background: #f5f5f5;
  border: 1px solid #eee;
}

.kv-notif-panel .kv-notif-thumb {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  border-radius: 8px;
}

.kv-notif-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.kv-notif-thumb-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: #bbb;
  font-size: 22px;
}

.kv-notif-row-body {
  flex: 1;
  min-width: 0;
}

.kv-notif-row-title-wrap {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.kv-notif-row-title {
  flex: 1;
  color: var(--kv-notif-heading);
  font-family: var(--heading-font, "Nunito", sans-serif);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.kv-notif-panel .kv-notif-row-title {
  font-size: 14px;
}

.kv-notif-unread-dot {
  flex: 0 0 7px;
  width: 7px;
  height: 7px;
  margin-top: 7px;
  border-radius: 999px;
  background: var(--kv-notif-accent);
}

.kv-notif-row-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 5px;
}

.kv-notif-row-time {
  color: var(--kv-notif-muted);
  font-size: 12px;
}

.kv-notif-premium {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fff8e6;
  color: var(--kv-notif-premium);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.kv-notif-premium::before {
  content: "★";
  margin-right: 4px;
  font-size: 9px;
}

.kv-notif-row-chevron {
  flex: 0 0 auto;
  color: #ccc;
  font-size: 14px;
}

.kv-notif-panel .kv-notif-row-chevron,
.kv-notif-row--compact .kv-notif-row-chevron {
  display: none;
}

.kv-notif-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 48px 16px;
  color: var(--kv-notif-muted);
  font-size: 14px;
}

.kv-notif-loading--page {
  min-height: 220px;
}

.kv-notif-spinner {
  width: 22px;
  height: 22px;
  border: 2px solid #eee;
  border-top-color: var(--kv-notif-accent);
  border-radius: 50%;
  animation: kv-notif-spin 0.8s linear infinite;
}

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

.kv-notif-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 24px;
  text-align: center;
  color: var(--kv-notif-muted);
}

.kv-notif-empty .bi {
  font-size: 40px;
  color: #ddd;
}

.kv-notif-empty p {
  margin: 0;
  line-height: 1.5;
  font-size: 14px;
}

.kv-notif-panel .kv-notif-empty {
  padding: 40px 20px;
}

/* Notifications page */
.kv-notif-page {
  padding: 32px 0 64px;
  background: #f8f8f8;
}

.kv-notif-page-inner {
  max-width: 720px;
  margin: 0 auto;
}

.kv-notif-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 20px 22px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.kv-notif-page-title {
  margin: 0;
  font-family: var(--heading-font, "Nunito", sans-serif);
  font-size: clamp(24px, 4vw, 30px);
  font-weight: 800;
  color: var(--kv-notif-heading);
}

.kv-notif-page-refresh {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #e8ddd6;
  border-radius: 8px;
  background: #fff;
  color: var(--kv-notif-accent);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.kv-notif-page-refresh:hover {
  background: var(--kv-notif-accent-soft);
  border-color: var(--kv-notif-accent);
}

.kv-notif-page-status {
  margin: 0 0 12px;
  color: var(--kv-notif-muted);
  font-size: 14px;
}

.kv-notif-page-status--error {
  color: #dc2626;
}

.kv-notif-page-list {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  max-height: min(75vh, 800px);
  overflow-y: auto;
  overflow-x: hidden;
}

.kv-notif-page-list .kv-notif-row {
  padding: 16px 20px;
}

.kv-notif-page-list .kv-notif-row:first-child {
  border-radius: 14px 14px 0 0;
}

.kv-notif-page-list .kv-notif-row:last-child {
  border-radius: 0 0 14px 14px;
}

@media (max-width: 768px) {
  .kv-notif-panel {
    width: 100vw;
  }

  .kv-notif-panel-push {
    position: sticky;
    top: 0;
    z-index: 3;
    padding: 12px 14px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  }

  .kv-notif-push-enable,
  .kv-push-modal-enable,
  .kv-notif-push-login {
    width: 100%;
    min-height: 44px;
    font-size: 15px;
  }

  .kv-notif-push-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .kv-notif-push-test {
    width: 100%;
    min-height: 44px;
  }

  .kv-push-modal {
    padding: 16px;
    align-items: flex-end;
  }

  .kv-push-modal-card {
    width: 100%;
    border-radius: 16px 16px 0 0;
    margin-bottom: 0;
  }

  .kv-notif-page-head {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .kv-notif-page-refresh {
    justify-content: center;
  }

  .kv-notif-page-list {
    max-height: calc(100dvh - 220px);
  }
}

/* Browser push prompt + toast */
.kv-notif-panel-push,
.kv-notif-page-push,
.kv-push-modal-card {
  color: #212529;
}

.kv-notif-push-prompt {
  margin-bottom: 12px;
  padding: 14px;
  border-radius: 12px;
  background: linear-gradient(180deg, #fff8f4 0%, #fff3ec 100%);
  border: 1px solid #f4c7a8;
  box-shadow: 0 4px 16px rgba(247, 88, 21, 0.08);
}

.kv-notif-push-text {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.5;
  color: #374151;
  font-weight: 500;
}

.kv-notif-push-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.kv-notif-push-enable,
.kv-push-modal-enable {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0 !important;
  border-radius: 10px;
  background: linear-gradient(135deg, #f75815 0%, #ff7a2f 100%) !important;
  color: #ffffff !important;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(247, 88, 21, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.kv-notif-push-enable .bi,
.kv-push-modal-enable .bi {
  color: #ffffff !important;
  font-size: 15px;
}

.kv-notif-push-enable:hover,
.kv-push-modal-enable:hover {
  background: linear-gradient(135deg, #e04f10 0%, #f75815 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 6px 18px rgba(247, 88, 21, 0.42);
  transform: translateY(-1px);
}

.kv-notif-push-dismiss,
.kv-push-modal-dismiss {
  border: 0;
  background: transparent;
  color: #6b7280 !important;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 10px 12px;
}

.kv-notif-push-dismiss:hover,
.kv-push-modal-dismiss:hover {
  color: #374151 !important;
}

.kv-notif-push-enabled {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #ecfdf5;
  color: #047857;
  font-size: 13px;
  font-weight: 600;
}

.kv-notif-push-enabled-actions {
  margin: 0 0 12px;
}

.kv-notif-push-test {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #f4c7a8;
  border-radius: 8px;
  background: #fff;
  color: #f75815 !important;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.kv-notif-push-test:hover {
  background: #fff8f4;
}

.kv-notif-push-login {
  text-decoration: none;
}

.kv-notif-push-unsupported {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 12px;
  line-height: 1.45;
}

.kv-notif-push-hint {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: #6b7280;
}

.kv-notif-push-status {
  margin: 0 0 12px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  line-height: 1.4;
}

.kv-notif-push-status--error {
  background: #fef2f2;
  color: #b91c1c;
}

.kv-notif-page-push {
  margin-bottom: 16px;
}

/* Centered enable-alerts popup */
body.kv-push-modal-open {
  overflow: hidden;
}

.kv-push-modal {
  position: fixed;
  inset: 0;
  z-index: 100020;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.kv-push-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.kv-push-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.55);
  backdrop-filter: blur(2px);
}

.kv-push-modal-card {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  padding: 28px 24px 24px;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid #f0e4dc;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
  text-align: center;
  transform: translateY(16px) scale(0.98);
  transition: transform 0.25s ease;
}

.kv-push-modal.is-open .kv-push-modal-card {
  transform: translateY(0) scale(1);
}

.kv-push-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: #f3f4f6;
  color: #6b7280;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.kv-push-modal-close:hover {
  background: #e5e7eb;
  color: #374151;
}

.kv-push-modal-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #fff4ee 0%, #ffe8db 100%);
  color: #f75815;
  font-size: 28px;
  box-shadow: inset 0 0 0 1px #f4c7a8;
}

.kv-push-modal-title {
  margin: 0 0 10px;
  font-family: var(--heading-font, "Nunito", sans-serif);
  font-size: 22px;
  font-weight: 800;
  color: #2d465e;
  line-height: 1.25;
}

.kv-push-modal-text {
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.55;
  color: #6b7280;
}

.kv-push-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kv-push-modal-enable,
.kv-notif-push-login {
  width: 100%;
  min-height: 46px;
  text-decoration: none;
}

.kv-push-modal-dismiss {
  width: 100%;
}

.kv-push-toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 100010;
  width: min(360px, calc(100vw - 32px));
  padding: 14px 16px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #f0e4dc;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
  color: inherit;
  text-decoration: none;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.kv-push-toast strong {
  display: block;
  margin-bottom: 4px;
  color: #2d465e;
  font-size: 14px;
}

.kv-push-toast span {
  display: block;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.4;
}

.kv-push-toast--visible {
  opacity: 1;
  transform: translateY(0);
}
