/* Theme system: light (default), dark, gradient */

:root {
  --brand-700: #005ae0; /* Primary brand color */
  --brand-800: #004dc2;
  --app-bg: #f5f7fb;
  --surface: #ffffff;
  --text-color: #111111;
  --muted-text: #6b7280;
  --border-color: #e5e7eb;
  --bg-secondary: #f3f4f6;
  --bg-tertiary: #e9ecef;
  --header-bg: var(--brand-700);
  --header-text: #ffffff;
  --side-bg: #0b1220;
  --side-hover-bg: #0f2a4f;
  --scrollbar-thumb: #c5d1e5;
  --scrollbar-thumb-hover: #a8b4c9;
  --scrollbar-track: transparent;
}

/* Light theme */
body.theme-light {
  --app-bg: #ffffff;
  --surface: #ffffff;
  --text-color: #111111;
  --muted-text: #6b7280;
  --border-color: #e5e7eb;
  --bg-secondary: #f3f4f6;
  --bg-tertiary: #e9ecef;
  --header-bg: var(--brand-700);
  --header-text: #ffffff;
  --side-bg: #0b1220;
  --side-hover-bg: rgba(0, 0, 0, 0.12);
  --scrollbar-thumb: #c5d1e5;
  --scrollbar-thumb-hover: #a8b4c9;
  --scrollbar-track: transparent;
  --bg: var(--surface);
  --border: var(--border-color);
  --text: var(--text-color);
  --text-muted: var(--muted-text);
}

/* Dark theme */
body.theme-dark {
  --app-bg: #0b1220;
  --surface: #0f172a;
  --text-color: #e5e7eb;
  --muted-text: #94a3b8;
  --border-color: #263041;
  --bg-secondary: #1e293b;
  --bg-tertiary: #263552;
  --header-bg: #0c46b0; /* darkened brand */
  --header-text: #ffffff;
  --side-bg: #0b1220;
  --side-hover-bg: rgba(255, 255, 255, 0.08);
  --scrollbar-thumb: #4b5563;
  --scrollbar-thumb-hover: #6b7280;
  --scrollbar-track: #0b1220;
  /* Aliases for legacy vars */
  --bg: var(--surface);
  --border: var(--border-color);
  --text: var(--text-color);
  --text-muted: var(--muted-text);
}

/* Gradient theme (brand gradient) */
body.theme-gradient {
  --app-bg: linear-gradient(120deg, #ffffff 0%, #f2f8ff 100%);
  --surface: #ffffff;
  --text-color: #111111;
  --muted-text: #6b7280;
  --border-color: #e5e7eb;
  --bg-secondary: #f3f4f6;
  --bg-tertiary: #e9ecef;
  --header-bg: linear-gradient(135deg, #005ae0, #2d8cff);
  --header-text: #ffffff;
  --side-bg: #0b1220;
  --side-hover-bg: rgba(255, 255, 255, 0.08);
  --scrollbar-thumb: #c5d1e5;
  --scrollbar-thumb-hover: #a8b4c9;
  --scrollbar-track: transparent;
  /* Aliases for legacy vars */
  --bg: var(--surface);
  --border: var(--border-color);
  --text: var(--text-color);
  --text-muted: var(--muted-text);
}

/* Apply variables */
body {
  background: var(--app-bg) !important;
  color: var(--text-color) !important;
}

.grid-item,
.commands .command-item,
.log-content,
.modal-content {
  background: var(--surface) !important;
  border-color: var(--border-color) !important;
  color: var(--text-color) !important;
}

header,
footer,
.menu-header,
.list-header,
.list-footer,
.ticker,
.ticker .inner-footer {
  background: var(--header-bg) !important;
  color: var(--header-text) !important;
}

.side-menu {
  background: var(--side-bg) !important;
}

.side-menu a:hover {
  background: var(--side-hover-bg) !important;
}

.title,
.list-title,
h1, h2, h3, h4, h5 {
  color: var(--header-text);
}

.info-sub,
.bot-count,
.no-results,
.empty-sub {
  color: var(--muted-text) !important;
}

/* Admin panel specific adjustments for better Dark/Light parity */
body.theme-dark .bot-item,
body.theme-dark .info-group,
body.theme-dark .action-menu {
  background: var(--surface) !important;
  border-color: var(--border-color) !important;
  color: var(--text-color) !important;
}

body.theme-dark .bot-item:hover {
  background: rgba(255, 255, 255, 0.04) !important;
}

body.theme-dark .menu-btn {
  background: #1f2937 !important;
  color: var(--text-color) !important;
  border-color: var(--border-color) !important;
}

/* Bot commands page: ensure text colors in Dark mode */
body.theme-dark .command-item p {
  color: var(--text-color) !important;
}

body.theme-dark .command-item h5 {
  color: var(--header-text) !important;
}

body.theme-dark .command-item .usage {
  background: #1f2937 !important;
  color: var(--text-color) !important;
}

body.theme-dark .command-category h3 {
  background: var(--header-bg) !important;
  color: var(--header-text) !important;
}


