/* =========================================================
   ZOR — Notification Bell + Drawer + Push + Toasts (PC & Mobile)
   ========================================================= */

/* ---------- Bell Icon & Glowing Badge ---------- */
.nf-bell {
  position: relative !important;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation !important;
  z-index: 10 !important;
  transition: transform 0.15s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.nf-bell svg {
  pointer-events: none !important;
}

.nf-bell::after {
  content: "";
  position: absolute;
  top: -6px;
  bottom: -6px;
  left: -6px;
  right: -6px;
  pointer-events: auto;
}

.nf-bell.has-unread {
  color: #ff3355 !important;
  border-color: rgba(255, 51, 85, 0.7) !important;
  box-shadow: 0 0 12px rgba(255, 51, 85, 0.4) !important;
  transform-origin: 50% 15%;
  animation: nf-ring 3.5s ease-in-out infinite, nf-pulse 2s ease-out infinite;
}

.nf-bell .icon-btn__badge {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 9px;
  height: 9px;
  background: #ff3355;
  border-radius: 50%;
  box-shadow: 0 0 8px #ff3355;
  pointer-events: none;
  border: 1.5px solid #0a0c10;
  transition: transform 0.2s ease;
}

.nf-bell .icon-btn__badge[hidden] {
  display: none !important;
}

.nf-bell.has-unread .icon-btn__badge {
  display: block !important;
  animation: nf-badge-glow 1.5s ease-in-out infinite alternate;
}

@keyframes nf-badge-glow {
  from { transform: scale(0.9); box-shadow: 0 0 4px #ff3355; }
  to { transform: scale(1.2); box-shadow: 0 0 10px #ff3355, 0 0 16px rgba(255, 51, 85, 0.6); }
}

@keyframes nf-ring {
  0%, 65%, 100% { transform: rotate(0); }
  70% { transform: rotate(14deg); }
  75% { transform: rotate(-12deg); }
  80% { transform: rotate(8deg); }
  85% { transform: rotate(-5deg); }
  90% { transform: rotate(0); }
}

@keyframes nf-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 51, 85, 0.6); }
  100% { box-shadow: 0 0 0 8px rgba(255, 51, 85, 0); }
}

/* ---------- Overlay Backdrop ---------- */
.nf-overlay {
  position: fixed;
  inset: 0;
  z-index: 119;
  background: transparent;
}
.nf-overlay[hidden], .nf-panel[hidden] {
  display: none !important;
}

/* ---------- Notification Floating Panel ---------- */
.nf-panel {
  position: fixed;
  top: var(--nf-top, 72px);
  right: 16px;
  z-index: 120;
  width: 400px;
  max-width: calc(100vw - 32px);
  max-height: min(75vh, 600px);
  display: flex;
  flex-direction: column;
  background: rgba(14, 18, 25, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 12px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.75), 0 0 25px rgba(0, 240, 255, 0.15);
  transform-origin: top right;
  animation: nf-pop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

@keyframes nf-pop {
  from { opacity: 0; transform: scale(0.94) translateY(-8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Header */
.nf-panel__head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(20, 25, 36, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nf-panel__title-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nf-panel__title {
  font-family: var(--font-display, "Chakra Petch", sans-serif);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.03em;
  margin: 0;
  color: #fff;
}

.nf-panel__count {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  background: rgba(255, 51, 85, 0.2);
  color: #ff4d6d;
  border: 1px solid rgba(255, 51, 85, 0.4);
}

.nf-panel__tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nf-tool-btn {
  background: none;
  border: none;
  color: #8b9bb4;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.nf-tool-btn:hover {
  color: #00f0ff;
  background: rgba(0, 240, 255, 0.08);
}

.nf-tool-btn[hidden] {
  display: none;
}

.nf-tool-btn--sound {
  color: #00f0ff;
  border: 1px solid rgba(0, 240, 255, 0.2);
  background: rgba(0, 240, 255, 0.05);
}

.nf-tool-btn--sound:hover {
  background: rgba(0, 240, 255, 0.15);
  border-color: rgba(0, 240, 255, 0.5);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

.nf-tool-btn--playing {
  color: #00e676 !important;
  border-color: #00e676 !important;
  box-shadow: 0 0 12px rgba(0, 230, 118, 0.6) !important;
  animation: nf-sound-pulse 0.4s ease-out;
}

@keyframes nf-sound-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.nf-close {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #8b9bb4;
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.nf-close:hover {
  color: #ff3355;
  border-color: rgba(255, 51, 85, 0.4);
  background: rgba(255, 51, 85, 0.1);
}

/* Device Push Status Banner */
.nf-push-bar {
  flex: none;
  padding: 8px 16px;
  background: rgba(0, 240, 255, 0.04);
  border-bottom: 1px solid rgba(0, 240, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: #9cb3c9;
}

.nf-push-bar--granted {
  background: rgba(0, 230, 118, 0.05);
  border-bottom-color: rgba(0, 230, 118, 0.15);
  color: #00e676;
}

.nf-push-bar__btn {
  background: linear-gradient(135deg, #00f0ff, #0077ff);
  color: #040810;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s;
}

.nf-push-bar__btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* Filter Tabs */
.nf-tabs {
  flex: none;
  display: flex;
  gap: 6px;
  padding: 8px 16px;
  background: rgba(10, 13, 20, 0.7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.nf-tab {
  background: transparent;
  border: 1px solid transparent;
  color: #7b8ea6;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.nf-tab:hover {
  color: #c0d1e5;
  background: rgba(255, 255, 255, 0.04);
}

.nf-tab--active {
  color: #00f0ff;
  background: rgba(0, 240, 255, 0.1);
  border-color: rgba(0, 240, 255, 0.35);
}

/* List */
.nf-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  flex: 1 1 auto;
}

.nf-row + .nf-row {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.nf-item {
  display: block;
  padding: 13px 16px;
  color: inherit;
  text-decoration: none;
  transition: background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.nf-item:hover, .nf-item:active {
  background: rgba(255, 255, 255, 0.04);
}

.nf-item--new {
  background: rgba(0, 240, 255, 0.04);
  box-shadow: inset 3px 0 0 #00f0ff;
}

.nf-item__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.nf-item__time {
  font-size: 11px;
  color: #6e8299;
  white-space: nowrap;
}

.nf-item__title {
  font-size: 13.5px;
  font-weight: 600;
  margin: 6px 0 3px;
  color: #f0f4f8;
  overflow-wrap: anywhere;
}

.nf-item__body {
  font-size: 12.5px;
  line-height: 1.45;
  color: #8b9bb4;
  margin: 0;
  overflow-wrap: anywhere;
}

/* Notification Type Badges */
.nf-tag {
  font-family: var(--font-display, "Chakra Petch", sans-serif);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid rgba(0, 240, 255, 0.4);
  color: #00f0ff;
  background: rgba(0, 240, 255, 0.08);
  white-space: nowrap;
  text-transform: uppercase;
}

.nf-tag--mode, .nf-tag--match {
  color: #00e5ff;
  border-color: rgba(0, 229, 255, 0.4);
  background: rgba(0, 229, 255, 0.08);
}

.nf-tag--order {
  color: #ffd600;
  border-color: rgba(255, 214, 0, 0.4);
  background: rgba(255, 214, 0, 0.08);
}

.nf-tag--withdraw {
  color: #ff9100;
  border-color: rgba(255, 145, 0, 0.4);
  background: rgba(255, 145, 0, 0.08);
}

.nf-tag--order_approved, .nf-tag--withdraw_approved {
  color: #00e676;
  border-color: rgba(0, 230, 118, 0.4);
  background: rgba(0, 230, 118, 0.08);
}

.nf-tag--announce {
  color: #ff3355;
  border-color: rgba(255, 51, 85, 0.4);
  background: rgba(255, 51, 85, 0.08);
}

.nf-tag--result {
  color: #e0b0ff;
  border-color: rgba(224, 176, 255, 0.4);
  background: rgba(224, 176, 255, 0.08);
}

.nf-tag--live {
  color: #ff1744;
  border-color: rgba(255, 23, 68, 0.4);
  background: rgba(255, 23, 68, 0.08);
}

.nf-empty {
  padding: 35px 20px;
  text-align: center;
  font-size: 13px;
  line-height: 1.6;
  color: #6e8299;
}

/* ---------- In-App Toast Container & Toasts ---------- */
.zor-toast-container {
  position: fixed;
  top: 76px;
  right: 18px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 380px;
  width: calc(100vw - 36px);
  pointer-events: none;
}

.zor-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(14, 18, 26, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(0, 240, 255, 0.4);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.65), 0 0 20px rgba(0, 240, 255, 0.2);
  cursor: pointer;
  animation: zor-toast-in 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.zor-toast:hover {
  transform: translateY(-2px);
  border-color: #00f0ff;
}

.zor-toast--fadeout {
  opacity: 0;
  transform: translateY(-8px);
}

.zor-toast__icon {
  font-size: 20px;
  line-height: 1;
  flex: none;
  padding-top: 2px;
}

.zor-toast__content {
  flex: 1 1 auto;
  min-width: 0;
}

.zor-toast__title {
  font-family: var(--font-display, "Chakra Petch", sans-serif);
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 3px;
  overflow-wrap: anywhere;
}

.zor-toast__body {
  font-size: 12px;
  line-height: 1.4;
  color: #a4b8cc;
  margin: 0;
  overflow-wrap: anywhere;
}

.zor-toast__close {
  background: transparent;
  border: none;
  color: #6e8299;
  font-size: 18px;
  line-height: 1;
  padding: 0 4px;
  cursor: pointer;
  flex: none;
}

.zor-toast__close:hover {
  color: #ff3355;
}

@keyframes zor-toast-in {
  from { opacity: 0; transform: translateX(20px) scale(0.95); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

/* ---------- Push Permission Floating Banner ---------- */
.nf-perm-banner {
  position: fixed;
  bottom: 20px;
  left: 20px;
  right: 20px;
  max-width: 440px;
  margin: 0 auto;
  z-index: 9998;
  background: rgba(14, 18, 25, 0.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7), 0 0 20px rgba(0, 240, 255, 0.15);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: nf-perm-slide 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes nf-perm-slide {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.nf-perm-banner__icon {
  font-size: 24px;
  flex: none;
}

.nf-perm-banner__text {
  flex: 1 1 auto;
  min-width: 0;
}

.nf-perm-banner__text strong {
  display: block;
  font-family: var(--font-display, "Chakra Petch", sans-serif);
  font-size: 13.5px;
  color: #fff;
  margin-bottom: 2px;
}

.nf-perm-banner__text p {
  font-size: 12px;
  line-height: 1.35;
  color: #9cb3c9;
  margin: 0;
}

.nf-perm-banner__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}

.nf-perm-banner__btn-allow {
  background: linear-gradient(135deg, #00f0ff, #0077ff);
  color: #040810;
  font-family: var(--font-display, "Chakra Petch", sans-serif);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 7px 12px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
}

.nf-perm-banner__btn-dismiss {
  background: transparent;
  color: #6e8299;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}

.nf-perm-banner__btn-dismiss:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}

/* ---------- Mobile Responsive Adjustments ---------- */
@media (max-width: 860px) {
  .nf-overlay {
    background: rgba(5, 7, 10, 0.7);
  }
  .nf-panel {
    left: 10px;
    right: 10px;
    width: auto;
    max-width: none;
    max-height: calc(100vh - var(--nf-top, 64px) - var(--nav-height-mobile, 68px) - 16px);
    max-height: calc(100dvh - var(--nf-top, 64px) - var(--nav-height-mobile, 68px) - env(safe-area-inset-bottom) - 16px);
  }
  .nf-item { padding: 14px 16px; }
  .nf-item__title { font-size: 14px; }
  .nf-item__body { font-size: 13px; }
  .zor-toast-container {
    top: 68px;
    left: 12px;
    right: 12px;
    max-width: none;
    width: auto;
  }
  .nf-perm-banner {
    left: 10px;
    right: 10px;
    bottom: calc(var(--nav-height-mobile, 68px) + 12px);
    flex-wrap: wrap;
  }
  .nf-perm-banner__actions {
    width: 100%;
    justify-content: flex-end;
    margin-top: 6px;
  }
  html.nf-open body {
    overflow: hidden;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nf-bell.has-unread, .nf-panel, .zor-toast, .nf-perm-banner {
    animation: none !important;
  }
}
