/* Modern QuickBooks-inspired Styling & Responsive Cross-Browser Micro-interactions */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  --qb-green: #2CA01C;
  --qb-green-dark: #1E7B12;
  --qb-green-light: #EBF7EB;
  --qb-blue: #0077C5;
  --qb-bg: #F4F5F8;
  --qb-card: #FFFFFF;
  --qb-border: #E3E5EB;
  --qb-border-dark: #CBD2DC;
  --sat: env(safe-area-inset-top, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
}

*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--qb-bg);
  color: #1D252C;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Ensure mobile Safari doesn't zoom in on input focus */
@media screen and (max-width: 768px) {
  input[type="text"],
  input[type="number"],
  input[type="email"],
  input[type="password"],
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* Nav & Tab Styles */
.nav-btn {
  color: #596573;
  font-weight: 600;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  touch-action: manipulation;
}

.nav-btn:hover {
  color: #1D252C;
  background-color: #ECEEF2;
}

.nav-btn.active {
  background-color: #FFFFFF;
  color: #1E7B12;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* Mobile Nav Pills */
.nav-btn-mobile {
  transition: all 0.15s ease;
  touch-action: manipulation;
  flex-shrink: 0;
}

.nav-btn-mobile.active {
  background-color: #2CA01C !important;
  color: #FFFFFF !important;
  border-color: #2CA01C !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 6px rgba(44, 160, 28, 0.3) !important;
}

/* Category Selector */
.calc-type-btn {
  color: #596573;
  font-weight: 600;
  transition: all 0.2s ease;
  touch-action: manipulation;
}

.calc-type-btn.active {
  background-color: #2CA01C;
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(44, 160, 28, 0.35);
}

.ocr-sample-btn {
  transition: all 0.2s ease;
  touch-action: manipulation;
}

.ocr-sample-btn.active {
  border-color: #2CA01C;
  background-color: #F0FDF4;
  box-shadow: 0 4px 12px -2px rgba(44, 160, 28, 0.15);
}

/* Tab Management */
.tab-content {
  display: none;
  animation: fadeIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-content.active {
  display: block;
}

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

/* Scanner Animation */
@keyframes scanlineLight {
  0% {
    top: 0%;
    opacity: 0.8;
  }
  50% {
    opacity: 1;
  }
  100% {
    top: 96%;
    opacity: 0.8;
  }
}

.animate-scan-light {
  animation: scanlineLight 2s ease-in-out infinite alternate;
}

/* Custom & Cross-Browser Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #F1F3F6;
}
::-webkit-scrollbar-thumb {
  background: #CBD2DC;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #9AA6B5;
}

* {
  scrollbar-width: thin;
  scrollbar-color: #CBD2DC #F1F3F6;
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

/* Smooth Touch Scrolling for Horizontal Containers */
.smooth-scroll-x {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* Safe Area Padding Utilities for Modern Mobile Devices (iOS Notch / Home Indicator) */
.pt-safe {
  padding-top: max(1rem, var(--sat));
}
.pb-safe {
  padding-bottom: max(1rem, var(--sab));
}
.mb-safe {
  margin-bottom: var(--sab);
}

/* Responsive Modal Behavior */
#modal-summary {
  overscroll-behavior: contain;
}

/* Print Stylesheet */
@media print {
  header, footer, nav, button, .no-print, #mobile-bottom-nav {
    display: none !important;
  }
  body {
    background: white !important;
    color: black !important;
  }
  #modal-summary {
    display: block !important;
    position: static !important;
    background: white !important;
    box-shadow: none !important;
    padding: 0 !important;
  }
}

