/* SpendWise Colorful Fintech UI Styles */

:root {
  --bg-primary: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  --border-color: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --color-brand: #0ea5e9;
  --color-income: #10b981;
  --color-expense: #f43f5e;
}

html.dark {
  --bg-primary: #0b0f19;
  --bg-card: #151d2f;
  --bg-subtle: #1e293b;
  --border-color: #27354f;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --color-brand: #38bdf8;
  --color-income: #34d399;
  --color-expense: #fb7185;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(at 0% 0%, rgba(14, 165, 233, 0.08) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(168, 85, 247, 0.08) 0px, transparent 50%),
    radial-gradient(at 50% 100%, rgba(16, 185, 129, 0.06) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-main);
  transition: background-color 0.25s ease, color 0.25s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html.dark body {
  background-image: 
    radial-gradient(at 0% 0%, rgba(14, 165, 233, 0.12) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(168, 85, 247, 0.12) 0px, transparent 50%),
    radial-gradient(at 50% 100%, rgba(16, 185, 129, 0.08) 0px, transparent 50%);
}

/* Glassmorphic Navbar & Chrome System */
.glass-navbar {
  background: rgba(255, 255, 255, 0.85) !important;
  -webkit-backdrop-filter: blur(20px) saturate(190%) !important;
  backdrop-filter: blur(20px) saturate(190%) !important;
  border-bottom: 1px solid rgba(226, 232, 240, 0.8) !important;
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.04), 0 1px 3px 0 rgba(15, 23, 42, 0.02) !important;
}
html.dark .glass-navbar {
  background: rgba(15, 23, 42, 0.85) !important;
  -webkit-backdrop-filter: blur(20px) saturate(190%) !important;
  backdrop-filter: blur(20px) saturate(190%) !important;
  border-bottom: 1px solid rgba(51, 65, 85, 0.6) !important;
  box-shadow: 0 4px 24px -2px rgba(0, 0, 0, 0.4), 0 1px 3px 0 rgba(0, 0, 0, 0.2) !important;
}

.glass-sidebar {
  background: rgba(255, 255, 255, 0.92) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
}
html.dark .glass-sidebar {
  background: rgba(15, 23, 42, 0.92) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
}

.glass-bottom-nav {
  background: rgba(255, 255, 255, 0.88) !important;
  -webkit-backdrop-filter: blur(20px) saturate(190%) !important;
  backdrop-filter: blur(20px) saturate(190%) !important;
  border-top: 1px solid rgba(226, 232, 240, 0.8) !important;
  box-shadow: 0 -4px 20px -2px rgba(15, 23, 42, 0.06) !important;
}
html.dark .glass-bottom-nav {
  background: rgba(15, 23, 42, 0.88) !important;
  -webkit-backdrop-filter: blur(20px) saturate(190%) !important;
  backdrop-filter: blur(20px) saturate(190%) !important;
  border-top: 1px solid rgba(51, 65, 85, 0.6) !important;
  box-shadow: 0 -4px 24px -2px rgba(0, 0, 0, 0.4) !important;
}

/* Glassmorphism & Colorful Card System */
.card-theme {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 1.25rem;
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05), 0 2px 6px -1px rgba(15, 23, 42, 0.03);
}

.card-hover {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease;
}
.card-hover:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px -4px rgba(15, 23, 42, 0.1), 0 4px 10px -2px rgba(15, 23, 42, 0.05);
}

/* Solid Guaranteed Icon Badges */
.icon-badge-emerald {
  background-color: #10b981 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35) !important;
}
.icon-badge-rose {
  background-color: #f43f5e !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(244, 63, 94, 0.35) !important;
}
.icon-badge-indigo {
  background-color: #6366f1 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35) !important;
}
.icon-badge-amber {
  background-color: #f59e0b !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35) !important;
}
.icon-badge-sky {
  background-color: #0ea5e9 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.35) !important;
}
.icon-badge-pink {
  background-color: #ec4899 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(236, 72, 153, 0.35) !important;
}
.icon-badge-purple {
  background-color: #a855f7 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(168, 85, 247, 0.35) !important;
}
.icon-badge-teal {
  background-color: #14b8a6 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(20, 184, 166, 0.35) !important;
}

/* Primary Action Button */
.btn-primary-gradient {
  background: linear-gradient(135deg, #0284c7 0%, #4f46e5 50%, #7c3aed 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px -1px rgba(79, 70, 229, 0.4) !important;
}
.btn-primary-gradient:hover {
  background: linear-gradient(135deg, #0369a1 0%, #4338ca 50%, #6d28d9 100%) !important;
  box-shadow: 0 6px 20px -1px rgba(79, 70, 229, 0.5) !important;
  transform: translateY(-1px);
}

/* High-Contrast Bright Theme & Modern Palette Utilities */
.text-slate-900 { color: #0f172a !important; }
.text-slate-800 { color: #1e293b !important; }
.text-slate-700 { color: #334155 !important; }
.text-slate-600 { color: #475569 !important; }
.text-slate-500 { color: #64748b !important; }
.text-slate-400 { color: #94a3b8 !important; }
.text-slate-300 { color: #cbd5e1 !important; }
.text-slate-200 { color: #e2e8f0 !important; }
.text-slate-100 { color: #f1f5f9 !important; }

html.dark .dark\:text-white { color: #ffffff !important; }
html.dark .dark\:text-slate-100 { color: #f1f5f9 !important; }
html.dark .dark\:text-slate-200 { color: #e2e8f0 !important; }
html.dark .dark\:text-slate-300 { color: #cbd5e1 !important; }
html.dark .dark\:text-slate-400 { color: #94a3b8 !important; }

.bg-slate-50 { background-color: #f8fafc !important; }
.bg-slate-100 { background-color: #f1f5f9 !important; }
.bg-slate-200 { background-color: #e2e8f0 !important; }
.bg-slate-800 { background-color: #1e293b !important; }
.bg-slate-900 { background-color: #0f172a !important; }
.bg-slate-950 { background-color: #020617 !important; }

html.dark .dark\:bg-slate-800 { background-color: #1e293b !important; }
html.dark .dark\:bg-slate-900 { background-color: #0f172a !important; }
html.dark .dark\:bg-slate-950 { background-color: #020617 !important; }

.border-slate-100 { border-color: #f1f5f9 !important; }
.border-slate-200 { border-color: #e2e8f0 !important; }
.border-slate-300 { border-color: #cbd5e1 !important; }
.border-slate-700 { border-color: #334155 !important; }
.border-slate-800 { border-color: #1e293b !important; }

html.dark .dark\:border-slate-700 { border-color: #334155 !important; }
html.dark .dark\:border-slate-800 { border-color: #1e293b !important; }

/* Emerald Colors */
.text-emerald-500 { color: #10b981 !important; }
.text-emerald-600 { color: #059669 !important; }
.text-emerald-700 { color: #047857 !important; }
.text-emerald-800 { color: #065f46 !important; }
.text-emerald-900 { color: #064e3b !important; }
html.dark .dark\:text-emerald-400 { color: #34d399 !important; }
html.dark .dark\:text-emerald-300 { color: #6ee7b7 !important; }
html.dark .dark\:text-emerald-200 { color: #a7f3d0 !important; }

.bg-emerald-50 { background-color: #ecfdf5 !important; }
.bg-emerald-100 { background-color: #d1fae5 !important; }
.bg-emerald-500 { background-color: #10b981 !important; }
.bg-emerald-600 { background-color: #059669 !important; }

.border-emerald-200 { border-color: #a7f3d0 !important; }
.border-emerald-300 { border-color: #6ee7b7 !important; }
.border-emerald-500 { border-color: #10b981 !important; }

/* Rose Colors */
.text-rose-500 { color: #f43f5e !important; }
.text-rose-600 { color: #e11d48 !important; }
.text-rose-700 { color: #be123c !important; }
.text-rose-800 { color: #9f1239 !important; }
html.dark .dark\:text-rose-400 { color: #fb7185 !important; }
html.dark .dark\:text-rose-300 { color: #fda4af !important; }

.bg-rose-50 { background-color: #fff1f2 !important; }
.bg-rose-100 { background-color: #ffe4e6 !important; }
.bg-rose-500 { background-color: #f43f5e !important; }
.bg-rose-600 { background-color: #e11d48 !important; }

.border-rose-200 { border-color: #fecdd3 !important; }
.border-rose-300 { border-color: #fda4af !important; }
.border-rose-500 { border-color: #f43f5e !important; }

/* Sky Colors */
.text-sky-500 { color: #0ea5e9 !important; }
.text-sky-600 { color: #0284c7 !important; }
.text-sky-700 { color: #0369a1 !important; }
html.dark .dark\:text-sky-400 { color: #38bdf8 !important; }
html.dark .dark\:text-sky-300 { color: #7dd3fc !important; }

.bg-sky-50 { background-color: #f0f9ff !important; }
.bg-sky-100 { background-color: #e0f2fe !important; }
.bg-sky-500 { background-color: #0ea5e9 !important; }
.bg-sky-600 { background-color: #0284c7 !important; }

.border-sky-200 { border-color: #bae6fd !important; }
.border-sky-300 { border-color: #7dd3fc !important; }
.border-sky-500 { border-color: #0ea5e9 !important; }

/* Amber Colors */
.text-amber-500 { color: #f59e0b !important; }
.text-amber-600 { color: #d97706 !important; }
.text-amber-700 { color: #b45309 !important; }
.text-amber-800 { color: #92400e !important; }
html.dark .dark\:text-amber-400 { color: #fbbf24 !important; }
html.dark .dark\:text-amber-300 { color: #fcd34d !important; }

.bg-amber-50 { background-color: #fffbeb !important; }
.bg-amber-100 { background-color: #fef3c7 !important; }
.bg-amber-500 { background-color: #f59e0b !important; }
.bg-amber-600 { background-color: #d97706 !important; }

.border-amber-200 { border-color: #fde68a !important; }
.border-amber-300 { border-color: #fcd34d !important; }
.border-amber-500 { border-color: #f59e0b !important; }

/* Colorful KPI Cards */
.card-colorful-balance {
  background: #ffffff !important;
  border: 1.5px solid #a7f3d0 !important;
  box-shadow: 0 4px 20px -2px rgba(16, 185, 129, 0.12) !important;
}
html.dark .card-colorful-balance {
  background: #151d2f !important;
  border: 1.5px solid rgba(16, 185, 129, 0.4) !important;
  box-shadow: 0 4px 24px -2px rgba(16, 185, 129, 0.2) !important;
}

.card-colorful-expense {
  background: #ffffff !important;
  border: 1.5px solid #fecdd3 !important;
  box-shadow: 0 4px 20px -2px rgba(244, 63, 94, 0.12) !important;
}
html.dark .card-colorful-expense {
  background: #151d2f !important;
  border: 1.5px solid rgba(244, 63, 94, 0.4) !important;
  box-shadow: 0 4px 24px -2px rgba(244, 63, 94, 0.2) !important;
}

.card-colorful-income {
  background: #ffffff !important;
  border: 1.5px solid #c7d2fe !important;
  box-shadow: 0 4px 20px -2px rgba(99, 102, 241, 0.12) !important;
}
html.dark .card-colorful-income {
  background: #151d2f !important;
  border: 1.5px solid rgba(99, 102, 241, 0.4) !important;
  box-shadow: 0 4px 24px -2px rgba(99, 102, 241, 0.2) !important;
}

.card-colorful-today {
  background: #ffffff !important;
  border: 1.5px solid #fde68a !important;
  box-shadow: 0 4px 20px -2px rgba(245, 158, 11, 0.12) !important;
}
html.dark .card-colorful-today {
  background: #151d2f !important;
  border: 1.5px solid rgba(245, 158, 11, 0.4) !important;
  box-shadow: 0 4px 24px -2px rgba(245, 158, 11, 0.2) !important;
}

/* Vibrant Floating Action Button (FAB) */
.fab-button {
  background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 50%, #8b5cf6 100%);
  color: white;
  box-shadow: 0 12px 28px -4px rgba(59, 130, 246, 0.5), 0 6px 14px -2px rgba(139, 92, 246, 0.4);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
}
.fab-button:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 16px 32px -4px rgba(59, 130, 246, 0.6), 0 8px 16px -2px rgba(139, 92, 246, 0.5);
}
.fab-button:active {
  transform: scale(0.92);
}

/* Bottom Sheet & Modals */
.modal-overlay {
  background-color: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  transition: opacity 0.25s ease;
}

.bottom-sheet {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border-top-left-radius: 1.75rem;
  border-top-right-radius: 1.75rem;
  background-color: var(--bg-card);
  border-top: 1px solid var(--border-color);
  max-height: 90vh;
}

@media (min-width: 768px) {
  .bottom-sheet {
    border-radius: 1.5rem;
    border: 1px solid var(--border-color);
    max-width: 540px;
    max-height: 85vh;
  }
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}
html.dark ::-webkit-scrollbar-thumb {
  background: #334155;
}

/* Form Inputs */
.input-theme {
  background-color: var(--bg-card);
  border: 1.5px solid var(--border-color);
  color: var(--text-main);
  border-radius: 0.875rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input-theme:focus {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.2);
}

/* Pill Selectors */
.pill-btn {
  border: 1px solid var(--border-color);
  background-color: var(--bg-subtle);
  color: var(--text-main);
  transition: all 0.15s ease;
}
.pill-btn:hover {
  border-color: #38bdf8;
}
.pill-btn.active {
  background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
  border-color: transparent;
  color: white;
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.35);
}
.qa-type-btn[data-type="expense"].active {
  background: linear-gradient(135deg, #f43f5e 0%, #ec4899 100%) !important;
  border-color: transparent !important;
  color: white !important;
  box-shadow: 0 4px 14px rgba(244, 63, 94, 0.4) !important;
}
.qa-type-btn[data-type="income"].active {
  background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%) !important;
  border-color: transparent !important;
  color: white !important;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4) !important;
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
  max-width: 90vw;
  width: 380px;
}
.toast-item {
  pointer-events: auto;
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  box-shadow: 0 14px 30px -4px rgba(0, 0, 0, 0.15), 0 6px 12px -2px rgba(0, 0, 0, 0.1);
  border-radius: 1rem;
}
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-16px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-12px) scale(0.95);
  }
}

/* Numeric Keypad Buttons for PIN and Amount */
.keypad-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  height: 4.25rem;
  border-radius: 1.25rem;
  background-color: var(--bg-card);
  color: var(--text-main);
  border: 1.5px solid var(--border-color);
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}
.keypad-btn:hover {
  border-color: #38bdf8;
  color: #0284c7;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px -2px rgba(14, 165, 233, 0.2);
}
html.dark .keypad-btn:hover {
  color: #38bdf8;
}
.keypad-btn:active {
  transform: scale(0.92);
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
  color: white !important;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.4);
}

/* PIN Indicator Dots */
.pin-dot {
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 9999px;
  border: 2px solid #cbd5e1;
  background-color: transparent;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
html.dark .pin-dot {
  border-color: #475569;
}
.pin-dot.filled {
  background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
  border-color: #3b82f6;
  transform: scale(1.2);
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.65);
}

/* Skeleton Loading */
.skeleton {
  background: linear-gradient(90deg, var(--bg-subtle) 25%, var(--border-color) 37%, var(--bg-subtle) 63%);
  background-size: 400% 100%;
  animation: skeletonLoading 1.4s ease infinite;
  border-radius: 0.75rem;
}
@keyframes skeletonLoading {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* Mobile Safe Areas */
.safe-bottom {
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
}

/* Colorful Gradient Badges */
.badge-emerald {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(6, 182, 212, 0.12) 100%);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #059669;
}
html.dark .badge-emerald {
  color: #34d399;
}

.badge-rose {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.15) 0%, rgba(236, 72, 153, 0.12) 100%);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #e11d48;
}
html.dark .badge-rose {
  color: #fb7185;
}

.badge-indigo {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(168, 85, 247, 0.12) 100%);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #4f46e5;
}
html.dark .badge-indigo {
  color: #a5b4fc;
}

.badge-amber {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(234, 179, 8, 0.12) 100%);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #d97706;
}
html.dark .badge-amber {
  color: #fbbf24;
}

.badge-cyan {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.15) 0%, rgba(14, 165, 233, 0.12) 100%);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: #0891b2;
}
html.dark .badge-cyan {
  color: #38bdf8;
}
