/* ========================================
   SpendWise — Finance Terminal Custom Styles
   (Supplements Tailwind CSS)
   ======================================== */

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: #F8FAFC;
  color: #191c1e;
}

/* Page visibility */
.page { display: none; }
.page.active { display: block; animation: fadeInUp 0.35s ease; }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Card utilities */
.card-shadow { box-shadow: 0 1px 3px 0 rgba(0,0,0,0.05); }
.card-shadow-hover:hover { box-shadow: 0 4px 6px 0 rgba(0,0,0,0.07); }

/* Table row hover */
.row-hover:hover { background-color: #f2f4f6; }

/* Custom scrollbar */
.custom-scrollbar::-webkit-scrollbar { width: 6px; height: 6px; }
.custom-scrollbar::-webkit-scrollbar-track { background: #f8fafc; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: #c5c6cd; border-radius: 4px; }
.custom-scrollbar::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Modal overlay */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 200;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.modal-overlay.active { display: flex; }

/* Confirm Modal on top of all other modals */
#confirmModal {
  z-index: 260;
}

/* Modal animation */
.modal-overlay .modal-box {
  animation: modalIn 0.25s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Toast */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: white;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
  max-width: 360px;
}
.toast.success { background: #006c49; }
.toast.error { background: #ba1a1a; }
.toast.info { background: #091426; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(40px); }
}

/* Mobile sidebar overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 90;
  backdrop-filter: blur(3px);
}
.sidebar-overlay.active { display: block; }

/* Sidebar mobile transition & responsiveness */
@media (max-width: 767px) {
  #sidebar {
    display: flex !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    height: 100vh !important;
    width: 280px !important;
    z-index: 100 !important;
    transform: translateX(-100%) !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2) !important;
  }
  #sidebar.open {
    transform: translateX(0) !important;
  }
  .action-reveal {
    opacity: 1 !important;
  }
}

/* Action buttons reveal on hover */
.action-reveal { opacity: 0; transition: opacity 0.15s; }
.group:hover .action-reveal { opacity: 1; }

/* Notification Dropdown Panel */
.notif-panel {
  display: none;
  position: absolute;
  top: 54px;
  right: 16px;
  width: 360px;
  max-width: calc(100vw - 32px);
  background: #ffffff;
  border: 1px solid #c5c6cd;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(9, 20, 38, 0.15);
  z-index: 150;
  animation: notifIn 0.2s ease-out;
  overflow: hidden;
}
.notif-panel.active { display: block; }

@keyframes notifIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Select arrow hide for custom icon */
select { appearance: none; }

/* Budget progress bar */
.progress-track {
  height: 6px;
  background: #e6e8ea;
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: #006c49;
  transition: width 0.6s ease;
}
.progress-fill.warning { background: #f59e0b; }
.progress-fill.danger { background: #ba1a1a; }

/* Friend card active state */
.friend-card-active {
  border-color: #091426 !important;
  box-shadow: 0 4px 6px 0 rgba(9,20,38,0.07);
}

/* ========================================
   THEME MODES & COLOR ACCENTS
   ======================================== */

/* Dark Mode Overrides */
body.dark-mode {
  background-color: #0b1320 !important;
  color: #f1f5f9 !important;
}
body.dark-mode header {
  background-color: #111c2e !important;
  border-color: #1e293b !important;
}
body.dark-mode #sidebar {
  background-color: #111c2e !important;
  border-color: #1e293b !important;
}
body.dark-mode .bg-surface-container-lowest,
body.dark-mode .bg-surface {
  background-color: #172338 !important;
  border-color: #27354a !important;
  color: #f8fafc !important;
}
body.dark-mode .bg-surface-container-low,
body.dark-mode .bg-surface-container-low\/50,
body.dark-mode .bg-surface-container {
  background-color: #1e2d45 !important;
  color: #f8fafc !important;
}
body.dark-mode .text-primary,
body.dark-mode .text-on-surface {
  color: #f1f5f9 !important;
}
body.dark-mode .text-on-surface-variant {
  color: #94a3b8 !important;
}
body.dark-mode .border-outline-variant {
  border-color: #27354a !important;
}
body.dark-mode select,
body.dark-mode input {
  background-color: #0f172a !important;
  color: #f8fafc !important;
  border-color: #334155 !important;
}
body.dark-mode .notif-panel {
  background-color: #172338 !important;
  border-color: #334155 !important;
}

/* Accent Color 1: Default Blue (Original) */
[data-accent="blue"] .bg-primary { background-color: #091426 !important; }
[data-accent="blue"] .text-primary { color: #091426 !important; }
[data-accent="blue"] .border-primary { border-color: #091426 !important; }
[data-accent="blue"] .tab-indicator { background-color: #091426 !important; }

/* Accent Color 2: Light Green */
[data-accent="green"] .bg-primary { background-color: #006c49 !important; }
[data-accent="green"] .text-primary { color: #006c49 !important; }
[data-accent="green"] .border-primary { border-color: #006c49 !important; }
[data-accent="green"] .tab-indicator { background-color: #006c49 !important; }

/* Accent Color 3: Light Grey */
[data-accent="grey"] .bg-primary { background-color: #475569 !important; }
[data-accent="grey"] .text-primary { color: #475569 !important; }
[data-accent="grey"] .border-primary { border-color: #475569 !important; }
[data-accent="grey"] .tab-indicator { background-color: #475569 !important; }

/* Accent Color 4: Lite Yellow */
[data-accent="yellow"] .bg-primary { background-color: #d97706 !important; }
[data-accent="yellow"] .text-primary { color: #d97706 !important; }
[data-accent="yellow"] .border-primary { border-color: #d97706 !important; }
[data-accent="yellow"] .tab-indicator { background-color: #d97706 !important; }

/* ===== CHANGELOG & VERSION HISTORY STYLES ===== */
.changelog-filter-pill {
  transition: all 0.15s ease;
  cursor: pointer;
}
.changelog-filter-pill.active {
  background-color: var(--primary, #091426);
  color: #ffffff !important;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.changelog-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.changelog-tag-feature {
  background-color: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}
.changelog-tag-improvement {
  background-color: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}
.changelog-tag-fix {
  background-color: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}
.changelog-tag-ui {
  background-color: #f3e8ff;
  color: #6b21a8;
  border: 1px solid #e9d5ff;
}

body.dark-mode .changelog-tag-feature {
  background-color: rgba(22, 101, 52, 0.3);
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.4);
}
body.dark-mode .changelog-tag-improvement {
  background-color: rgba(14, 116, 144, 0.3);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.4);
}
body.dark-mode .changelog-tag-fix {
  background-color: rgba(180, 83, 9, 0.3);
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.4);
}
body.dark-mode .changelog-tag-ui {
  background-color: rgba(107, 33, 168, 0.3);
  color: #c084fc;
  border-color: rgba(192, 132, 252, 0.4);
}

