/* ==========================================================================
   Mindvora Money & Finance Workspace Stylesheet
   Redesigned Center Workspace (Border-Free iPhone iOS Structure)
   ========================================================================== */

:root {
  --fin-bg: #080a0f;
  --fin-card-bg: rgba(18, 24, 38, 0.7);
  --fin-card-surface: rgba(24, 32, 48, 0.75);
  --fin-card-hover: rgba(32, 42, 62, 0.85);
  --fin-border: transparent;
  --fin-border-bright: transparent;
  --fin-glow-indigo: rgba(99, 102, 241, 0.2);
  --fin-glow-emerald: rgba(16, 185, 129, 0.2);
  --fin-glow-rose: rgba(244, 63, 94, 0.2);
  --fin-glow-amber: rgba(245, 158, 11, 0.2);
  
  --color-income: #10b981;
  --color-expense: #f43f5e;
  --color-transfer: #3b82f6;
  --color-savings: #8b5cf6;
  --color-budget: #f59e0b;
  --color-debt: #ec4899;

  --radius-hero: 28px;
  --radius-card: 22px;
  --radius-btn: 16px;
}

/* Base Main Container Optimization */
.main-content-shifted {
  min-height: 100vh;
}

/* Glassmorphism Surface Base - Borderless iPhone Structure */
.fin-glass-card {
  background: var(--fin-card-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: none !important;
  border-radius: var(--radius-card);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.25);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.fin-glass-card:hover {
  border: none !important;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}

.fin-glass-card-interactive {
  cursor: pointer;
}

.fin-glass-card-interactive:hover {
  transform: translateY(-2px);
  background: var(--fin-card-hover);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

/* Hero Cards (Available Balance & Safe to Spend) - Borderless iOS Style */
.hero-card-balance {
  background: linear-gradient(135deg, rgba(30, 27, 75, 0.8) 0%, rgba(15, 20, 30, 0.95) 100%);
  border: none !important;
  border-radius: var(--radius-hero);
  position: relative;
  overflow: hidden;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-card-balance:hover {
  box-shadow: 0 18px 52px rgba(99, 102, 241, 0.25);
}

.hero-card-safe {
  background: linear-gradient(135deg, rgba(6, 78, 59, 0.75) 0%, rgba(15, 20, 30, 0.95) 100%);
  border: none !important;
  border-radius: var(--radius-hero);
  position: relative;
  overflow: hidden;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-card-safe:hover {
  box-shadow: 0 18px 52px rgba(16, 185, 129, 0.25);
}

/* Background Sparkline Overlay */
.sparkline-svg-bg {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 55%;
  height: 80%;
  pointer-events: none;
  opacity: 0.35;
  mask-image: linear-gradient(to right, transparent 0%, black 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 100%);
}

/* Compact Secondary KPI Cards - Borderless */
.fin-kpi-card {
  background: rgba(20, 26, 38, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: none !important;
  border-radius: var(--radius-card);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
}

.fin-kpi-card:hover {
  background: rgba(28, 36, 52, 0.9);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.3);
  transform: translateY(-2px);
}

/* KPI Summary Tiles (Legacy Compatible) */
.kpi-tile {
  background: rgba(22, 28, 38, 0.85);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: none !important;
  border-radius: 20px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
}

.kpi-tile:hover {
  background: rgba(30, 38, 52, 0.95);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

/* Navigation Tab Bar - Borderless iOS Segmented Control */
.fin-tab-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 6px;
  background: rgba(16, 21, 30, 0.8);
  border: none !important;
  border-radius: 22px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);
  scrollbar-width: none;
}

.fin-tab-bar::-webkit-scrollbar {
  display: none;
}

.fin-tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  background: transparent;
  border: none !important;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
}

/* Custom Glassmorphism Scrollbar */
.fin-scroll {
  scrollbar-width: thin;
  scrollbar-color: rgba(99, 102, 241, 0.4) rgba(255, 255, 255, 0.03);
}

.fin-scroll::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.fin-scroll::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 9999px;
}

.fin-scroll::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.4);
  border-radius: 9999px;
}

.fin-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.7);
}

.fin-tab-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.fin-tab-btn.active {
  color: #ffffff;
  background: #4f46e5;
  box-shadow: 0 4px 18px rgba(79, 70, 229, 0.45);
}

/* Health Radial Score Gauge Ring */
.health-ring-svg {
  transform: rotate(-90deg);
}

.health-ring-bg {
  stroke: rgba(255, 255, 255, 0.08);
}

.health-ring-progress {
  stroke: #818cf8;
  stroke-dasharray: 176;
  stroke-dashoffset: 35;
  transition: stroke-dashoffset 0.8s ease;
}

/* Category Badge Indicators */
.category-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  border: none !important;
}

/* Transaction Type Badges */
.type-badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: none !important;
}

.type-badge.expense { background: rgba(244, 63, 94, 0.2); color: #f43f5e; }
.type-badge.income { background: rgba(16, 185, 129, 0.2); color: #10b981; }
.type-badge.transfer { background: rgba(59, 130, 246, 0.2); color: #3b82f6; }
.type-badge.refund { background: rgba(168, 85, 247, 0.2); color: #a855f7; }

/* Amount Inputs & Focus */
.amount-primary-input {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #ffffff;
  background: transparent;
  border: none !important;
  outline: none;
  width: 100%;
}

.amount-primary-input::placeholder {
  color: rgba(255, 255, 255, 0.2);
}

/* Progress Bar Utilities */
.fin-progress-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  position: relative;
}

.fin-progress-bar {
  height: 100%;
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.fin-progress-bar.green { background: linear-gradient(90deg, #10b981, #34d399); }
.fin-progress-bar.amber { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.fin-progress-bar.red { background: linear-gradient(90deg, #f43f5e, #fb7185); }
.fin-progress-bar.indigo { background: linear-gradient(90deg, #6366f1, #818cf8); }

/* Quick Action Floating Action Button for Mobile */
.fin-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 25px rgba(99, 102, 241, 0.5);
  z-index: 45;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.fin-fab.hidden,
#mobileFab.hidden,
#openQuickSetupBtn.hidden,
#quickSetupModal.hidden,
#composerModal.hidden,
#accountModal.hidden,
#budgetModal.hidden,
#subscriptionModal.hidden,
#goalModal.hidden,
#debtModal.hidden,
#ruleModal.hidden,
#onboardingOverlay.hidden,
#lockOverlay.hidden {
  display: none !important;
}

.pin-security-input {
  -webkit-text-security: disc !important;
  font-family: inherit;
}

.fin-fab:hover {
  transform: scale(1.08) rotate(90deg);
  box-shadow: 0 14px 35px rgba(99, 102, 241, 0.6);
}

/* Modal Bottom-Sheet for Mobile */
@media (max-width: 767px) {
  .fin-modal-sheet {
    position: fixed;
    inset-x: 0;
    bottom: 0;
    top: auto;
    border-radius: 28px 28px 0 0;
    max-height: 90vh;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  .fin-modal-sheet.open {
    transform: translateY(0);
  }
}

/* Overview 3-Column Grid Responsive Design */
.overview-3col-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 1024px) {
  .overview-3col-grid {
    grid-template-columns: 1.3fr 1fr 1fr;
  }
}

/* Chart Canvas Wrapper Height Enforcement */
.chart-wrapper {
  position: relative;
  width: 100%;
  height: 240px;
}

@media (max-width: 767px) {
  .chart-wrapper {
    height: 210px;
  }
}

/* Recent Activity List Item - Borderless */
.recent-tx-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: none !important;
  transition: all 0.2s ease;
  cursor: pointer;
}

.recent-tx-item:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(3px);
}

/* Financial Calendar Grid */
.fin-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.fin-calendar-day {
  min-height: 80px;
  background: rgba(255, 255, 255, 0.03);
  border: none !important;
  border-radius: 16px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.fin-calendar-day.today {
  background: rgba(99, 102, 241, 0.15);
}

.fin-calendar-event-dot {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
  cursor: pointer;
}

/* Insights Cards - Borderless */
.insight-card {
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.04);
  border: none !important;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: all 0.2s ease;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.insight-card:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
}

.insight-icon {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Lock Overlay */
.lock-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: #080a0f;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.lock-overlay.hidden {
  display: none !important;
}

/* Pin Dot Indicator */
.pin-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: none !important;
  background: rgba(255, 255, 255, 0.2);
  transition: all 0.2s ease;
}

.pin-dot.filled {
  background: #818cf8;
  box-shadow: 0 0 12px rgba(129, 140, 248, 0.6);
}

/* Custom Dropdown Option Colors & Visibility Fix */
select {
  background-color: rgba(20, 26, 38, 0.85) !important;
  color: #ffffff !important;
  border: none !important;
}

select option {
  background-color: #0d1117 !important;
  color: #ffffff !important;
  padding: 10px 14px !important;
  font-weight: 500 !important;
}

select option:hover,
select option:focus,
select option:active,
select option:checked {
  background-color: #4f46e5 !important;
  color: #ffffff !important;
}

/* Custom Scrollbar for Money tables */
.fin-scroll::-webkit-scrollbar {
  height: 6px;
  width: 6px;
}
.fin-scroll::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
}
.fin-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 99px;
}
