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

/* Material Design Dark Theme Variables */
:root {
  --md-sys-color-primary: rgb(185 207 131);
  --md-sys-color-surface-tint: rgb(185 207 131);
  --md-sys-color-on-primary: rgb(38 53 0);
  --md-sys-color-primary-container: rgb(59 77 15);
  --md-sys-color-on-primary-container: rgb(213 236 157);
  --md-sys-color-secondary: rgb(194 202 170);
  --md-sys-color-on-secondary: rgb(44 51 28);
  --md-sys-color-secondary-container: rgb(67 74 49);
  --md-sys-color-on-secondary-container: rgb(223 230 197);
  --md-sys-color-tertiary: rgb(161 208 199);
  --md-sys-color-on-tertiary: rgb(2 55 50);
  --md-sys-color-tertiary-container: rgb(32 78 72);
  --md-sys-color-on-tertiary-container: rgb(188 236 227);
  --md-sys-color-error: rgb(255 180 171);
  --md-sys-color-on-error: rgb(105 0 5);
  --md-sys-color-error-container: rgb(147 0 10);
  --md-sys-color-on-error-container: rgb(255 218 214);
  --md-sys-color-background: rgb(18 20 13);
  --md-sys-color-on-background: rgb(227 227 215);
  --md-sys-color-surface: rgb(18 20 13);
  --md-sys-color-on-surface: rgb(227 227 215);
  --md-sys-color-surface-variant: rgb(69 72 60);
  --md-sys-color-on-surface-variant: rgb(198 200 184);
  --md-sys-color-outline: rgb(144 146 132);
  --md-sys-color-outline-variant: rgb(69 72 60);
  --md-sys-color-shadow: rgb(0 0 0);
  --md-sys-color-scrim: rgb(0 0 0);
  --md-sys-color-inverse-surface: rgb(227 227 215);
  --md-sys-color-inverse-on-surface: rgb(47 49 41);
  --md-sys-color-inverse-primary: rgb(82 101 37);
  --md-sys-color-primary-fixed: rgb(213 236 157);
  --md-sys-color-on-primary-fixed: rgb(21 31 0);
  --md-sys-color-primary-fixed-dim: rgb(185 207 131);
  --md-sys-color-on-primary-fixed-variant: rgb(59 77 15);
  --md-sys-color-secondary-fixed: rgb(223 230 197);
  --md-sys-color-on-secondary-fixed: rgb(24 30 9);
  --md-sys-color-secondary-fixed-dim: rgb(194 202 170);
  --md-sys-color-on-secondary-fixed-variant: rgb(67 74 49);
  --md-sys-color-tertiary-fixed: rgb(188 236 227);
  --md-sys-color-on-tertiary-fixed: rgb(0 32 28);
  --md-sys-color-tertiary-fixed-dim: rgb(161 208 199);
  --md-sys-color-on-tertiary-fixed-variant: rgb(32 78 72);
  --md-sys-color-surface-dim: rgb(18 20 13);
  --md-sys-color-surface-bright: rgb(56 58 50);
  --md-sys-color-surface-container-lowest: rgb(13 15 8);
  --md-sys-color-surface-container-low: rgb(27 28 21);
  --md-sys-color-surface-container: rgb(31 32 25);
  --md-sys-color-surface-container-high: rgb(41 43 35);
  --md-sys-color-surface-container-highest: rgb(52 54 45);
}

* {
  font-family: 'Poppins', sans-serif;
}

body {
  background-color: var(--md-sys-color-background);
  color: var(--md-sys-color-on-background);
  font-family: 'Poppins', sans-serif;
  margin: 0;
  padding: 0;
}

.navbar {
  background: linear-gradient(135deg, var(--md-sys-color-primary-container), var(--md-sys-color-secondary-container));
  box-shadow: 0 4px 6px rgba(0,0,0,.3);
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--md-sys-color-on-primary-container) !important;
  font-family: 'Poppins', sans-serif;
}

.navbar-dark .navbar-nav .nav-link {
  color: var(--md-sys-color-on-secondary-container);
  font-weight: 500;
  transition: color 0.3s ease;
}

.navbar-dark .navbar-nav .nav-link:hover {
  color: var(--md-sys-color-primary);
}

.metric-card {
  border-radius: 16px;
  box-shadow: none;
  transition: transform 0.3s ease;
  border: 1px solid var(--md-sys-color-outline-variant);
  height: 100%;
  background-color: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-on-surface);
}

.metric-card:hover {
  transform: translateY(-5px);
  box-shadow: none;
}

.metric-card .card-body {
  color: inherit;
}

.metric-card .metric-icon {
  color: inherit;
}

.metric-card .metric-label,
.metric-card .metric-value {
  color: inherit;
}

.metric-card.bg-success {
  background: var(--md-sys-color-tertiary-container) !important;
  color: var(--md-sys-color-on-tertiary-container) !important;
}

.metric-card.bg-danger {
  background: var(--md-sys-color-error-container) !important;
  color: var(--md-sys-color-on-error-container) !important;
}

.metric-card.bg-primary {
  background: var(--md-sys-color-primary-container) !important;
  color: var(--md-sys-color-on-primary-container) !important;
}

.metric-card.bg-info {
  background: var(--md-sys-color-secondary-container) !important;
  color: var(--md-sys-color-on-secondary-container) !important;
}

.metric-card.bg-warning {
  background: #654321 !important;
  color: #fff !important;
}

.metric-icon {
  font-size: 2.5rem;
  opacity: 0.9;
}

.metric-value {
  font-size: 2rem;
  font-weight: 700;
  margin: 10px 0;
  font-family: 'Poppins', sans-serif;
}

.metric-label {
  font-size: 0.85rem;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
}

.chart-container {
  background: var(--md-sys-color-surface-container);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 8px rgba(0,0,0,.4);
  margin-bottom: 30px;
  border: 1px solid var(--md-sys-color-outline-variant);
}

.chart-container h3 {
  color: var(--md-sys-color-on-surface);
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
}

.positive {
  color: rgb(46, 213, 115);
  font-weight: 600;
}

.negative {
  color: rgb(255, 71, 87);
  font-weight: 600;
}

.table {
  color: var(--md-sys-color-on-surface);
  background-color: transparent;
  border-color: var(--md-sys-color-outline-variant);
}

.table thead {
  background-color: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
}

.table tbody {
  background-color: transparent;
}

.table td, .table th {
  border-color: var(--md-sys-color-outline-variant);
}

.table-dark {
  --bs-table-bg: transparent;
  --bs-table-striped-bg: transparent;
  --bs-table-hover-bg: rgba(69, 72, 60, 0.3);
  background-color: transparent !important;
  color: var(--md-sys-color-on-surface) !important;
  border-color: var(--md-sys-color-outline-variant) !important;
}

.table-dark th {
  background-color: var(--md-sys-color-surface-container-highest) !important;
  color: var(--md-sys-color-on-surface) !important;
  border-color: var(--md-sys-color-outline-variant) !important;
}

.table-dark td {
  background-color: transparent !important;
  color: var(--md-sys-color-on-surface) !important;
  border-color: var(--md-sys-color-outline-variant) !important;
}

.table-dark tbody tr {
  background-color: transparent !important;
}

.table-hover tbody tr:hover {
  background-color: var(--md-sys-color-surface-container-high) !important;
}

.table-hover.table-dark tbody tr:hover td {
  background-color: rgba(69, 72, 60, 0.5) !important;
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
  background-color: var(--md-sys-color-surface-container-low);
  color: var(--md-sys-color-on-surface);
}

.table-striped > tbody > tr:nth-of-type(even) > * {
  background-color: transparent;
  color: var(--md-sys-color-on-surface);
}

.badge-category {
  padding: 0.5em 1em;
  border-radius: 20px;
  background-color: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  font-weight: 500;
}

.badge.bg-secondary {
  background-color: var(--md-sys-color-secondary-container) !important;
  color: var(--md-sys-color-on-secondary-container) !important;
}

.footer {
  background-color: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
  padding: 20px 0;
  margin-top: 50px;
  border-top: 1px solid var(--md-sys-color-outline-variant);
}

.btn-primary {
  background-color: var(--md-sys-color-primary-container);
  border-color: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  font-weight: 500;
  font-family: 'Poppins', sans-serif;
  border-radius: 8px;
  padding: 10px 20px;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  background-color: var(--md-sys-color-primary);
  border-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,.3);
}

.btn-secondary {
  background-color: var(--md-sys-color-secondary-container);
  border-color: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  font-weight: 500;
  font-family: 'Poppins', sans-serif;
  border-radius: 8px;
  padding: 10px 20px;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background-color: var(--md-sys-color-secondary);
  border-color: var(--md-sys-color-secondary);
  color: var(--md-sys-color-on-secondary);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,.3);
}

.display-4 {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  color: var(--md-sys-color-on-background);
}

.lead {
  font-family: 'Poppins', sans-serif;
  font-weight: 400;
  color: var(--md-sys-color-on-surface-variant);
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Poppins', sans-serif;
  color: var(--md-sys-color-on-surface);
}

.page-link {
  background-color: var(--md-sys-color-surface-container);
  border-color: var(--md-sys-color-outline-variant);
  color: var(--md-sys-color-on-surface);
}

.page-link:hover {
  background-color: var(--md-sys-color-surface-container-high);
  border-color: var(--md-sys-color-outline);
  color: var(--md-sys-color-primary);
}

.page-item.active .page-link {
  background-color: var(--md-sys-color-primary-container);
  border-color: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
}

small, .text-muted {
  color: var(--md-sys-color-on-surface-variant) !important;
}

/* Plotly chart styling */
.js-plotly-plot .plotly {
  border-radius: 8px;
}

/* Button group styling for chart type switchers */
.btn-outline-primary {
  color: var(--md-sys-color-primary);
  border-color: var(--md-sys-color-outline);
  background-color: transparent;
  font-size: 0.8rem;
  padding: 0.25rem 0.5rem;
}

.btn-outline-primary:hover {
  color: var(--md-sys-color-on-primary);
  background-color: var(--md-sys-color-primary);
  border-color: var(--md-sys-color-primary);
}

.btn-outline-primary.active {
  color: var(--md-sys-color-on-primary-container);
  background-color: var(--md-sys-color-primary-container);
  border-color: var(--md-sys-color-primary-container);
}

.btn-group {
  box-shadow: 0 2px 4px rgba(0,0,0,.2);
  border-radius: 6px;
}

.btn-group button {
  transition: all 0.2s ease;
}

.btn-group button i {
  font-size: 0.9rem;
}
