/* =====================================================================
   DIGIRISE OS 2.0 — NEXT-GEN FEATURE STYLES
   Bottom Nav · Activity Feed · Goals Ring · Insights · Referral
   Follow-up Banner · Homepage Ticker · Calculator Slider
   Every color = theme token. Works in dark AND light mode.
   ===================================================================== */

/* ─────────────────────────────────────────────
   F2 — FOLLOW-UP REMINDER BANNER
   ───────────────────────────────────────────── */
.followup-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
  border-radius: var(--radius-md, 12px);
  background: linear-gradient(135deg, rgba(245,158,11,0.10), rgba(239,68,68,0.06));
  border: 1px solid rgba(245,158,11,0.30);
  animation: fuSlideIn 0.4s var(--ease-out, ease-out) both;
}
@keyframes fuSlideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.fu-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.fu-icon { font-size: 18px; flex-shrink: 0; }
.fu-text { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.fu-overdue { color: #EF4444; font-weight: 800; }
.fu-today { color: #F59E0B; font-weight: 800; }
.fu-cta {
  flex-shrink: 0;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(245,158,11,0.4);
  background: rgba(245,158,11,0.12);
  color: #F59E0B;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}
.fu-cta:hover { background: rgba(245,158,11,0.22); transform: translateY(-1px); }

/* ─────────────────────────────────────────────
   F9 — ACTIVITY FEED (partner widget)
   ───────────────────────────────────────────── */
.activity-feed-card { padding: 20px; }
.af-header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.af-header h3 { font-size: 16px; }
.af-live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #22C55E; flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(34,197,94,0.5);
  animation: afPulse 2s ease-in-out infinite;
}
@keyframes afPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.4); }
  50% { box-shadow: 0 0 0 5px rgba(34,197,94,0); }
}
.af-sub { font-size: 11px; color: var(--text-tertiary); margin-left: auto; }
.af-list { display: flex; flex-direction: column; }
.af-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,0.05));
  animation: afItemIn 0.3s var(--ease-out, ease-out) both;
}
@keyframes afItemIn { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
.af-item:last-child { border-bottom: none; }
.af-icon { font-size: 15px; flex-shrink: 0; }
.af-text {
  flex: 1; min-width: 0;
  font-size: 12.5px; color: var(--text-secondary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.af-time { font-size: 10.5px; color: var(--text-tertiary); flex-shrink: 0; }
.af-empty { padding: 16px 0; font-size: 13px; color: var(--text-tertiary); text-align: center; }

/* ─────────────────────────────────────────────
   F9 — HOMEPAGE LIVE TICKER
   ───────────────────────────────────────────── */
.ticker-wrap {
  overflow: hidden;
  border-top: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
  border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
  background: var(--bg-surface-1, rgba(255,255,255,0.02));
  padding: 10px 0;
  position: relative;
}
.ticker-track {
  display: inline-flex;
  align-items: center;
  gap: 24px;
  white-space: nowrap;
  animation: tickerScroll 40s linear infinite;
  will-change: transform;
}
.ticker-wrap:hover .ticker-track { animation-play-state: paused; }
@keyframes tickerScroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.ticker-item { font-size: 12.5px; color: var(--text-secondary); font-weight: 500; }
.ticker-sep { color: var(--gold, #C8890A); font-size: 10px; margin: 0 12px; }
@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; }
}

/* Hero live totals line */
.hero-paid-line {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-secondary);
}
.hero-paid-line strong { color: #22C55E; font-variant-numeric: tabular-nums; }

/* ─────────────────────────────────────────────
   F4 — GOALS CARD + RING
   ───────────────────────────────────────────── */
.goal-card { padding: 20px; }
.goal-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.goal-head h3 { font-size: 18px; margin-top: 2px; }
.goal-edit-btn {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--bg-surface-2, rgba(255,255,255,0.04));
  border: 1px solid var(--border-default, rgba(255,255,255,0.1));
  color: var(--text-secondary);
  cursor: pointer; font-size: 14px;
  transition: all 0.15s ease;
}
.goal-edit-btn:hover { color: var(--gold, #C8890A); border-color: var(--gold, #C8890A); }
.goal-body { display: flex; align-items: center; gap: 20px; }
.goal-ring-wrap { position: relative; width: 80px; height: 80px; flex-shrink: 0; }
.goal-ring { width: 80px; height: 80px; transform: rotate(-90deg); }
.goal-ring-bg { fill: none; stroke: var(--bg-surface-3, rgba(255,255,255,0.06)); stroke-width: 7; }
.goal-ring-fill {
  fill: none;
  stroke: var(--gold, #C8890A);
  stroke-width: 7;
  stroke-linecap: round;
  filter: drop-shadow(0 0 5px rgba(200,137,10,0.45));
  transition: stroke-dashoffset 0.9s var(--ease-spring, cubic-bezier(0.34,1.56,0.64,1));
}
.goal-ring-center {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 800; color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.goal-info { min-width: 0; }
.goal-progress-text { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.goal-sub { font-size: 12px; color: var(--text-tertiary); }

/* ─────────────────────────────────────────────
   F8 — INSIGHT CARD
   ───────────────────────────────────────────── */
.insight-card {
  padding: 18px 20px;
  border-left: 3px solid var(--gold, #C8890A) !important;
  background: linear-gradient(135deg, rgba(200,137,10,0.05), transparent 60%);
}
.insight-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.insight-bulb { font-size: 16px; animation: bulbGlow 3s ease-in-out infinite; }
@keyframes bulbGlow {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(200,137,10,0)); }
  50% { filter: drop-shadow(0 0 6px rgba(200,137,10,0.6)); }
}
.insight-text { font-size: 13.5px; color: var(--text-secondary); line-height: 1.65; }
.insight-text strong { color: var(--gold-text, #F5C842); }

/* ─────────────────────────────────────────────
   F7 — REFERRAL SECTION
   ───────────────────────────────────────────── */
.referral-group { margin-top: 16px; }
.referral-box {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px;
  padding: 18px;
  border-radius: var(--radius-md, 12px);
  border: 1px dashed rgba(200,137,10,0.35);
  background: rgba(200,137,10,0.04);
}
.referral-info { flex: 1; min-width: 200px; }
.referral-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-tertiary); margin-bottom: 6px;
}
.referral-code {
  font-size: 22px; font-weight: 800; letter-spacing: 0.02em;
  color: var(--gold, #C8890A);
  font-variant-numeric: tabular-nums;
  margin-bottom: 8px;
}
.referral-hint { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }
.referral-hint strong { color: #22C55E; }
.referral-actions { display: flex; flex-direction: column; gap: 8px; }
.referral-actions button { white-space: nowrap; font-size: 12.5px; }
.ref-earned {
  margin-top: 12px; padding: 10px 14px;
  border-radius: 10px;
  background: rgba(34,197,94,0.08);
  border: 1px solid rgba(34,197,94,0.2);
  font-size: 13px; color: var(--text-secondary);
}
.ref-earned strong { color: #22C55E; }

/* ─────────────────────────────────────────────
   CALCULATOR 2.0 — slider + projection
   ───────────────────────────────────────────── */
.calc-slider-wrap { margin-top: 16px; }
.calc-slider {
  width: 100%;
  height: 6px;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold, #C8890A), var(--bg-surface-3, rgba(255,255,255,0.08)));
  outline: none;
  cursor: pointer;
}
.calc-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold, #C8890A), var(--gold-bright, #E8A020));
  border: 2px solid var(--bg-base, #08090b);
  box-shadow: 0 2px 8px rgba(200,137,10,0.5);
  cursor: grab;
  transition: transform 0.12s ease;
}
.calc-slider::-webkit-slider-thumb:active { cursor: grabbing; transform: scale(1.15); }
.calc-slider::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold, #C8890A), var(--gold-bright, #E8A020));
  border: 2px solid var(--bg-base, #08090b);
  box-shadow: 0 2px 8px rgba(200,137,10,0.5);
  cursor: grab;
}
.calc-slider-marks {
  display: flex; justify-content: space-between;
  margin-top: 6px;
  font-size: 10px; color: var(--text-tertiary);
}
.calc-projection {
  margin-top: 14px; padding: 12px 14px;
  border-radius: 10px;
  background: rgba(200,137,10,0.06);
  border: 1px solid rgba(200,137,10,0.15);
  font-size: 12.5px; color: var(--text-secondary); line-height: 1.6;
}
.calc-projection strong { color: var(--gold-text, #F5C842); }

/* ─────────────────────────────────────────────
   MOBILE BOTTOM NAV + GOLD FAB
   ───────────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 150;
  display: none;
  align-items: flex-end;
  justify-content: space-around;
  padding: 6px 8px calc(8px + env(safe-area-inset-bottom, 0px));
  background: var(--bg-surface-1, rgba(10,10,12,0.96));
  border-top: 1px solid var(--border-default, rgba(255,255,255,0.08));
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
}
html[data-theme="light"] .bottom-nav {
  background: rgba(253,252,248,0.96);
}
.bn-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 10px;
  background: none; border: none;
  color: var(--text-tertiary);
  font-size: 9.5px; font-weight: 600;
  cursor: pointer; font-family: inherit;
  transition: color 0.15s ease, transform 0.15s ease;
  border-radius: 10px;
  min-width: 56px;
}
.bn-item:active { transform: scale(0.94); }
.bn-item.active { color: var(--gold, #C8890A); }
.bn-item.active svg { filter: drop-shadow(0 0 4px rgba(200,137,10,0.4)); }
.bn-fab {
  width: 52px; height: 52px;
  border-radius: 50%;
  margin-top: -22px;
  background: linear-gradient(135deg, var(--gold, #C8890A), var(--gold-bright, #E8A020));
  border: 3px solid var(--bg-base, #08090b);
  color: #08090b;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(200,137,10,0.45), 0 2px 6px rgba(0,0,0,0.3);
  transition: transform 0.15s var(--ease-spring, ease), box-shadow 0.15s ease;
  flex-shrink: 0;
}
html[data-theme="light"] .bn-fab { border-color: #FDFCF8; }
.bn-fab:active { transform: scale(0.92); }
.bn-fab:hover { box-shadow: 0 8px 26px rgba(200,137,10,0.55), 0 2px 6px rgba(0,0,0,0.3); }

/* Show bottom nav only on small screens; add bottom padding so content
   never hides behind it */
@media (max-width: 560px) {
  .bottom-nav { display: flex; }
  body { padding-bottom: 84px; }
  /* On mobile the top tab bar stays scrollable as secondary nav */

  /* C2: Push toast container above the bottom nav */
  .toast-container,
  #toastContainer,
  .toast-wrapper {
    bottom: calc(84px + 12px) !important;
  }
}

/* ─────────────────────────────────────────────
   MICRO-POLISH: new-data pulse (used by feed items)
   ───────────────────────────────────────────── */
@keyframes goldPulse {
  0% { background: rgba(200,137,10,0.12); }
  100% { background: transparent; }
}
.gold-pulse { animation: goldPulse 1.2s ease-out both; }

/* C4 — Light theme: slider thumb border uses light bg instead of hardcoded dark */
html[data-theme="light"] .calc-slider::-webkit-slider-thumb {
  border-color: #FDFCF8;
}
html[data-theme="light"] .calc-slider::-moz-range-thumb {
  border-color: #FDFCF8;
}
/* C4 — Light theme: rc-stat and calc-projection box backgrounds */
html[data-theme="light"] .rc-stat {
  background: rgba(0,0,0,0.03);
  border-color: rgba(0,0,0,0.08);
}
html[data-theme="light"] .calc-projection {
  background: rgba(200,137,10,0.08);
}
html[data-theme="light"] .followup-banner {
  background: linear-gradient(135deg, rgba(245,158,11,0.12), rgba(239,68,68,0.06));
}

@media (prefers-reduced-motion: reduce) {
  .followup-banner, .af-item { animation: none; }
  .af-live-dot, .insight-bulb { animation: none; }
  .goal-ring-fill { transition: none; }
}

/* ─────────────────────────────────────────────
   F10 — PRESENCE DOTS (admin partners table)
   ───────────────────────────────────────────── */
.presence-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--text-tertiary, #666);
  opacity: 0.35;
  margin-right: 8px;
  vertical-align: middle;
  transition: all 0.3s ease;
  flex-shrink: 0;
}
.presence-dot.is-online {
  background: #22C55E;
  opacity: 1;
  box-shadow: 0 0 0 0 rgba(34,197,94,0.5);
  animation: afPulse 2s ease-in-out infinite;
}

/* ─────────────────────────────────────────────
   REFERRAL FIELD (admin registration)
   ───────────────────────────────────────────── */
#newPartnerReferredBy { text-transform: uppercase; }

/* ─────────────────────────────────────────────
   F3 — MONTHLY REPORT CARD
   ───────────────────────────────────────────── */
.report-card { padding: 20px; }
.rc-head { margin-bottom: 16px; }
.rc-head h3 { font-size: 18px; margin-top: 4px; }
.rc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
@media (max-width: 560px) {
  .rc-grid { grid-template-columns: 1fr; }
}
.rc-stat {
  padding: 14px;
  border-radius: 12px;
  background: var(--bg-surface-2, rgba(255,255,255,0.03));
  border: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
  text-align: center;
}
.rc-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-tertiary);
  margin-bottom: 8px;
}
.rc-val {
  font-size: 24px; font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.rc-delta { font-size: 11px; min-height: 14px; }
.rc-up { color: #22C55E; font-weight: 700; }
.rc-down { color: #EF4444; font-weight: 700; }
.rc-flat { color: var(--text-tertiary); }
