/* ============================================
   SUMART — Global Styles
   assets/css/global.css
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:wght@300;400;500;600&display=swap');

/* ── Brand Colors (always available) ── */
:root {
  --vivid-blue:   #308df1;
  --azure:        #50cdf9;
  --blue:         #3c55f6;
  --green:        #73ea72;
  --yellow:       #fdec83;
  --pink:         #e54ed4;
  --lavender:     #a24ced;
  --light-azure:  #dcf4fc;
  --card-radius:  18px;
}

/* ══ DARK MODE (default) ══ */
:root,
[data-theme="dark"] {
  --bg-page:       #181838;
  --bg-mid:        #12122d;
  --bg-topbar:     rgb(18, 18, 45);
  --card-bg:       rgba(255, 255, 255, 0.04);
  --card-border:   rgba(255, 255, 255, 0.08);
  --input-bg:      rgba(255, 255, 255, 0.06);
  --input-border:  rgba(255, 255, 255, 0.10);
  --text-primary:  #ffffff;
  --text-sub:      rgba(255, 255, 255, 0.60);
  --text-muted:    rgba(255, 255, 255, 0.40);
  --divider:       rgba(255, 255, 255, 0.09);
  --scrollbar:     rgba(255, 255, 255, 0.12);
  --orb-opacity:   0.22;
  --income-bg:     rgba(115, 234, 114, 0.08);
  --bills-bg:      rgba(80, 205, 249, 0.08);
  --saved-bg:      rgba(253, 236, 131, 0.08);
  --remaining-bg:  rgba(229, 78, 212, 0.08);
  --toggle-bg:     rgba(255,255,255,0.08);
}

/* ══ LIGHT MODE ══ */
[data-theme="light"] {
  --bg-page:       #f0f4ff;
  --bg-mid:        #e8eeff;
  --bg-topbar:     rgb(255, 255, 255);
  --card-bg:       rgba(255, 255, 255, 0.85);
  --card-border:   rgba(60, 85, 246, 0.12);
  --input-bg:      rgba(255, 255, 255, 0.9);
  --input-border:  rgba(60, 85, 246, 0.2);
  --text-primary:  #181838;
  --text-sub:      rgba(24, 24, 56, 0.65);
  --text-muted:    rgba(24, 24, 56, 0.42);
  --divider:       rgba(24, 24, 56, 0.10);
  --scrollbar:     rgba(24, 24, 56, 0.15);
  --orb-opacity:   0.10;
  --income-bg:     rgba(115, 234, 114, 0.12);
  --bills-bg:      rgba(48, 141, 241, 0.10);
  --saved-bg:      rgba(200, 180, 0, 0.10);
  --remaining-bg:  rgba(229, 78, 212, 0.10);
  --toggle-bg:     rgba(24,24,56,0.07);
}

/* ── Light mode overrides ── */
[data-theme="light"] body { color: var(--text-primary); }
[data-theme="light"] .orb { opacity: var(--orb-opacity) !important; }

[data-theme="light"] .insight-strip {
  background: linear-gradient(135deg, rgba(48,141,241,0.10), rgba(162,76,237,0.08));
  border-color: rgba(162,76,237,0.18);
  color: var(--text-primary);
}
[data-theme="light"] .form-input { color: var(--text-primary); }
[data-theme="light"] .form-input::placeholder { color: rgba(24,24,56,0.28); }
[data-theme="light"] .section-badge { background: rgba(24,24,56,0.07); color: var(--text-muted); }
[data-theme="light"] .cal-day { color: rgba(24,24,56,0.75); }
[data-theme="light"] .cal-day:hover { background: rgba(48,141,241,0.08); }
[data-theme="light"] .cal-dow { color: var(--text-muted); }
[data-theme="light"] .bill-date { color: var(--text-muted); }
[data-theme="light"] .bill-name { color: var(--text-primary); }
[data-theme="light"] .expense-name { color: var(--text-sub); }
[data-theme="light"] .expense-amount { color: var(--text-primary); }
[data-theme="light"] .expense-bar-track { background: rgba(24,24,56,0.07); }
[data-theme="light"] .modal-box { background: #ffffff; border-color: rgba(60,85,246,0.15); color: var(--text-primary); }
[data-theme="light"] .modal-sub { color: var(--text-muted); }
[data-theme="light"] .cat-chip { background: rgba(24,24,56,0.04); border-color: rgba(24,24,56,0.1); color: var(--text-sub); }
[data-theme="light"] .cat-chip.selected { background: rgba(48,141,241,0.12); border-color: var(--vivid-blue); color: var(--blue); }
[data-theme="light"] .btn-cancel { background: rgba(24,24,56,0.05); border-color: rgba(24,24,56,0.1); color: var(--text-sub); }
[data-theme="light"] .credit-hero-sub { color: var(--text-sub); }
[data-theme="light"] .score-range-labels { color: var(--text-muted); }
[data-theme="light"] .factor-name { color: var(--text-muted); }
[data-theme="light"] .account-detail { color: var(--text-muted); }
[data-theme="light"] .account-util { color: var(--text-muted); }
[data-theme="light"] .rec-desc { color: var(--text-muted); }
[data-theme="light"] .rec-title { color: var(--text-primary); }

/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  font-family: 'DM Sans', sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background 0.35s ease, color 0.35s ease;
}

a { text-decoration: none; color: inherit; }
button { font-family: 'DM Sans', sans-serif; cursor: pointer; }
img { display: block; max-width: 100%; }

/* ── Typography ── */
.font-syne { font-family: 'Syne', sans-serif; }
h1, h2, h3 { font-family: 'Syne', sans-serif; font-weight: 800; }

/* ── Background Orbs ── */
/* NOTE: filter:blur and animations removed — GPU killer on old Mac/Chrome */
.bg-orbs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.orb {
  position: absolute;
  border-radius: 50%;
  opacity: 0.12;
}
.orb-1 { width: 520px; height: 520px; background: var(--blue);  top: -160px;   right: -120px; box-shadow: 0 0 180px 90px var(--blue); }
.orb-2 { width: 380px; height: 380px; background: var(--pink);  bottom: -80px; left: -100px;  box-shadow: 0 0 150px 75px var(--pink); }
.orb-3 { width: 280px; height: 280px; background: var(--azure); top: 45%;      left: 35%;     box-shadow: 0 0 120px 60px var(--azure); }

/* ── Shared Card ── */
/* backdrop-filter removed — caused crashes on older Mac/Chrome hardware */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  transition: background 0.35s ease, border-color 0.35s ease;
}

/* ── Shared Button Styles ── */
.btn-primary {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--blue), var(--vivid-blue));
  border: none;
  border-radius: 12px;
  color: #fff;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.3px;
  transition: opacity 0.2s, transform 0.15s;
  box-shadow: 0 8px 30px rgba(60, 85, 246, 0.35);
}
.btn-primary:hover  { opacity: 0.9; transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-outline-green {
  width: 100%;
  padding: 14px;
  background: transparent;
  border: 1px solid rgba(115, 234, 114, 0.4);
  border-radius: 12px;
  color: var(--green);
  font-family: 'Syne', sans-serif;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s;
}
.btn-outline-green:hover { background: rgba(115, 234, 114, 0.08); border-color: var(--green); }

.btn-ghost {
  padding: 8px 18px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--text-sub);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
}
.btn-ghost:hover,
.btn-ghost.active {
  background: rgba(48, 141, 241, 0.15);
  color: var(--azure);
}

/* ── Theme Toggle ── */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 20px;
  border: 1px solid var(--card-border);
  background: var(--toggle-bg);
  color: var(--text-sub);
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.theme-toggle:hover {
  background: rgba(48,141,241,0.12);
  border-color: rgba(48,141,241,0.3);
  color: var(--vivid-blue);
}
.theme-toggle-icon { font-size: 14px; line-height: 1; }

/* ── Form Elements ── */
.form-group { margin-bottom: 20px; }

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  padding: 14px 18px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 12px;
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.form-input:focus {
  border-color: var(--vivid-blue);
  background: rgba(48, 141, 241, 0.08);
}
.form-input::placeholder { color: var(--text-muted); }

/* ── Section Labels ── */
.section-title {
  font-family: 'Syne', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.section-badge {
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ── Divider ── */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  color: var(--text-muted);
  font-size: 12px;
}
.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--divider);
}

/* ── Animations ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.anim-fade-up { animation: fadeUp 0.7s ease both; }
.anim-fade-in { animation: fadeIn 0.8s ease both; }
.anim-delay-1 { animation-delay: 0.1s; }
.anim-delay-2 { animation-delay: 0.2s; }
.anim-delay-3 { animation-delay: 0.3s; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 3px; }

/* ── Responsive Breakpoints ── */
@media (max-width: 1024px) { .hide-tablet { display: none !important; } }
@media (max-width: 640px)  { .hide-mobile { display: none !important; } }
