/*
 * Global dark theme for the Mustard Seed Money Manager.
 *
 * This stylesheet defines CSS variables for colors and applies them
 * throughout the application to create a cohesive look.  You can
 * customize these values to adjust the appearance of the entire site.
 */

/*
 * Override the dark theme colours with a light palette to
 * restore the original, clean look of the application.  The
 * variables defined here mirror Bootstrap's default colours
 * and the yellow accent used throughout the landing page.
 */
:root {
  /* Main page background (light grey) */
  --bg-color: #f8f9fa;
  /* Card and panel backgrounds (white) */
  --card-bg: #ffffff;
  /* Primary accent colour used for buttons and highlights */
  --accent-color: #ffc107;
  /* Secondary accent colour for hover states */
  --secondary-color: #007bff;
  /* Standard text colour */
  --text-color: #212529;
  /* Muted/placeholder text colour */
  --muted-text-color: #6c757d;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Links inherit the accent colour but darken slightly on hover */
a {
  color: var(--secondary-color);
}
a:hover {
  color: var(--accent-color);
  text-decoration: underline;
}

/* Navigation bar uses a light background and dark text */
.navbar {
  background-color: var(--card-bg) !important;
  border-bottom: 1px solid #e1e4e8;
}
.navbar .navbar-brand img {
  filter: none;
}
.navbar .nav-link {
  color: var(--text-color) !important;
}
.navbar .nav-link:hover {
  color: var(--secondary-color) !important;
}

/* Cards and KPI panels retain a light background and subtle shadow */
.card, .kpi-card {
  background-color: var(--card-bg);
  color: var(--text-color);
  border: 1px solid #e1e4e8;
  border-radius: 0.5rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.card-header {
  background-color: transparent;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  color: var(--text-color);
}
/* Tables use striped rows on a light background */
.table {
  color: var(--text-color);
}
.table thead {
  background-color: var(--card-bg);
}
.table-striped > tbody > tr:nth-of-type(odd) {
  background-color: rgba(0, 0, 0, 0.02);
}

/* Form fields have a white background and a light border */
.form-control, .form-select {
  background-color: #ffffff;
  color: var(--text-color);
  border: 1px solid #ced4da;
}

/* Placeholder text is muted */
.form-control::placeholder {
  color: var(--muted-text-color);
}

/* Primary buttons use the accent colour */
.btn-primary {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
  color: #212529;
}
.btn-primary:hover {
  background-color: var(--secondary-color);
  border-color: var(--secondary-color);
  color: #fff;
}

/* Outline buttons mirror Bootstrap's default behaviour */
.btn-outline-dark {
  color: var(--text-color);
  border-color: #ced4da;
}
.btn-outline-dark:hover {
  background-color: #e9ecef;
  border-color: var(--accent-color);
  color: var(--accent-color);
}

/* Alerts use Bootstrap's default colour palette */
.alert-danger {
  background-color: #f8d7da;
  border-color: #f5c2c7;
  color: #842029;
}
.alert-success {
  background-color: #d1e7dd;
  border-color: #badbcc;
  color: #0f5132;
}

/* Chat customizations for light mode */
#chat-window {
  background-color: var(--card-bg);
  color: var(--text-color);
}
#chat-window .card-header {
  background-color: var(--secondary-color);
  color: #fff;
}
#chat-window .form-control {
  background-color: #ffffff;
  color: var(--text-color);
}
#chat-window .btn-warning {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
  color: #212529;
}
#chat-toggle {
  background-color: var(--accent-color);
  color: #212529;
  border: none;
}
