/* GoldLedger - Styles & Design System */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800;900&display=swap');

:root {
  --bg-main: #0b0f19;
  --bg-card: #111827;
  --bg-card-sub: #1f2937;
  --gold-primary: #f59e0b;
  --gold-hover: #d97706;
  --gold-light: #fef3c7;
  --gold-glow: rgba(245, 158, 11, 0.25);
  --border-subtle: #374151;
  --text-primary: #f9fafb;
  --text-muted: #9ca3af;
  --font-family: 'Cairo', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  font-family: var(--font-family);
}

html, body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  overscroll-behavior-y: none;
  touch-action: manipulation;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: #0b0f19;
}
::-webkit-scrollbar-thumb {
  background: #374151;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #f59e0b;
}

/* Mobile Touch Ergonomics */
.touch-target {
  min-height: 48px;
}

input, select, textarea, button {
  font-family: var(--font-family);
  touch-action: manipulation;
}

/* Chrome, Safari, Edge, Opera number input arrows removal */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type=number] {
  -moz-appearance: textfield;
}

/* Gold Gradient utilities */
.gold-gradient-bg {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.gold-gradient-text {
  background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gold-gradient-border {
  border-image: linear-gradient(135deg, #f59e0b, #78350f) 1;
}

.glass-panel {
  background: rgba(17, 24, 39, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(245, 158, 11, 0.12);
}

.glass-card {
  background: rgba(31, 41, 55, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(75, 85, 99, 0.4);
}

/* Subtle glowing box shadow */
.gold-glow {
  box-shadow: 0 4px 20px -2px var(--gold-glow);
}

.gold-glow-sm {
  box-shadow: 0 2px 10px -1px var(--gold-glow);
}

/* Custom Segmented Karat Buttons */
.karat-btn {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.karat-btn.active {
  background: linear-gradient(135deg, #f59e0b 0%, #b45309 100%) !important;
  color: #0b0f19 !important;
  font-weight: 800 !important;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.45) !important;
  border-color: #fbbf24 !important;
  transform: translateY(-1px);
}

.scrap-karat-btn {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.scrap-karat-btn.active {
  background: linear-gradient(135deg, #a855f7 0%, #7e22ce 100%) !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  box-shadow: 0 4px 14px rgba(168, 85, 247, 0.45) !important;
  border-color: #c084fc !important;
  transform: translateY(-1px);
}

/* Safe area padding for modern iPhones & Android navigation gestures */
.pb-safe {
  padding-bottom: env(safe-area-inset-bottom, 16px);
}
.pt-safe {
  padding-top: env(safe-area-inset-top, 16px);
}

/* Keyframe animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulseGold {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(245, 158, 11, 0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.25s ease-out forwards;
}

@keyframes pulseGlow {
  0% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.6);
    border-color: rgba(245, 158, 11, 0.9);
  }
  50% {
    box-shadow: 0 0 18px 4px rgba(245, 158, 11, 0.4);
    border-color: rgba(245, 158, 11, 0.8);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
  }
}

.animate-pulse-glow {
  animation: pulseGlow 1.2s ease-out;
}

/* Number ticker transition */
.metric-value-transition {
  transition: color 0.3s ease, transform 0.2s ease;
}

.metric-value-updating {
  color: #fbbf24 !important;
  transform: scale(1.05);
}

/* Form Section Collapsible Animation */
.collapsible-content {
  transition: max-height 0.3s ease-in-out, opacity 0.25s ease-in-out;
  overflow: hidden;
}

/* Toast container */
#toast-container {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  width: 90%;
  max-width: 420px;
  pointer-events: none;
}

.toast-msg {
  pointer-events: auto;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Centered form inputs */
.center-input {
  text-align: center;
  direction: ltr; /* Keeps numeric cursor and digits aligned clearly while retaining RTL surrounding */
}

.center-input::placeholder {
  direction: rtl;
  text-align: center;
}

/* Expense Channel Pills */
.expense-channel-btn {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.expense-channel-btn.expense-channel-active {
  background: linear-gradient(135deg, #e11d48 0%, #be123c 100%) !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  border-color: #fb7185 !important;
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.4) !important;
  transform: translateY(-1px);
}

/* Deposit Channel Pills */
.deposit-channel-btn {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.deposit-channel-btn.deposit-channel-active {
  background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  border-color: #34d399 !important;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.4) !important;
  transform: translateY(-1px);
}

/* Autocomplete item active / selected */
.autocomplete-item:hover,
.autocomplete-item.active {
  background: rgba(51, 65, 85, 0.8) !important;
}

/* Active filter preset pill */
.filter-preset-active {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%) !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  border-color: #f59e0b !important;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.35) !important;
}

/* Active filter type pill */
.filter-type-active {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
  color: #0b0f19 !important;
  font-weight: 800 !important;
  border-color: #fbbf24 !important;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3) !important;
}

/* Print Styles for Elegant Report Generation */
@media print {
  body * {
    visibility: hidden;
  }

  #pdf-preview-modal,
  #pdf-preview-modal * {
    visibility: visible;
  }

  #pdf-preview-modal {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: auto;
    background: #ffffff !important;
    padding: 0 !important;
    margin: 0 !important;
    z-index: 999999 !important;
  }

  #pdf-preview-modal .bg-slate-900\/95,
  #pdf-preview-modal button {
    display: none !important;
  }

  #pdf-render-area {
    box-shadow: none !important;
    border: none !important;
    padding: 5mm !important;
    margin: 0 auto !important;
    width: 100% !important;
    max-width: 100% !important;
  }
}


