/* Theme Variables */
:root {
  /* Light mode colors */
  --text-color: #000000;
  --bg-color: #ffffff;
  --link-color: #1772d0;
  --link-hover-color: #f09228;
  --highlight-bg: #ffffd0;
  --highlight-text: #000000;
  --border-color: #dddddd;
  --secondary-text: #333333;
}

/* Dark mode */
html.dark-mode {
  --text-color: #e0e0e0;
  --bg-color: #1a1a1a;
  --link-color: #64b5f6;
  --link-hover-color: #ffb74d;
  --highlight-bg: #3a3a3a;
  --highlight-text: #ffffff;
  --border-color: #444444;
  --secondary-text: #cccccc;
}

/* Apply theme colors */
html {
  background-color: var(--bg-color);
  transition: background-color 0.3s ease, color 0.3s ease;
}

body {
  color: var(--text-color);
  background-color: var(--bg-color);
}

/* Theme toggle button */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  display: inline;
  font-size: 16px;
  transition: all 0.3s ease;
  padding: 0;
  margin-left: 8px;
  vertical-align: middle;
  filter: grayscale(100%) brightness(0.4) sepia(1) hue-rotate(180deg) saturate(5);
}

html.dark-mode .theme-toggle {
  filter: grayscale(100%) brightness(1.5) sepia(1) hue-rotate(180deg) saturate(3);
}

.theme-toggle:hover {
  transform: scale(1.2);
}

.theme-toggle:focus {
  outline: none;
}

/* Smooth transitions for theme changes */
body, a, span, td, p {
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Highlighted table rows */
tr.highlight-row {
  background-color: var(--highlight-bg) !important;
}

tr.highlight-row td {
  color: var(--highlight-text);
}

/* Colored boxes in dark mode */
html.dark-mode .colored-box {
  background-color: var(--highlight-bg) !important;
}

html.dark-mode .colored-box h2 {
  color: var(--highlight-text);
}

/* Ask Me Anything Form */
#ama-form input,
#ama-form textarea {
  transition: border-color 0.3s ease, background-color 0.3s ease;
}

#ama-form input:focus,
#ama-form textarea:focus {
  outline: none;
  border-color: var(--link-color);
}

#ama-form button {
  transition: background-color 0.3s ease, transform 0.1s ease;
}

#ama-form button:hover {
  background-color: var(--link-hover-color);
  transform: translateY(-1px);
}

#ama-form button:active {
  transform: translateY(0);
}

#form-status.success {
  color: #28a745;
  display: block !important;
}

#form-status.error {
  color: #dc3545;
  display: block !important;
}
