html, body {
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: contain;
}

/* Center the app in a phone-shaped frame on wider screens */
body {
  display: flex !important;
  justify-content: center !important;
  min-height: 100vh !important;
  background: #020617 !important;
  margin: 0 !important;
}
#app {
  width: 100% !important;
  max-width: 440px !important;
  min-height: 100vh !important;
  background: #020617 !important;
  position: relative !important;
  display: flex;
  flex-direction: column;
}
@media (min-width: 480px) {
  body {
    background: linear-gradient(135deg, #1e1b4b 0%, #020617 50%, #0f172a 100%) !important;
  }
  #app {
    box-shadow: 0 0 0 1px rgba(255,255,255,0.06), 0 30px 80px rgba(0,0,0,0.5) !important;
  }
}

button {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

input, textarea, select {
  font: inherit;
}

/* Hide number input spinners */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }

/* ============== SMOOTH SCROLL EVERYWHERE ============== */
/* Hide native scrollbars but keep functionality (mouse wheel, touch, arrows all work) */
* {
  scroll-behavior: smooth;
}
html { scroll-behavior: smooth; }

/* Webkit scrollbars: super-thin, premium-looking */
*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
*::-webkit-scrollbar-track {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.25);
  border-radius: 3px;
  transition: background 200ms;
}
*::-webkit-scrollbar-thumb:hover {
  background: rgba(129, 140, 248, 0.5);
}
*::-webkit-scrollbar-corner {
  background: transparent;
}

/* Firefox: thin scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(99, 102, 241, 0.25) transparent;
}

/* Modal-specific override (was already custom) */
.modal-content::-webkit-scrollbar { width: 6px; }
.modal-content::-webkit-scrollbar-thumb { background: rgba(99, 102, 241, 0.3); border-radius: 3px; }

/* Horizontal scroll containers — momentum scrolling on iOS, snap, no scrollbar visible */
.scroll-h {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
  overscroll-behavior-x: contain;
}
.scroll-h::-webkit-scrollbar {
  height: 0;  /* Hide horizontal scrollbar entirely on these containers */
  background: transparent;
}
.scroll-h { scrollbar-width: none; }

/* Vertical scroll containers with similar treatment */
.scroll-v {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  overscroll-behavior-y: contain;
}

/* Safe area for bottom nav on iOS */
.bottom-nav {
  padding-bottom: env(safe-area-inset-bottom);
}
.safe-bottom {
  padding-bottom: calc(5rem + env(safe-area-inset-bottom));
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes tabFadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes modalSpringUp {
  0%   { opacity: 0; transform: translateY(40px) scale(0.96); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}
@keyframes modalSpringDown {
  0%   { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(12px) scale(0.97); }
}
.fade-in { animation: fadeIn 0.15s ease-out; }
.slide-up { animation: modalSpringUp 0.32s cubic-bezier(0.16, 1, 0.3, 1); }
.tab-fade { animation: tabFadeUp 0.28s cubic-bezier(0.16, 1, 0.3, 1); }
.fade-out { animation: fadeOut 0.28s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
.slide-down { animation: modalSpringDown 0.28s cubic-bezier(0.4, 0, 0.2, 1) forwards; }

/* Smooth check */
.check-mark {
  transition: stroke-dashoffset 0.2s ease-out;
}

/* Tour locks page interactions via full-screen blocker. We don't lock overflow
   on body so scrollIntoView works to bring each step's target into view. */
body.tour-locked { /* reserved for future styling */ }

/* Pulsing glow on the spotlight ring */
@keyframes tourRingPulse {
  0%, 100% {
    stroke: rgba(129,140,248,0.55);
    stroke-width: 2;
  }
  50% {
    stroke: rgba(165,180,252,1);
    stroke-width: 3;
  }
}
.tour-pulse-ring {
  animation: tourRingPulse 1.6s ease-in-out infinite;
}

/* Pulsing "Try it" dot in the tour card */
@keyframes tourDotPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.6); opacity: 0.55; }
}

/* ============== PREMIUM GLOW VIBE ============== */
/* Primary CTA button — indigo glow shadow that pulls eye in */
.btn-primary-glow {
  background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
  box-shadow: 0 12px 32px rgba(79, 70, 229, 0.4), 0 4px 12px rgba(79, 70, 229, 0.2);
  transition: box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1), transform 200ms;
}
.btn-primary-glow:active {
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.45);
  transform: scale(0.97);
}

/* Premium card surface — subtle glow border */
.card-premium {
  background: #0f172a;
  border: 1px solid rgba(165, 180, 252, 0.08);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.03), 0 4px 20px rgba(0,0,0,0.25);
  border-radius: 16px;
  position: relative;
  overflow: hidden;
}
.card-premium::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(165,180,252,0.3), transparent);
  pointer-events: none;
}

/* Glow accent dot — for streak indicators, day labels */
.glow-dot {
  background: radial-gradient(circle, #818cf8 0%, transparent 70%);
}

/* Active bottom nav tab indicator — soft indigo glow underneath */
.nav-active-glow {
  position: relative;
}
.nav-active-glow::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 2px;
  background: #818cf8;
  border-radius: 2px;
  box-shadow: 0 0 12px rgba(129,140,248,0.7), 0 0 4px rgba(165,180,252,0.9);
}

/* Headline gradient text — for hero/section titles */
.text-gradient-indigo {
  background: linear-gradient(135deg, #c7d2fe 0%, #818cf8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Section title — subtle premium feel */
.section-title-premium {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #64748b;
  position: relative;
  padding-left: 12px;
}
.section-title-premium::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 14px;
  background: linear-gradient(180deg, #818cf8, #4338ca);
  border-radius: 2px;
}

/* Focus glow on text inputs */
input:focus, textarea:focus, select:focus {
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Button hover/active subtle glow on primary buttons (indigo bg) */
button.bg-indigo-600 {
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.25);
}
button.bg-indigo-600:active {
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.4);
}

/* FAB pulse glow on idle */
@keyframes fabPulse {
  0%, 100% { box-shadow: 0 10px 30px rgba(79, 70, 229, 0.5), 0 4px 12px rgba(0,0,0,0.3); }
  50%      { box-shadow: 0 14px 38px rgba(79, 70, 229, 0.65), 0 4px 12px rgba(0,0,0,0.3); }
}
.fab { animation: fabPulse 3s ease-in-out infinite; }

/* Premium card surface for goal/category cards with subtle glow */
.bg-slate-900 {
  position: relative;
}

/* Modal premium look — subtle gradient on top edge */
.modal-content {
  background: linear-gradient(180deg, #0f172a 0%, #0a0f1f 100%) !important;
  box-shadow: 0 0 0 1px rgba(165,180,252,0.08), 0 30px 80px rgba(0,0,0,0.6), 0 0 60px rgba(79, 70, 229, 0.08);
  position: relative;
}
.modal-content::before {
  content: '';
  position: absolute;
  top: 0; left: 10%; right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(165,180,252,0.4), transparent);
  pointer-events: none;
}

/* Sticky header subtle indigo glow at bottom edge */
header.sticky {
  position: relative;
}
header.sticky::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(129,140,248,0.18), transparent);
  pointer-events: none;
}

/* Bottom nav subtle indigo glow on top edge */
.bottom-nav {
  position: relative;
}
.bottom-nav::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(129,140,248,0.18), transparent);
  pointer-events: none;
}

/* Gradient glow on entire #app on wider screens */
@media (min-width: 480px) {
  #app {
    box-shadow:
      0 0 0 1px rgba(255,255,255,0.06),
      0 30px 80px rgba(0,0,0,0.5),
      0 0 80px rgba(79, 70, 229, 0.08) !important;
  }
}

/* Headings with subtle text-glow */
h1, h2 {
  text-shadow: 0 0 20px rgba(165,180,252,0.05);
}

/* ============== LIGHT THEME ============== */
body.theme-light {
  color-scheme: light !important;
  color: #0f172a;
}
body.theme-light input[type="date"],
body.theme-light input[type="time"],
body.theme-light input[type="number"] { color-scheme: light !important; }
body.theme-light input[type="date"]::-webkit-calendar-picker-indicator { filter: none !important; }

/* App backgrounds */
body.theme-light { background: #f1f5f9 !important; }
@media (min-width: 480px) {
  body.theme-light { background: linear-gradient(135deg, #e0e7ff 0%, #f8fafc 50%, #f1f5f9 100%) !important; }
}
body.theme-light #app { background: #ffffff !important; box-shadow: 0 0 0 1px rgba(15,23,42,0.06), 0 30px 80px rgba(15,23,42,0.12) !important; }

/* Text */
body.theme-light .text-slate-100 { color: #0f172a !important; }
body.theme-light .text-slate-200 { color: #1e293b !important; }
body.theme-light .text-slate-300 { color: #334155 !important; }
body.theme-light .text-slate-400 { color: #475569 !important; }
body.theme-light .text-slate-500 { color: #64748b !important; }
body.theme-light .text-slate-600 { color: #94a3b8 !important; }

/* Backgrounds */
body.theme-light .bg-slate-950 { background-color: #ffffff !important; }
body.theme-light .bg-slate-950\/90 { background-color: rgba(255,255,255,0.9) !important; }
body.theme-light .bg-slate-900 { background-color: #f8fafc !important; }
body.theme-light .bg-slate-900\/95 { background-color: rgba(248,250,252,0.95) !important; }
body.theme-light .bg-slate-900\/80 { background-color: rgba(248,250,252,0.8) !important; }
body.theme-light .bg-slate-900\/60 { background-color: rgba(241,245,249,0.6) !important; }
body.theme-light .bg-slate-900\/50 { background-color: rgba(241,245,249,0.5) !important; }
body.theme-light .bg-slate-800 { background-color: #e2e8f0 !important; }
body.theme-light .bg-slate-800\/60 { background-color: rgba(226,232,240,0.6) !important; }
body.theme-light .bg-slate-800\/50 { background-color: rgba(226,232,240,0.5) !important; }
body.theme-light .bg-slate-800\/40 { background-color: rgba(226,232,240,0.4) !important; }
body.theme-light .bg-slate-700 { background-color: #cbd5e1 !important; }

/* Borders */
body.theme-light .border-slate-700 { border-color: #cbd5e1 !important; }
body.theme-light .border-slate-800 { border-color: #e2e8f0 !important; }
body.theme-light .border-slate-800\/50 { border-color: rgba(226,232,240,0.5) !important; }
body.theme-light .border-slate-800\/60 { border-color: rgba(226,232,240,0.6) !important; }
body.theme-light .divide-slate-800 > * { border-color: #e2e8f0 !important; }

/* Active states */
body.theme-light .active\:bg-slate-800\/40:active { background-color: rgba(226,232,240,0.6) !important; }
body.theme-light .active\:bg-slate-800\/60:active { background-color: rgba(226,232,240,0.8) !important; }
body.theme-light .active\:bg-slate-700:active { background-color: #cbd5e1 !important; }
body.theme-light .hover\:bg-slate-700:hover { background-color: #cbd5e1 !important; }
body.theme-light .hover\:bg-slate-800\/40:hover { background-color: rgba(226,232,240,0.5) !important; }

/* Specific elements */
body.theme-light input,
body.theme-light textarea,
body.theme-light select {
  color: #0f172a !important;
}
body.theme-light input::placeholder,
body.theme-light textarea::placeholder { color: #94a3b8 !important; }
body.theme-light .placeholder-slate-600::placeholder { color: #cbd5e1 !important; }

/* Focus rings tweaked */
body.theme-light .focus\:border-indigo-500:focus { border-color: #6366f1 !important; }
