/* Floating support button + full-screen support drawer */

@keyframes fx-support-heartbeat {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 8px 22px rgba(99, 102, 241, 0.32);
  }
  12% {
    transform: scale(1.06);
    box-shadow: 0 10px 28px rgba(99, 102, 241, 0.44);
  }
  24% {
    transform: scale(1);
    box-shadow: 0 8px 22px rgba(99, 102, 241, 0.32);
  }
  36% {
    transform: scale(1.035);
    box-shadow: 0 9px 25px rgba(99, 102, 241, 0.38);
  }
  48% {
    transform: scale(1);
    box-shadow: 0 8px 22px rgba(99, 102, 241, 0.32);
  }
}

button.fx-support-fab {
  position: fixed;
  z-index: 35;
  width: 52px !important;
  height: 52px !important;
  min-width: 52px !important;
  min-height: 52px !important;
  max-width: 52px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  cursor: pointer;
  display: grid !important;
  place-items: center !important;
  color: #fff !important;
  background: linear-gradient(135deg, #6366f1, #4f46e5) !important;
  box-shadow: 0 8px 22px rgba(99, 102, 241, 0.32) !important;
  right: max(16px, calc((100vw - var(--app-width, 430px)) / 2 + 14px));
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  transition: background 0.2s ease;
  flex-shrink: 0;
  aspect-ratio: 1;
  animation: fx-support-heartbeat 2.8s ease-in-out infinite;
}

button.fx-support-fab:hover {
  animation-play-state: paused;
  transform: scale(1.06) !important;
  color: #fff !important;
  background: linear-gradient(135deg, #818cf8, #6366f1) !important;
  border: 0 !important;
  box-shadow: 0 12px 28px rgba(99, 102, 241, 0.48) !important;
}

button.fx-support-fab:active {
  transform: scale(0.98) !important;
}

button.fx-support-fab svg,
button.fx-support-fab .fx-support-fab-icon {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

@media (prefers-reduced-motion: reduce) {
  button.fx-support-fab {
    animation: none;
  }
}

.easyfx-dashboard .fx-support-fab,
.fx-guest-mode .fx-support-fab {
  bottom: calc(96px + env(safe-area-inset-bottom, 0px));
}

a.fx-topics-fab {
  position: fixed;
  z-index: 35;
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  min-height: 40px !important;
  max-width: 40px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  cursor: pointer;
  display: grid !important;
  place-items: center !important;
  text-decoration: none !important;
  color: #fff !important;
  background: linear-gradient(135deg, #34d399, #059669) !important;
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.28) !important;
  right: max(20px, calc((100vw - var(--app-width, 430px)) / 2 + 18px));
  bottom: calc(154px + env(safe-area-inset-bottom, 0px));
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  flex-shrink: 0;
  aspect-ratio: 1;
}

a.fx-topics-fab:hover {
  transform: scale(1.05);
  color: #fff !important;
  background: linear-gradient(135deg, #6ee7b7, #10b981) !important;
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.36) !important;
}

a.fx-topics-fab:active {
  transform: scale(0.97);
}

a.fx-topics-fab svg,
a.fx-topics-fab .fx-topics-fab-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.easyfx-dashboard .fx-topics-fab {
  bottom: calc(154px + env(safe-area-inset-bottom, 0px));
}

.fx-guide-page .fx-topics-fab {
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
}

body.fx-support-open {
  overflow: hidden;
}

.fx-support-drawer.modal {
  --bs-modal-bg: transparent;
}

.fx-support-drawer.modal.show,
.fx-support-drawer.modal.showing {
  display: flex !important;
  align-items: stretch;
  justify-content: center;
  padding: 0 !important;
}

.fx-support-drawer .modal-dialog {
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: var(--app-width, 430px);
  height: 100%;
  max-height: 100dvh;
  margin: 0 auto !important;
  transform: none !important;
}

.fx-support-drawer.show .modal-dialog,
.fx-support-drawer.showing .modal-dialog {
  transform: none !important;
}

/* Drawer shell — scoped so global .modal .modal-content dark styles don't win */
.fx-support-drawer .modal-content.fx-support-sheet {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100dvh;
  min-height: 0;
  border: 0 !important;
  border-radius: 0 !important;
  background: var(--fx-bg, #f8fafc) !important;
  color: #0f172a !important;
  padding: 0 !important;
  box-shadow: none !important;
  overflow: hidden;
}

.fx-support-drawer .fx-support-sheet-head {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: max(16px, env(safe-area-inset-top)) 16px 14px;
  border-bottom: 1px solid var(--fx-line, rgba(15, 23, 42, 0.1));
  background:
    linear-gradient(180deg, color-mix(in srgb, #229ed9 6%, var(--fx-card, #fff)), var(--fx-card, #fff));
  text-align: left;
}

.fx-support-drawer .fx-support-sheet-head-copy {
  min-width: 0;
  padding-right: 4px;
}

.fx-support-drawer .fx-support-sheet-title {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f172a !important;
  line-height: 1.25;
}

.fx-support-drawer .fx-support-sheet-sub {
  margin: 0;
  font-size: 13px;
  color: #64748b !important;
  line-height: 1.35;
}

.fx-support-drawer .fx-support-close {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 32px !important;
  height: 32px !important;
  min-height: 32px !important;
  flex-shrink: 0;
  padding: 0 !important;
  border-radius: 8px !important;
  border: 1px solid var(--fx-line, rgba(15, 23, 42, 0.12)) !important;
  background: var(--fx-bg, #f8fafc) !important;
  color: #475569 !important;
  font-size: 20px !important;
  font-weight: 500 !important;
  line-height: 1 !important;
  box-shadow: none !important;
  transform: none !important;
  cursor: pointer;
}

.fx-support-drawer .fx-support-close:hover {
  background: #eef2f7 !important;
  color: #1e293b !important;
}

.fx-support-drawer .fx-support-close:focus-visible {
  outline: 2px solid var(--fx-indigo, #6366f1);
  outline-offset: 2px;
}

.fx-support-drawer .fx-support-drawer-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 14px 14px calc(18px + env(safe-area-inset-bottom, 0px));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--fx-bg, #f8fafc) 92%, transparent), var(--fx-bg, #f8fafc));
}

.fx-support-drawer .fx-support-options {
  display: grid;
  gap: 10px;
}

.fx-support-drawer .fx-support-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px;
  border: 1px solid rgba(15, 23, 42, 0.1) !important;
  border-radius: 5px;
  background: #ffffff !important;
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.15s ease;
}

.fx-support-drawer button.fx-support-option {
  appearance: none;
  -webkit-appearance: none;
}

.fx-support-drawer .fx-support-option:active {
  transform: scale(0.99);
}

.fx-support-drawer .fx-support-option-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 5px;
  flex-shrink: 0;
}

.fx-support-drawer .fx-support-option-icon svg {
  width: 22px;
  height: 22px;
}

.fx-support-drawer .fx-support-option--whatsapp .fx-support-option-icon {
  background: rgba(37, 211, 102, 0.12);
  color: #128c7e;
}

.fx-support-drawer .fx-support-option--telegram .fx-support-option-icon {
  background: rgba(42, 171, 238, 0.12);
  color: #229ed9;
}

.fx-support-drawer .fx-support-option--email .fx-support-option-icon {
  background: rgba(99, 102, 241, 0.12);
  color: #6366f1;
}

.fx-support-drawer .fx-support-option--guide .fx-support-option-icon {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}

.fx-support-drawer .fx-support-option--topics .fx-support-option-icon {
  background: rgba(139, 92, 246, 0.12);
  color: #7c3aed;
}

.fx-support-drawer .fx-support-option--livechat {
  border-color: rgba(99, 102, 241, 0.22) !important;
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.08), #ffffff) !important;
}

.fx-support-drawer .fx-support-option--livechat .fx-support-option-icon {
  background: rgba(99, 102, 241, 0.14);
  color: #4f46e5;
}

.fx-support-drawer .fx-support-option-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.fx-support-drawer .fx-support-option-copy strong {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a !important;
}

.fx-support-drawer .fx-support-option-copy small {
  font-size: 12px;
  color: #64748b !important;
}

.fx-support-drawer .fx-support-option > .icon-arr-right {
  font-size: 12px;
  color: #94a3b8 !important;
}

/* Dark mode — drawer lives outside .easyfx-dashboard, so set explicit colors here */
html.fx-dark .fx-support-drawer .modal-content.fx-support-sheet {
  background: var(--fx-bg-dark, #0f172a) !important;
  color: #f1f5f9 !important;
}

html.fx-dark .fx-support-drawer .fx-support-sheet-head {
  background: var(--fx-card, #1e293b);
  border-bottom-color: var(--fx-line, rgba(255, 255, 255, 0.1));
}

html.fx-dark .fx-support-drawer .fx-support-sheet-title {
  color: #f1f5f9 !important;
}

html.fx-dark .fx-support-drawer .fx-support-sheet-sub {
  color: #94a3b8 !important;
}

html.fx-dark .fx-support-drawer .fx-support-close {
  border-color: rgba(255, 255, 255, 0.1) !important;
  background: rgba(255, 255, 255, 0.06) !important;
  color: #cbd5e1 !important;
}

html.fx-dark .fx-support-drawer .fx-support-close:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #f1f5f9 !important;
}

html.fx-dark .fx-support-drawer .fx-support-drawer-body {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--fx-bg-dark, #0f172a) 88%, transparent), var(--fx-bg-dark, #0f172a));
}

html.fx-dark .fx-support-drawer .fx-support-option {
  background: #ffffff !important;
  border-color: rgba(15, 23, 42, 0.08) !important;
}

html.fx-dark .fx-support-drawer .fx-support-option--livechat {
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.12), #ffffff) !important;
  border-color: rgba(99, 102, 241, 0.28) !important;
}

html.fx-dark .fx-support-drawer .fx-support-option-copy strong {
  color: #0f172a !important;
}

html.fx-dark .fx-support-drawer .fx-support-option-copy small {
  color: #64748b !important;
}

@media (min-width: 768px) {
  .fx-support-drawer .modal-content.fx-support-sheet {
    border-left: 1px solid var(--fx-line, rgba(15, 23, 42, 0.08));
    border-right: 1px solid var(--fx-line, rgba(15, 23, 42, 0.08));
  }
}

/* ============================================================
   Notification bell (topbar) + dropdown panel
   ============================================================ */

.fx-topbar-btn--noti {
  position: relative;
}

.fx-noti-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #f43f5e;
  border: 2px solid var(--fx-card, #fff);
  color: #fff;
  font-size: 9.5px;
  font-weight: 800;
  line-height: 1;
  font-family: "Plus Jakarta Sans", sans-serif;
}

html.fx-dark .fx-noti-badge {
  border-color: #121820;
}

.fx-noti-panel {
  position: fixed;
  top: 66px;
  left: 50%;
  transform: translateX(-50%);
  width: min(94vw, calc(var(--app-width, 430px) - 24px));
  max-height: min(64vh, 480px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--fx-line, rgba(15, 23, 42, 0.08));
  border-radius: var(--fx-radius, 5px);
  background: var(--fx-card, #fff);
  box-shadow: var(--fx-shadow, 0 18px 38px -20px rgba(30, 41, 89, 0.28));
  z-index: 1045;
  animation: fx-noti-pop 0.18s cubic-bezier(0.22, 1, 0.36, 1);
  font-family: "Plus Jakarta Sans", sans-serif;
}

@keyframes fx-noti-pop {
  from { opacity: 0; transform: translateX(-50%) translateY(-6px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.fx-noti-panel-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 14px 11px;
  border-bottom: 1px solid var(--fx-line, rgba(15, 23, 42, 0.08));
}

.fx-noti-panel-title {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--fx-ink, #0f172a);
}

.fx-noti-markall {
  width: auto;
  padding: 5px 10px;
  border: 0;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.1);
  color: var(--fx-indigo, #6366f1);
  font: 700 11.5px "Plus Jakarta Sans", sans-serif;
  cursor: pointer;
}

.fx-noti-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 6px;
}

.fx-noti-empty {
  margin: 0;
  padding: 26px 18px;
  text-align: center;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--fx-muted, #64748b);
}

.fx-noti-empty i {
  display: block;
  margin-bottom: 8px;
  font-size: 22px;
  opacity: 0.45;
}

.fx-noti-item {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding: 11px 10px;
  border-radius: var(--fx-radius, 5px);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
}

.fx-noti-item:hover {
  background: var(--fx-bg, #f1f5f9);
  color: inherit;
}

.fx-noti-item + .fx-noti-item {
  margin-top: 2px;
}

.fx-noti-item.is-unread {
  background: rgba(99, 102, 241, 0.07);
}

.fx-noti-item.is-unread:hover {
  background: rgba(99, 102, 241, 0.11);
}

.fx-noti-item-icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.1);
  color: var(--fx-indigo, #6366f1);
  font-size: 15px;
}

/* Some font icons hardcode a color on :before — keep tile color */
.fx-noti-item-icon i:before {
  color: inherit;
}

.fx-noti-item--post_approved .fx-noti-item-icon {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}

.fx-noti-item--post_rejected .fx-noti-item-icon {
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
}

.fx-noti-item-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.fx-noti-item-copy strong {
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--fx-ink, #0f172a);
}

.fx-noti-item-copy small {
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--fx-muted, #64748b);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.fx-noti-item-copy em {
  margin-top: 2px;
  font-style: normal;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--fx-muted, #94a3b8);
  opacity: 0.85;
}

/* Dark mode — explicit colors in case vars are unavailable */
html.fx-dark .fx-noti-panel {
  border-color: rgba(255, 255, 255, 0.08);
  background: #121820;
  box-shadow: 0 18px 38px -18px rgba(0, 0, 0, 0.7);
}

html.fx-dark .fx-noti-panel-head {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

html.fx-dark .fx-noti-panel-title {
  color: #f1f5f9;
}

html.fx-dark .fx-noti-markall {
  background: rgba(99, 102, 241, 0.16);
  color: #a5b4fc;
}

html.fx-dark .fx-noti-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

html.fx-dark .fx-noti-item.is-unread {
  background: rgba(99, 102, 241, 0.13);
}

html.fx-dark .fx-noti-item.is-unread:hover {
  background: rgba(99, 102, 241, 0.18);
}

html.fx-dark .fx-noti-item-copy strong {
  color: #f1f5f9;
}

html.fx-dark .fx-noti-item-copy small,
html.fx-dark .fx-noti-item-copy em {
  color: #94a3b8;
}

html.fx-dark .fx-noti-item--post_rejected .fx-noti-item-icon {
  color: #fbbf24;
}

html.fx-dark .fx-noti-item--post_approved .fx-noti-item-icon {
  color: #34d399;
}

html.fx-dark .fx-noti-item-icon {
  color: #a5b4fc;
}
