/* ==========================================================================
   Calculator - Modern Material You Dark Theme & Ambient System
   Matches NeriQuest Android Studio AMOLED aesthetic
   ========================================================================== */

:root {
  --bg-amoled: #07090e;
  --bg-surface: #0f1420;
  --bg-card: #151c2c;
  --bg-card-hover: #1c253b;
  --bg-glass: rgba(21, 28, 44, 0.72);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(255, 255, 255, 0.14);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  /* Signature Calculator Palette (Mint / Emerald / Cyan) */
  --accent-emerald: #10b981;
  --accent-emerald-bright: #34d399;
  --accent-cyan: #06b6d4;
  --accent-blue: #3b82f6;
  --accent-purple: #a855f7;
  --accent-amber: #f59e0b;
  --accent-coral: #ef4444;

  --primary-gradient: linear-gradient(135deg, #34d399 0%, #059669 100%);
  --glow-emerald: rgba(16, 185, 129, 0.35);

  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 26px;
  --radius-pill: 9999px;

  --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);

  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent !important;
}

html {
  overflow-x: hidden;
  max-width: 100%;
  width: 100%;
  scroll-behavior: smooth;
  font-family: var(--font-family);
  background-color: var(--bg-amoled);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid rgba(16, 185, 129, 0.7);
  outline-offset: 3px;
  border-radius: inherit;
}

a, button, [role="button"], .key-btn, .mode-tab-btn, .calc-tool-btn, .faq-question {
  -webkit-tap-highlight-color: transparent !important;
  user-select: none;
  -webkit-user-select: none;
}

body {
  max-width: 100%;
  width: 100%;
  position: relative;
  overflow-x: hidden;
  min-height: 100vh;
  background-color: var(--bg-amoled);
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ==========================================================================
   Ambient Aurora Glow System
   ========================================================================== */
.ambient-glow-wrapper {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

/* Dynamic Continuous Hue-Shifting Keyframes (Evolving Ambient Aurora Spectrum) */
@keyframes ambientHueShift1 {
  0% {
    filter: blur(55px) hue-rotate(0deg);
  }
  50% {
    filter: blur(66px) hue-rotate(180deg);
  }
  100% {
    filter: blur(55px) hue-rotate(360deg);
  }
}

@keyframes ambientHueShift2 {
  0% {
    filter: blur(58px) hue-rotate(0deg);
  }
  50% {
    filter: blur(48px) hue-rotate(-180deg);
  }
  100% {
    filter: blur(58px) hue-rotate(-360deg);
  }
}

@keyframes ambientHueShift3 {
  0% {
    filter: blur(55px) hue-rotate(45deg);
  }
  50% {
    filter: blur(65px) hue-rotate(225deg);
  }
  100% {
    filter: blur(55px) hue-rotate(405deg);
  }
}

@keyframes ambientHueShift4 {
  0% {
    filter: blur(60px) hue-rotate(-30deg);
  }
  50% {
    filter: blur(50px) hue-rotate(150deg);
  }
  100% {
    filter: blur(60px) hue-rotate(330deg);
  }
}

.ambient-glow {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(55px);
  opacity: 0.52;
  will-change: transform, filter;
}

/* Glow 1: Continuous Morphing Emerald / Cyan / Violet / Amber */
.glow-1 {
  top: 4%;
  left: 10%;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(74, 222, 128, 0.18) 0%, rgba(34, 197, 94, 0.08) 42%, transparent 70%);
  animation: ambientHueShift1 20s linear infinite;
}

/* Glow 2: Continuous Morphing Sky Cyan / Deep Indigo / Coral */
.glow-2 {
  top: 32%;
  right: 6%;
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.16) 0%, rgba(14, 165, 233, 0.07) 42%, transparent 70%);
  animation: ambientHueShift2 26s linear infinite;
}

/* Glow 3: Continuous Morphing Lavender Violet / Rose / Emerald */
.glow-3 {
  bottom: 10%;
  left: 8%;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(192, 132, 252, 0.16) 0%, rgba(168, 85, 247, 0.06) 42%, transparent 70%);
  animation: ambientHueShift3 24s linear infinite;
}

/* Glow 4: Continuous Morphing Warm Amber / Magenta / Teal */
.glow-4 {
  top: 60%;
  left: 42%;
  width: 460px;
  height: 460px;
  background: radial-gradient(circle, rgba(251, 146, 60, 0.14) 0%, rgba(245, 158, 11, 0.05) 42%, transparent 70%);
  animation: ambientHueShift4 30s linear infinite;
}

.ambient-frosted-diffuser {
  position: absolute;
  inset: 0;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: radial-gradient(circle at 50% 50%, transparent 65%, rgba(7, 9, 12, 0.3) 100%);
  pointer-events: none;
  z-index: 1;
}

/* ==========================================================================
   Navigation Bar
   ========================================================================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 15, 23, 0.78);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.85rem 0;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  transition: var(--transition-fast);
}

.back-link:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-color);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.nav-logo-box {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  overflow: hidden;
  background: #141b29;
  border: 1px solid rgba(16, 185, 129, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.2);
}

.nav-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.brand-version {
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald-bright);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-pill);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition-fast);
}

.nav-links a:hover {
  color: var(--accent-emerald-bright);
}

.btn-topbar-cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #141b29;
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(16, 185, 129, 0.35);
  transition: var(--transition-fast);
  overflow: hidden;
}

.btn-topbar-cta:hover {
  background: #1a2436;
  border-color: var(--accent-emerald);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.25);
}

.topbar-cta-icon {
  width: 16px;
  height: 16px;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-section {
  position: relative;
  z-index: 1;
  padding: 4.5rem 0 3.5rem;
  text-align: center;
}

.hero-content {
  max-width: 820px;
}

.hero-chips-container {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1.75rem;
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}

.chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.chip-emerald { border-color: rgba(16, 185, 129, 0.35); color: #a7f3d0; background: rgba(16, 185, 129, 0.08); }
.chip-emerald .chip-dot { background: var(--accent-emerald); box-shadow: 0 0 6px var(--accent-emerald); }

.chip-cyan { border-color: rgba(6, 182, 212, 0.35); color: #a5f3fc; background: rgba(6, 182, 212, 0.08); }
.chip-cyan .chip-dot { background: var(--accent-cyan); box-shadow: 0 0 6px var(--accent-cyan); }

.chip-purple { border-color: rgba(168, 85, 247, 0.35); color: #e9d5ff; background: rgba(168, 85, 247, 0.08); }
.chip-purple .chip-dot { background: var(--accent-purple); box-shadow: 0 0 6px var(--accent-purple); }

.chip-offline { border-color: rgba(255, 255, 255, 0.2); color: #e2e8f0; background: rgba(0, 0, 0, 0.4); }
.chip-offline .chip-dot { background: #94a3b8; }

.hero-title {
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  font-weight: 900;
  letter-spacing: -0.035em;
  line-height: 1.15;
  margin-bottom: 1.25rem;
  color: #ffffff;
}

.text-gradient-emerald {
  background: linear-gradient(135deg, #6ee7b7 0%, #10b981 50%, #059669 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin: 0 auto 2.25rem;
  max-width: 680px;
}

.hero-cta-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.85rem 1.65rem;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: var(--radius-pill);
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition-fast);
  border: none;
}

.btn-primary {
  background: var(--primary-gradient);
  color: #052e16;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(16, 185, 129, 0.5);
}

.play-store-svg {
  width: 18px;
  height: 18px;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

/* ==========================================================================
   Calculator Section & Interactive Card
   ========================================================================== */
.calc-section {
  position: relative;
  z-index: 1;
  padding: 2.5rem 0 4rem;
}

.section-header {
  margin-bottom: 2.5rem;
}

.text-center { text-align: center; }

.section-tag-chip {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.3rem 0.85rem;
  border-radius: var(--radius-pill);
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-emerald-bright);
  border: 1px solid rgba(16, 185, 129, 0.25);
  margin-bottom: 0.85rem;
}

.section-title {
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 0.75rem;
  color: #ffffff;
}

.section-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

/* Calculator Simulator Card */
.calc-simulator-card {
  position: relative;
  max-width: 460px;
  margin: 0 auto;
  background: rgba(16, 21, 32, 0.88);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 35px rgba(16, 185, 129, 0.12);
  overflow: hidden;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

/* Calculator Toolbar */
.calc-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  background: rgba(10, 14, 22, 0.95);
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 0.65rem;
}

.calc-modes {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  padding: 3px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-color);
}

.mode-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: var(--transition-fast);
}

.mode-tab-btn.active {
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-emerald-bright);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.25);
}

.calc-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.calc-tool-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: var(--transition-fast);
}

.calc-tool-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  border-color: rgba(16, 185, 129, 0.4);
}

.history-count-badge {
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-emerald-bright);
  font-size: 0.68rem;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-pill);
}

/* Calculator Body Layout */
.calc-body-layout {
  position: relative;
  overflow: hidden;
}

/* Screen */
.calc-screen {
  padding: 1.5rem 1.5rem 1.25rem;
  background: #090d15;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 140px;
}

.screen-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.screen-badge {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-emerald-bright);
  background: rgba(16, 185, 129, 0.12);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-pill);
}

.btn-screen-copy {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-dim);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: var(--transition-fast);
}

.btn-screen-copy:hover {
  color: var(--accent-emerald-bright);
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.08);
}

.screen-expression {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--text-dim);
  text-align: right;
  min-height: 1.4rem;
  word-break: break-all;
  margin-bottom: 0.35rem;
}

.screen-result {
  font-family: var(--font-mono);
  font-size: 2.7rem;
  font-weight: 800;
  color: #ffffff;
  text-align: right;
  letter-spacing: -0.02em;
  word-break: break-all;
  line-height: 1.1;
  cursor: pointer;
}

/* Keypad Grid */
.calc-keypad {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  padding: 1.25rem;
  background: #0f1420;
}

.key-btn {
  height: 58px;
  border-radius: 18px;
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  border: 1px solid var(--border-color);
  background: #161c29;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.key-btn:active {
  transform: scale(0.94);
}

.key-num {
  background: #171d2b;
  color: #ffffff;
}

.key-num:hover {
  background: #1e2638;
  border-color: rgba(255, 255, 255, 0.16);
}

.key-action {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.25);
}

.key-action:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: #ef4444;
}

.key-func {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
}

.key-func:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.key-operator {
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-emerald-bright);
  border-color: rgba(16, 185, 129, 0.25);
  font-size: 1.35rem;
}

.key-operator:hover {
  background: rgba(16, 185, 129, 0.2);
  border-color: var(--accent-emerald);
}

.key-equals {
  background: var(--primary-gradient);
  color: #052e16;
  border: none;
  font-size: 1.5rem;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35);
}

.key-equals:hover {
  box-shadow: 0 6px 22px rgba(16, 185, 129, 0.55);
  filter: brightness(1.1);
}

/* Base Converter Pane */
.calc-converter-pane {
  padding: 1.5rem;
  background: #0d121c;
}

.converter-header {
  margin-bottom: 1.25rem;
}

.conv-title {
  display: block;
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 0.25rem;
}

.conv-sub {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.converter-input-wrap {
  margin-bottom: 1.25rem;
}

.converter-input-wrap label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 0.45rem;
}

.converter-input {
  width: 100%;
  background: #141b29;
  border: 1px solid var(--border-color);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.converter-input:focus {
  border-color: var(--accent-emerald);
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.2);
}

.converter-results-grid {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.conv-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #141a27;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  gap: 0.75rem;
}

.conv-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.conv-base-tag {
  font-size: 0.68rem;
  font-weight: 800;
  font-family: var(--font-mono);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-pill);
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald-bright);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.tag-cyan { background: rgba(6, 182, 212, 0.15); color: #67e8f9; border-color: rgba(6, 182, 212, 0.3); }
.tag-amber { background: rgba(245, 158, 11, 0.15); color: #fde047; border-color: rgba(245, 158, 11, 0.3); }
.tag-purple { background: rgba(168, 85, 247, 0.15); color: #d8b4fe; border-color: rgba(168, 85, 247, 0.3); }

.conv-base-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.conv-val-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.conv-val {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  word-break: break-all;
  text-align: right;
}

.btn-copy-base {
  background: transparent;
  border: none;
  font-size: 0.95rem;
  cursor: pointer;
  opacity: 0.6;
  transition: var(--transition-fast);
}

.btn-copy-base:hover {
  opacity: 1;
  transform: scale(1.15);
}

/* History Drawer */
.calc-history-drawer {
  position: absolute;
  inset: 0;
  background: rgba(13, 18, 28, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 20;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.calc-history-drawer.open {
  transform: translateY(0);
}

.history-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.history-drawer-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffffff;
}

.btn-clear-history {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-clear-history:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
}

.history-list {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.history-item {
  background: #171d2b;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.history-item:hover {
  background: #1e2638;
  border-color: rgba(16, 185, 129, 0.4);
}

.hist-expr {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 0.2rem;
}

.hist-res {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--accent-emerald-bright);
}

.history-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-dim);
  font-size: 0.9rem;
}

/* Toast */
.sim-toast {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: rgba(15, 22, 33, 0.95);
  border: 1px solid var(--accent-emerald);
  color: #ffffff;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 20px rgba(16, 185, 129, 0.4);
  pointer-events: none;
  opacity: 0;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 30;
}

.sim-toast.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* ==========================================================================
   Feature Suite Section
   ========================================================================== */
.features-section {
  position: relative;
  z-index: 1;
  padding: 5rem 0;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.2rem 1.8rem;
  transition: var(--transition-smooth);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.feature-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(16, 185, 129, 0.3);
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4), 0 0 24px rgba(16, 185, 129, 0.08);
}

.feature-card-glow {
  position: absolute;
  top: -60px;
  right: -60px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  filter: blur(50px);
  opacity: 0.2;
  pointer-events: none;
}

.glow-emerald { background: var(--accent-emerald); }
.glow-cyan { background: var(--accent-cyan); }
.glow-purple { background: var(--accent-purple); }
.glow-amber { background: var(--accent-amber); }
.glow-blue { background: var(--accent-blue); }
.glow-gold { background: #eab308; }

.feature-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.feature-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  border: 1px solid var(--border-color);
}

.icon-emerald { background: rgba(16, 185, 129, 0.12); border-color: rgba(16, 185, 129, 0.3); }
.icon-cyan { background: rgba(6, 182, 212, 0.12); border-color: rgba(6, 182, 212, 0.3); }
.icon-purple { background: rgba(168, 85, 247, 0.12); border-color: rgba(168, 85, 247, 0.3); }
.icon-amber { background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.3); }
.icon-blue { background: rgba(59, 130, 246, 0.12); border-color: rgba(59, 130, 246, 0.3); }
.icon-gold { background: rgba(234, 179, 8, 0.12); border-color: rgba(234, 179, 8, 0.3); }

.feature-tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-pill);
}

.tag-emerald { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.3); }
.tag-cyan { background: rgba(6, 182, 212, 0.15); color: #67e8f9; border: 1px solid rgba(6, 182, 212, 0.3); }
.tag-purple { background: rgba(168, 85, 247, 0.15); color: #d8b4fe; border: 1px solid rgba(168, 85, 247, 0.3); }
.tag-amber { background: rgba(245, 158, 11, 0.15); color: #fde047; border: 1px solid rgba(245, 158, 11, 0.3); }
.tag-blue { background: rgba(59, 130, 246, 0.15); color: #93c5fd; border: 1px solid rgba(59, 130, 246, 0.3); }
.tag-gold { background: rgba(234, 179, 8, 0.15); color: #fef08a; border: 1px solid rgba(234, 179, 8, 0.3); }

.feature-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 0.65rem;
  letter-spacing: -0.015em;
}

.feature-text {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ==========================================================================
   Banner Showcase Section
   ========================================================================== */
.banner-showcase-section {
  position: relative;
  z-index: 1;
  padding: 3rem 0;
}

.showcase-card {
  background: linear-gradient(135deg, #101624 0%, #151d30 100%);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-lg);
  padding: 3.5rem;
  overflow: hidden;
}

.showcase-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: center;
  gap: 3rem;
}

.showcase-title {
  font-size: clamp(2rem, 3.5vw, 2.6rem);
  font-weight: 800;
  color: #ffffff;
  line-height: 1.15;
  margin: 0.85rem 0 1rem;
}

.showcase-text {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.75rem;
}

.showcase-highlights {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.highlight-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.92rem;
  color: #e2e8f0;
  font-weight: 600;
}

.hl-bullet {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-emerald-bright);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

.showcase-visual {
  display: flex;
  justify-content: center;
}

.showcase-banner-img {
  width: 100%;
  max-width: 420px;
  border-radius: var(--radius-md);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   Searchable User Guide / FAQ Section
   ========================================================================== */
.userguide-section {
  position: relative;
  z-index: 1;
  padding: 5rem 0;
}

.faq-search-wrap {
  position: relative;
  max-width: 680px;
  margin: 0 auto 2.5rem;
}

.search-icon {
  position: absolute;
  left: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}

.faq-search-input {
  width: 100%;
  background: rgba(21, 28, 44, 0.8);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 0.95rem;
  font-family: inherit;
  padding: 1rem 1.25rem 1rem 3.25rem;
  border-radius: var(--radius-pill);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: var(--transition-fast);
}

.faq-search-input:focus {
  border-color: var(--accent-emerald);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
}

.faq-search-input::placeholder {
  color: var(--text-dim);
}

.faq-accordion {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition-fast);
}

.faq-item:hover {
  border-color: rgba(255, 255, 255, 0.16);
  background: var(--bg-card-hover);
}

.faq-item.active {
  border-color: rgba(16, 185, 129, 0.35);
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 1rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  gap: 1rem;
}

.faq-chevron {
  color: var(--text-dim);
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.faq-item.active .faq-chevron {
  transform: rotate(180deg);
  color: var(--accent-emerald-bright);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1), padding 0.35s ease;
  padding: 0 1.5rem;
}

.faq-item.active .faq-answer {
  padding: 0 1.5rem 1.4rem;
}

.faq-answer p {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* ==========================================================================
   Bottom CTA Banner
   ========================================================================== */
.cta-banner-section {
  position: relative;
  z-index: 1;
  padding: 2rem 0 5rem;
}

.cta-banner-card {
  position: relative;
  background: linear-gradient(135deg, #101624 0%, #141c2e 100%);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-lg);
  padding: 3.5rem 3rem;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: center;
  gap: 2.5rem;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 30px rgba(16, 185, 129, 0.1);
}

.cta-banner-glow {
  position: absolute;
  top: -80px;
  left: -80px;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.25) 0%, transparent 70%);
  filter: blur(60px);
  pointer-events: none;
}

.cta-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-emerald-bright);
  margin-bottom: 0.75rem;
}

.cta-title {
  font-size: clamp(1.8rem, 3vw, 2.3rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 0.85rem;
  color: #ffffff;
}

.cta-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
  line-height: 1.6;
}

.cta-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.cta-banner-media {
  display: flex;
  justify-content: center;
}

.cta-media-img {
  width: 100%;
  max-width: 440px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  position: relative;
  z-index: 1;
  background: #090c12;
  border-top: 1px solid var(--border-color);
  padding: 4rem 0 3rem;
}

.footer-container {
  display: grid;
  grid-template-columns: 1.2fr 2fr;
  gap: 3rem;
}

.footer-brand-col {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.footer-desc {
  font-size: 0.9rem;
  color: var(--text-dim);
  max-width: 320px;
  line-height: 1.55;
}

.copyright {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 0.5rem;
}

.footer-links-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.footer-heading {
  font-size: 0.85rem;
  font-weight: 700;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
}

.footer-col a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  transition: var(--transition-fast);
}

.footer-col a:hover {
  color: var(--accent-emerald-bright);
}

.active-footer-link {
  color: var(--accent-emerald-bright) !important;
  font-weight: 600;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .showcase-grid { grid-template-columns: 1fr; gap: 2rem; }
  .cta-banner-card {
    grid-template-columns: 1fr;
    padding: 2.5rem 1.8rem;
    text-align: center;
  }
  .cta-actions { justify-content: center; }
  .footer-container { grid-template-columns: 1fr; gap: 2.5rem; }
}

@media (max-width: 640px) {
  .hero-title { font-size: 2.2rem; }
  .hero-subtitle { font-size: 1rem; }
  .calc-simulator-card { border-radius: 20px; }
  .screen-result { font-size: 2.1rem; }
  .key-btn { height: 52px; font-size: 1.15rem; }
  .footer-links-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .calc-toolbar { flex-direction: column; align-items: stretch; }
  .calc-modes, .calc-toolbar-actions { justify-content: center; }
}

/* Responsive Top Navbar (Matches ExpenseMate) */
.back-link,
.brand,
.btn-topbar-cta {
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .navbar {
    padding: 10px 0;
  }

  .nav-container {
    padding: 0 16px;
    gap: 10px;
  }

  .nav-links {
    display: none;
  }

  .back-link-text {
    display: none;
  }

  .back-link {
    padding: 7px 10px;
  }
}

@media (max-width: 420px) {
  .brand-version {
    display: none;
  }

  .nav-logo-box {
    width: 34px;
    height: 34px;
  }

  .brand-name {
    font-size: 1.05rem;
  }

  .btn-topbar-cta {
    padding: 7px 12px;
    font-size: 0.82rem;
  }

  .btn-topbar-cta .topbar-cta-icon {
    width: 14px;
    height: 14px;
  }
}
