/* ==========================================================================
   MINIMALIST DESIGN SYSTEM & TOKENS (TRUECALCI GLOBAL)
   State-of-the-art Futuristic Minimal Palettes & Micro-Interactions
   Light: "Alabaster Precision" | Dark: "Obsidian Lumina"
   ========================================================================== */

:root {
  /* Color Palette - Alabaster Cream Editorial Light */
  --bg-app: #f9f9f8;
  --bg-surface: #ffffff;
  --bg-subtle: #f4f4f2;
  --bg-card: #ffffff;
  --border-color: #e5e5e3;
  --border-subtle: #f0f0ee;
  --border-hover: #d4d4d0;
  
  --text-primary: #1c1917;
  --text-secondary: #57534e;
  --text-muted: #8c857e;
  
  /* Brand Accent: Precision Tech Blue & Mint */
  --accent-primary: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-light: rgba(37, 99, 235, 0.08);
  --accent-border: rgba(37, 99, 235, 0.22);
  --accent-glow: rgba(37, 99, 235, 0.18);
  
  --emerald-primary: #059669;
  --emerald-light: rgba(5, 150, 105, 0.08);
  --emerald-border: rgba(5, 150, 105, 0.22);
  
  --amber-primary: #d97706;
  --amber-light: rgba(217, 119, 6, 0.08);
  --amber-border: rgba(217, 119, 6, 0.25);
  
  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: 'Plus Jakarta Sans', var(--font-sans);
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Roboto Mono', monospace;
  
  /* Layered Ambient Shadows */
  --shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.04), 0 1px 2px -1px rgba(15, 23, 42, 0.02);
  --shadow-md: 0 4px 12px -2px rgba(15, 23, 42, 0.05), 0 2px 4px -1px rgba(15, 23, 42, 0.03);
  --shadow-lg: 0 16px 32px -4px rgba(15, 23, 42, 0.08), 0 6px 12px -3px rgba(15, 23, 42, 0.03);
  --shadow-glow: 0 0 20px -4px rgba(37, 99, 235, 0.20);

  /* Micro-Motion Timing */
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: 0.15s var(--ease-spring);
  --transition-base: 0.22s var(--ease-spring);
  --transition-smooth: 0.35s var(--ease-spring);
  
  /* Layout Proportions */
  --max-width: 1560px;
  --sidebar-left-width: 205px;
  --sidebar-ad-width: 275px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
}

[data-theme="dark"], [data-theme="obsidian"] {
  /* Color Palette - Obsidian Stone (Soft Warm Zinc & Charcoal, Zero Retinal Glare) */
  --bg-app: #121214;
  --bg-surface: #18181b;
  --bg-subtle: #202024;
  --bg-card: #18181b;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(255, 255, 255, 0.05);
  --border-hover: rgba(59, 130, 246, 0.35);
  
  --text-primary: #d4d4d8;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  
  /* Refined Electric Tech Blue Accent */
  --accent-primary: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-light: rgba(59, 130, 246, 0.12);
  --accent-border: rgba(59, 130, 246, 0.28);
  --accent-glow: rgba(59, 130, 246, 0.22);
  
  --emerald-primary: #10b981;
  --emerald-light: rgba(16, 185, 129, 0.10);
  --emerald-border: rgba(16, 185, 129, 0.25);

  --amber-primary: #f59e0b;
  --amber-light: rgba(245, 158, 11, 0.10);
  --amber-border: rgba(245, 158, 11, 0.25);
  
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.35);
  --shadow-md: 0 6px 18px -2px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.05);
  --shadow-lg: 0 20px 40px -6px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.07);
  --shadow-glow: 0 0 24px -4px rgba(59, 130, 246, 0.25);
}

html {
  scroll-behavior: smooth;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Micro-motion for view transitions */
@keyframes fadeInTool {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#tool-view-mount {
  animation: fadeInTool 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Glassmorphism & Modern Elevation Utilities */
.glass-card, .glass-panel {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}

.glass-card-interactive {
  cursor: pointer;
  transition: all var(--transition-base);
}

.glass-card-interactive:hover {
  transform: translateY(-3px);
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-lg), 0 0 24px -4px var(--accent-glow);
}

.glow-badge-blue {
  background: var(--accent-light);
  color: var(--accent-primary);
  border: 1px solid var(--accent-border);
  box-shadow: 0 0 12px -2px var(--accent-glow);
}

/* Header */
.app-header {
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(8px);
  min-height: 60px;
  contain: layout;
}

.header-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

/* Header Center Global Search Omnibar */
.header-search-container {
  flex: 1;
  max-width: 460px;
  position: relative;
}

@media (max-width: 768px) {
  .header-search-container {
    display: none;
  }
}

.header-search-box {
  position: relative;
  width: 100%;
}

.header-search-input {
  width: 100%;
  padding: 0.5rem 1rem 0.5rem 2.25rem;
  font-family: var(--font-sans);
  font-size: 0.84rem;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  color: var(--text-primary);
  outline: none;
  transition: all var(--transition-base);
}

.header-search-input:focus {
  border-color: var(--accent-primary);
  background-color: var(--bg-surface);
  box-shadow: 0 0 0 3.5px var(--accent-light), 0 2px 8px rgba(0, 0, 0, 0.04);
}

.header-search-icon {
  position: absolute;
  left: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.82rem;
  color: var(--text-muted);
  pointer-events: none;
}

.header-search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 380px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
  backdrop-filter: blur(12px);
}

.header-search-dropdown.active {
  display: flex;
  flex-direction: column;
}

.search-dropdown-item {
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  border-bottom: 1px solid var(--border-subtle);
  text-decoration: none;
  color: var(--text-primary);
  font-size: 0.84rem;
  transition: all var(--transition-fast);
}

.search-dropdown-item:hover {
  background-color: var(--bg-subtle);
  padding-left: 1.15rem;
}

.search-dropdown-item-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}

.search-dropdown-item-cat {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
}

.brand-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
  cursor: pointer;
}

.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: block;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
  image-rendering: -webkit-optimize-contrast;
}

.brand-area:hover .brand-icon {
  transform: translateY(-1px) scale(1.04);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}

.brand-title {
  font-size: 1.18rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text-primary) 30%, var(--accent-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background-color: var(--accent-light);
  color: var(--accent-primary);
  border: 1px solid var(--accent-border);
  margin-left: 4px;
}

/* ==========================================================================
   LIVE FINANCIAL MARKETS & BULLION RATES TICKER BAR
   ========================================================================== */
.live-rates-ticker-bar {
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  font-size: 0.76rem;
  font-family: var(--font-sans);
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  -ms-overflow-style: none;
  z-index: 40;
  position: relative;
}

.live-rates-ticker-bar::-webkit-scrollbar {
  display: none;
}

.ticker-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.35rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.ticker-status {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 800;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  color: var(--accent-primary);
  flex-shrink: 0;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: #10b981;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse-green 1.8s infinite;
}

@keyframes pulse-green {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.ticker-items {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex: 1;
}

.ticker-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-secondary);
  font-weight: 600;
  cursor: default;
}

.ticker-clickable {
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.ticker-clickable:hover {
  background-color: var(--bg-subtle);
  color: var(--text-primary);
}

.ticker-name {
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 700;
}

.ticker-price {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-primary);
}

.ticker-change {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
}

.ticker-change.up {
  color: #059669;
  background: rgba(16, 185, 129, 0.12);
}

.ticker-change.down {
  color: #dc2626;
  background: rgba(239, 68, 68, 0.12);
}

.ticker-divider {
  width: 1px;
  height: 12px;
  background-color: var(--border-color);
  flex-shrink: 0;
}

.ticker-time {
  font-size: 0.68rem;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-left: auto;
}

/* Navigation Categories Bar */
.nav-categories {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.25rem 0;
}

.nav-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-tab-btn:hover {
  background-color: var(--bg-subtle);
  color: var(--text-primary);
}

.nav-tab-btn.active {
  background-color: var(--accent-light);
  color: var(--accent-primary);
  border-color: var(--accent-border);
}

/* Header Actions & Mobile Menu Button */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mobile-menu-btn {
  display: none;
  align-items: center;
  gap: 0.45rem;
  background: var(--accent-light);
  color: var(--accent-primary);
  border: 1px solid var(--accent-border);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-base);
}

.mobile-menu-btn:hover {
  background: var(--accent-primary);
  color: #ffffff;
  transform: translateY(-1.5px);
  box-shadow: 0 4px 12px -2px var(--accent-glow);
}

.mobile-menu-btn:active {
  transform: translateY(0.5px) scale(0.97);
}

.icon-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 1rem;
  transition: all var(--transition-base);
}

.icon-btn:hover {
  color: var(--text-primary);
  border-color: var(--accent-border);
  background-color: var(--accent-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px -2px var(--accent-light);
}

.icon-btn:active {
  transform: translateY(0.5px) scale(0.96);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
  transition: transform var(--transition-fast);
}

.icon-btn:hover svg {
  transform: scale(1.1);
}

/* Main Grid Layout: Workstation (Left Nav + Center Workspace) */
.app-layout-grid {
  max-width: var(--max-width);
  margin: 0.75rem auto 1.5rem auto;
  padding: 0 1.25rem;
  display: grid;
  grid-template-columns: var(--sidebar-left-width) 1fr;
  gap: 1rem;
  align-items: start;
  flex: 1;
  width: 100%;
}

/* Left Sidebar Navigation Panel (Desktop Compact Sticky / Mobile Off-Canvas Drawer) */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9998;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.sidebar-backdrop.active {
  display: block;
  opacity: 1;
}

.app-sidebar-nav {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 0.65rem 0.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: sticky;
  top: 4.5rem;
  max-height: calc(100vh - 5.5rem);
  overflow-y: auto;
  /* Completely remove scrollbars per user requirement */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.app-sidebar-nav::-webkit-scrollbar {
  display: none;
}

.sidebar-header-mobile {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-header-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.sidebar-close-btn {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.sidebar-close-btn:hover {
  color: var(--text-primary);
  background: var(--bg-subtle);
}

.sidebar-search-box {
  position: relative;
  width: 100%;
}

.sidebar-search-input {
  width: 100%;
  padding: 0.45rem 0.65rem 0.45rem 2rem;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s ease;
}

.sidebar-search-input:focus {
  border-color: var(--accent-primary);
}

.sidebar-search-icon {
  position: absolute;
  left: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8rem;
  color: var(--text-muted);
  pointer-events: none;
}

.nav-section {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.nav-section-title {
  font-size: 0.64rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0.2rem 0.5rem;
  margin-top: 0.15rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.38rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.77rem; /* Decreased font size for compact elegance */
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-base);
  background: transparent;
  border: 1px solid transparent;
  width: 100%;
  text-align: left;
  position: relative;
  overflow: hidden;
}

.sidebar-link:hover {
  background-color: var(--bg-subtle);
  color: var(--text-primary);
  transform: translateX(3px);
  border-color: var(--border-subtle);
}

.sidebar-link.active {
  background-color: var(--accent-light);
  color: var(--accent-primary);
  border-color: var(--accent-border);
  box-shadow: var(--shadow-sm);
}

.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 15%;
  bottom: 15%;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background-color: var(--accent-primary);
  box-shadow: 0 0 8px var(--accent-primary);
}

.sidebar-link:active {
  transform: scale(0.985);
}

.sidebar-link-content {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.sidebar-link-content svg {
  width: 14px;
  height: 14px;
}

.sidebar-tag {
  font-size: 0.58rem;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  background-color: var(--emerald-light);
  color: var(--emerald-primary);
}

/* Center Workspace */
.calculator-main-workspace {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: visible;
  display: flex;
  flex-direction: column;
  min-height: 540px;
  scroll-margin-top: 80px;
}

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

.workspace-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.workspace-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.workspace-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* SEBI & Regulatory Disclaimer Footer Banner */
.regulatory-disclaimer {
  background-color: var(--bg-subtle);
  border-top: 1px solid var(--border-color);
  padding: 1rem 1.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.disclaimer-header {
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Responsive adjustments */
@media (max-width: 1240px) {
  .app-layout-grid {
    grid-template-columns: 240px 1fr;
  }
  .ad-column-container {
    display: none;
  }
}

@media (max-width: 900px) {
  .mobile-menu-btn {
    display: inline-flex;
  }
  
  .app-layout-grid {
    grid-template-columns: 1fr;
    padding: 0 0.75rem;
    margin: 0.75rem auto;
    gap: 1rem;
  }

  /* Slide-out Off-Canvas Drawer on Mobile */
  .app-sidebar-nav {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 300px;
    max-width: 85vw;
    height: 100vh;
    max-height: 100vh;
    z-index: 9999 !important;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 0 18px 18px 0;
    box-shadow: 6px 0 30px rgba(0, 0, 0, 0.35);
    background-color: var(--bg-surface);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
  }

  .app-sidebar-nav.drawer-open {
    display: flex !important;
    transform: translateX(0) !important;
    visibility: visible !important;
  }

  .sidebar-header-mobile {
    display: flex;
  }
}

@media (max-width: 640px) {
  .header-container {
    padding: 0.6rem 0.85rem;
  }

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

  .brand-badge {
    display: none;
  }

  .workspace-header {
    padding: 0.75rem 1rem;
  }

  .workspace-title {
    font-size: 1rem;
  }

  .workspace-subtitle {
    font-size: 0.72rem;
  }
}

/* ==========================================================================
   THEME PALETTE PICKER (OBSIDIAN / CYBER / ALABASTER TOGGLE)
   ========================================================================== */
.theme-palette-picker {
  display: flex;
  align-items: center;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 2px;
  gap: 2px;
}

.palette-pill-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.32rem 0.65rem;
  border-radius: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: all var(--transition-base);
  white-space: nowrap;
}

.palette-pill-btn:hover {
  color: var(--text-primary);
  transform: translateY(-1px);
}

.palette-pill-btn:active {
  transform: scale(0.96);
}

.palette-pill-btn.active {
  background-color: var(--bg-surface);
  color: var(--accent-primary);
  border-color: var(--border-color);
  box-shadow: var(--shadow-sm);
  font-weight: 800;
}

/* Glassmorphism & Enterprise Portal Design Tokens */
.glass-card {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
}

.glass-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}

@keyframes pulseDot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.pulse-indicator {
  animation: pulseDot 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

/* Tavily-Style Enterprise Navigation Dropdowns */
.enterprise-nav-menu {
  display: flex;
  align-items: center;
  gap: 4px;
}

@media (max-width: 900px) {
  .enterprise-nav-menu {
    display: none !important;
  }
}

.nav-dropdown-wrapper {
  position: relative;
}

.nav-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.nav-dropdown-trigger:hover,
.nav-dropdown-wrapper:hover .nav-dropdown-trigger {
  color: var(--text-primary);
  background: var(--bg-subtle);
}

.nav-dropdown-shelf {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 280px;
  padding: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  display: none;
  flex-direction: column;
  gap: 4px;
  z-index: 1000;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.nav-dropdown-wrapper:hover .nav-dropdown-shelf {
  display: flex;
  animation: fadeInDown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.nav-shelf-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.15s ease;
}

.nav-shelf-item:hover {
  background: var(--bg-subtle);
}

.nav-shelf-icon {
  font-size: 1.15rem;
  margin-top: 1px;
}

.nav-shelf-title {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.nav-shelf-desc {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.nav-menu-link {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.nav-menu-link:hover {
  color: var(--text-primary);
  background: var(--bg-subtle);
}

/* Full-Width Enterprise Homepage & Pricing Layout Override */
body[data-view="home"] .app-sidebar-nav:not(.drawer-open),
body[data-view="home"] .app-sidebar-ad,
body[data-view="pricing"] .app-sidebar-nav:not(.drawer-open),
body[data-view="pricing"] .app-sidebar-ad,
body[data-view="developer"] .app-sidebar-nav:not(.drawer-open),
body[data-view="developer"] .app-sidebar-ad,
body[data-view="admin"] .app-sidebar-nav:not(.drawer-open),
body[data-view="admin"] .app-sidebar-ad {
  display: none !important;
}

/* Universal Mobile / Drawer-Open Sidebar Upgrade (Apple / Linear UI Treatment) */
.app-sidebar-nav.drawer-open,
body[data-view="home"] .app-sidebar-nav.drawer-open,
body[data-view="pricing"] .app-sidebar-nav.drawer-open,
body[data-view="developer"] .app-sidebar-nav.drawer-open,
body[data-view="admin"] .app-sidebar-nav.drawer-open {
  display: flex !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  bottom: 0 !important;
  width: 315px !important;
  max-width: 88vw !important;
  height: 100vh !important;
  max-height: 100vh !important;
  z-index: 99999 !important;
  transform: translateX(0) !important;
  visibility: visible !important;
  opacity: 1 !important;
  
  /* Translucent frosted glassmorphism instead of flat black */
  background: rgba(18, 20, 28, 0.94) !important;
  backdrop-filter: blur(28px) saturate(190%) !important;
  -webkit-backdrop-filter: blur(28px) saturate(190%) !important;
  
  border-radius: 0 20px 20px 0 !important;
  border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-top: none !important;
  border-bottom: none !important;
  border-left: none !important;
  
  box-shadow: 20px 0 60px -10px rgba(0, 0, 0, 0.6), 
              0 0 0 1px rgba(255, 255, 255, 0.05) !important;
              
  padding: 0 !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  flex-direction: column !important;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

[data-theme="light"] .app-sidebar-nav.drawer-open,
[data-theme="light"] body[data-view="home"] .app-sidebar-nav.drawer-open,
[data-theme="light"] body[data-view="pricing"] .app-sidebar-nav.drawer-open,
[data-theme="light"] body[data-view="developer"] .app-sidebar-nav.drawer-open,
[data-theme="light"] body[data-view="admin"] .app-sidebar-nav.drawer-open {
  background: rgba(255, 255, 255, 0.95) !important;
  border-right: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 20px 0 60px -10px rgba(0, 0, 0, 0.15), 
              0 0 0 1px rgba(0, 0, 0, 0.04) !important;
}

/* Premium Drawer Header with Brand Monogram & Count */
.app-sidebar-nav.drawer-open .sidebar-header-mobile {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 16px 18px 14px !important;
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.1) 0%, transparent 100%) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07) !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 10 !important;
  backdrop-filter: blur(12px) !important;
}

[data-theme="light"] .app-sidebar-nav.drawer-open .sidebar-header-mobile {
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.05) 0%, transparent 100%) !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
}

.app-sidebar-nav.drawer-open .sidebar-header-title {
  font-family: var(--font-display) !important;
  font-size: 0.98rem !important;
  font-weight: 700 !important;
  color: var(--text-primary) !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  letter-spacing: -0.01em !important;
}

.drawer-count-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 0.68rem;
  font-weight: 700;
  border-radius: 20px;
  background: rgba(37, 99, 235, 0.15);
  color: #3b82f6;
  border: 1px solid rgba(37, 99, 235, 0.25);
  letter-spacing: 0.02em;
}

.app-sidebar-nav.drawer-open .sidebar-close-btn {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 32px !important;
  height: 32px !important;
  border-radius: 50% !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: var(--text-secondary) !important;
  font-size: 1.25rem !important;
  line-height: 1 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  padding: 0 !important;
}

[data-theme="light"] .app-sidebar-nav.drawer-open .sidebar-close-btn {
  background: rgba(0, 0, 0, 0.04) !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
}

.app-sidebar-nav.drawer-open .sidebar-close-btn:hover {
  background: rgba(239, 68, 68, 0.14) !important;
  color: #ef4444 !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
  transform: rotate(90deg) !important;
}

/* Nav Section Spacing & Titles in Drawer */
.app-sidebar-nav.drawer-open nav {
  padding: 12px 14px 20px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 14px !important;
}

.app-sidebar-nav.drawer-open .nav-section {
  display: flex !important;
  flex-direction: column !important;
  gap: 3px !important;
}

.app-sidebar-nav.drawer-open .nav-section-title {
  font-size: 0.68rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
  color: var(--accent-primary) !important;
  padding: 6px 8px 4px !important;
  opacity: 0.95 !important;
}

/* Links inside Drawer */
.app-sidebar-nav.drawer-open .sidebar-link {
  padding: 8px 12px !important;
  border-radius: 10px !important;
  font-size: 0.82rem !important;
  font-weight: 500 !important;
  color: var(--text-secondary) !important;
  background: rgba(255, 255, 255, 0.02) !important;
  border: 1px solid transparent !important;
  transition: all 0.2s ease !important;
}

[data-theme="light"] .app-sidebar-nav.drawer-open .sidebar-link {
  background: rgba(0, 0, 0, 0.015) !important;
}

.app-sidebar-nav.drawer-open .sidebar-link:hover {
  background: rgba(255, 255, 255, 0.07) !important;
  color: var(--text-primary) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  transform: translateX(3px) !important;
}

[data-theme="light"] .app-sidebar-nav.drawer-open .sidebar-link:hover {
  background: rgba(0, 0, 0, 0.04) !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
}

.app-sidebar-nav.drawer-open .sidebar-link.active {
  background: rgba(37, 99, 235, 0.12) !important;
  color: var(--accent-primary) !important;
  border-color: rgba(37, 99, 235, 0.3) !important;
  font-weight: 600 !important;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.15) !important;
}

.app-sidebar-nav.drawer-open .sidebar-tag {
  font-size: 0.68rem !important;
  font-weight: 600 !important;
  padding: 2px 8px !important;
  border-radius: 12px !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* Drawer Bottom Quick Action Strip */
.sidebar-drawer-footer {
  margin-top: auto;
  padding: 14px 18px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

[data-theme="light"] .sidebar-drawer-footer {
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(0, 0, 0, 0.02);
}

.sidebar-drawer-footer-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.sidebar-drawer-footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s;
}

.sidebar-drawer-footer-links a:hover {
  color: var(--accent-primary);
}

/* Currency Dropdown is strictly hidden across the entire site, ONLY displayed on the Pricing page */
.currency-dropdown-wrapper {
  display: none !important;
}

body[data-view="pricing"] .currency-dropdown-wrapper {
  display: inline-flex !important;
}

body[data-view="home"] .app-layout-grid,
body[data-view="pricing"] .app-layout-grid,
body[data-view="developer"] .app-layout-grid,
body[data-view="admin"] .app-layout-grid {
  grid-template-columns: 1fr !important;
  max-width: 1440px !important;
  padding: 0 1rem !important;
}

body[data-view="home"] .app-workspace,
body[data-view="pricing"] .app-workspace,
body[data-view="developer"] .app-workspace,
body[data-view="admin"] .app-workspace {
  max-width: 100% !important;
  width: 100% !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

/* Minimal Currency Toggle Pill */
.currency-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 6px;
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.15s ease;
}

.currency-pill-btn:hover {
  background: var(--bg-subtle);
  border-color: var(--border-hover);
}

.currency-menu-item:hover {
  background: var(--bg-subtle) !important;
}

/* Day / Night Single Theme Toggle Button */
.theme-icon-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-icon-toggle-btn:hover {
  color: var(--text-primary);
  background: var(--bg-subtle);
  border-color: var(--border-hover);
}

[data-theme="dark"] .theme-icon-sun {
  display: none !important;
}

[data-theme="dark"] .theme-icon-moon {
  display: block !important;
}

/* ==========================================================================
   INTERACTIVE GLASSMORPHISM CARDS (Apple / Linear Grade)
   ========================================================================== */
.pillar-glass-card {
  position: relative;
  padding: 32px 28px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.06);
  overflow: hidden;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), 
              box-shadow 0.22s cubic-bezier(0.16, 1, 0.3, 1), 
              border-color 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  transform-style: preserve-3d;
  will-change: transform;
}

[data-theme="light"] .pillar-glass-card {
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(226, 232, 240, 0.95);
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(0, 0, 0, 0.03);
}

[data-theme="dark"] .pillar-glass-card,
[data-theme="obsidian"] .pillar-glass-card {
  background: rgba(24, 24, 27, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 36px 0 rgba(0, 0, 0, 0.4);
}

.pillar-glass-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    500px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(37, 99, 235, 0.16),
    transparent 50%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 1;
}

.pillar-glass-card:hover::before {
  opacity: 1;
}

.pillar-glass-card:hover {
  transform: translateY(-6px);
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 20px 45px -10px rgba(37, 99, 235, 0.2), 0 0 0 1px rgba(37, 99, 235, 0.25);
}

.pillar-glass-card-content {
  position: relative;
  z-index: 2;
}

/* Header Search Button on Mobile */
.header-mobile-search-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  transition: all 0.2s ease;
}

.header-mobile-search-btn:hover {
  color: var(--text-primary);
  background: var(--bg-subtle);
  border-color: var(--border-hover);
}

/* Mobile Header Refinements */
@media (max-width: 768px) {
  .header-search-container {
    display: none;
  }
  .header-mobile-search-btn {
    display: inline-flex;
  }
}

@media (max-width: 640px) {
  .header-container {
    padding: 0.5rem 0.65rem !important;
    gap: 0.4rem !important;
  }

  .brand-area {
    gap: 6px !important;
  }

  .brand-icon {
    width: 28px !important;
    height: 28px !important;
  }

  .brand-title {
    font-size: 1.02rem !important;
  }

  .workstation-text {
    display: none !important;
  }

  .header-workstation-btn {
    padding: 6px 8px !important;
  }

  .header-cta-btn {
    padding: 6px 10px !important;
    font-size: 0.78rem !important;
    white-space: nowrap !important;
  }

  #header-auth-btn-text {
    font-size: 0.78rem !important;
  }
}



