/* Custom additions on top of Tailwind */

html {
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

/* Smooth iOS-style scrolling */
* {
  -webkit-overflow-scrolling: touch;
}

/* Hide horizontal scrollbars on tab strips */
.overflow-x-auto::-webkit-scrollbar {
  height: 4px;
}
.overflow-x-auto::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.15);
  border-radius: 4px;
}

/* Print-friendly receipts */
@media print {
  header, aside, nav, footer, form, button, .no-print { display: none !important; }
  main { margin: 0 !important; padding: 0 !important; }
  body { background: white !important; }
}

/* Subtle entrance animation for cards */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
main > * {
  animation: fadeUp 0.25s ease-out;
}

/* Keyboard accessibility: clear focus ring for keyboard users only */
a:focus-visible,
button:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid #f59e0b;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Smooth interactive transitions */
a, button, select, input, .transition-card {
  transition: background-color .15s ease, color .15s ease, box-shadow .15s ease, transform .15s ease, border-color .15s ease;
}

/* Gentle hover lift for KPI / content cards (added via .transition-card) */
.transition-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -8px rgba(15, 23, 42, 0.18);
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  main > *, .transition-card { animation: none !important; transition: none !important; }
  .transition-card:hover { transform: none; }
}

/* ---- Searchable select (combobox) ---- */
/* flex:1 + min-width:0 lets the wrap stretch inside flex rows (print cards)
   while still being full-width as a plain block (new-loan, quick-pay). */
.ss-wrap { position: relative; flex: 1 1 auto; min-width: 0; }
.ss-native { display: none !important; }
/* Input keeps whatever Tailwind theme the original <select> had (light or dark) */
.ss-wrap input { width: 100%; box-sizing: border-box; padding-right: 2rem; cursor: text; }
.ss-caret {
  position: absolute;
  top: 50%;
  right: 0.6rem;
  transform: translateY(-50%);
  width: 1.1rem;
  height: 1.1rem;
  color: #94a3b8;
  pointer-events: auto;
  cursor: pointer;
}
.ss-wrap.ss-open .ss-caret { transform: translateY(-50%) rotate(180deg); }
.ss-panel {
  position: absolute;
  z-index: 50;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 16rem;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.6rem;
  box-shadow: 0 12px 28px -8px rgba(15, 23, 42, 0.25);
  padding: 0.25rem;
}
.ss-item {
  padding: 0.5rem 0.6rem;
  border-radius: 0.4rem;
  font-size: 0.875rem;
  color: #1e293b;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ss-item:hover, .ss-item.ss-hl { background: #fef3c7; }
.ss-item.ss-selected { font-weight: 700; color: #b45309; }
.ss-none { padding: 0.6rem; font-size: 0.85rem; color: #94a3b8; text-align: center; }

/* ---- Branded page loader ---- */
.gc-loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #054e5f; /* ink teal */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
  transition: opacity .45s ease, visibility .45s ease;
}
.gc-loader.gc-hide { opacity: 0; visibility: hidden; pointer-events: none; }
.gc-loader-box {
  position: relative;
  width: 110px;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gc-loader-ring {
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  border: 4px solid rgba(255, 255, 255, .12);
  border-top-color: #cf9f37;   /* gold */
  border-right-color: #e2c477; /* light gold */
  animation: gc-spin .9s linear infinite;
}
.gc-loader-badge {
  width: 68px;
  height: 68px;
  border-radius: 16px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
  animation: gc-pulse 1.6s ease-in-out infinite;
}
.gc-loader-badge.gc-loader-fallback { font-weight: 800; color: #054e5f; font-size: 1.4rem; }
.gc-loader-icon { width: 54px; height: 54px; object-fit: contain; }
.gc-loader-text { color: #e2c477; font-weight: 700; letter-spacing: .12em; font-size: .8rem; }
@keyframes gc-spin { to { transform: rotate(360deg); } }
@keyframes gc-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(.9); } }
@media (prefers-reduced-motion: reduce) {
  .gc-loader-ring, .gc-loader-badge { animation: none; }
}
