/* Default theme (light) */
:root {
  --base-100: 255 255 255;
  --base-200: 243 244 246;
  --base-300: 229 231 235;

  --base-content: 17 24 39; /* text */
  --muted-content: 75 85 99;

  --link: 37 99 235;
  --link-hover: 29 78 216;

  --primary: 59 130 246;
  --primary-content: 255 255 255;

  --border: 229 231 235;
}

/* Dark theme overrides */
html[data-theme="dark"] {
  --base-100: 17 24 39;
  --base-200: 31 41 55;
  --base-300: 55 65 81;

  --base-content: 243 244 246;
  --base-content-80: 230 235 235;
  --muted-content: 156 163 175;

  --link: 96 165 250;
  --link-hover: 147 197 253;

  --primary: 96 165 250;
  --primary-content: 17 24 39;

  --border: 55 65 81;
}

/* Semantic utility classes (Tailwind-like names) */
.bg-base-100 {
  background-color: rgb(var(--base-100));
}
.bg-base-200 {
  background-color: rgb(var(--base-200));
}
.bg-base-300 {
  background-color: rgb(var(--base-300));
}

.text-base-content {
  color: rgb(var(--base-content));
}
.text-muted-content {
  color: rgb(var(--muted-content));
}

.text-link {
  color: rgb(var(--link));
}
.text-link:hover {
  color: rgb(var(--link-hover));
}

.border-base {
  border-color: rgb(var(--border));
}

.bg-primary {
  background-color: rgb(var(--primary));
}
.text-primary-content {
  color: rgb(var(--primary-content));
}

/* Optional: nicer default page styling */
html,
body {
  height: 100%;
}

/* Flatpickr theme integration */
.flatpickr-calendar {
  background: rgb(var(--base-200));
  border: 1px solid rgb(var(--border));
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}
.flatpickr-day {
  color: rgb(var(--base-content));
}
.flatpickr-day:hover {
  background: rgb(var(--base-300));
  border-color: rgb(var(--base-300));
}
.flatpickr-day.selected,
.flatpickr-day.selected:hover {
  background: rgb(var(--primary));
  border-color: rgb(var(--primary));
  color: rgb(var(--primary-content));
}
.flatpickr-day.today {
  border-color: rgb(var(--primary));
}
.flatpickr-day.has-data {
  position: relative;
}
.flatpickr-day.has-data::after {
  content: "";
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  background: rgb(34, 197, 94); /* green-500 */
  border-radius: 50%;
}
.flatpickr-months {
  background: rgb(var(--base-200));
}
.flatpickr-month {
  color: rgb(var(--base-content));
}
.flatpickr-current-month input.cur-year,
.flatpickr-current-month .flatpickr-monthDropdown-months {
  color: rgb(var(--base-content));
  background: rgb(var(--base-200));
}
.flatpickr-weekdays {
  background: rgb(var(--base-200));
}
.flatpickr-weekday {
  color: rgb(var(--muted-content));
}
.flatpickr-day.flatpickr-disabled {
  color: rgb(var(--muted-content));
  opacity: 0.5;
}
.numInputWrapper span {
  border-color: rgb(var(--border));
}
.numInputWrapper span:hover {
  background: rgb(var(--base-300));
}
.flatpickr-prev-month,
.flatpickr-next-month {
  fill: rgb(var(--base-content));
}
.flatpickr-prev-month:hover svg,
.flatpickr-next-month:hover svg {
  fill: rgb(var(--primary));
}

/* Toggle switch styles */
.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  background-color: rgb(var(--base-300));
  border-radius: 9999px;
  transition: background-color 0.2s;
}
.toggle-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background-color: white;
  border-radius: 9999px;
  transition: transform 0.2s;
}
input:checked + .toggle-switch {
  background-color: rgb(59, 130, 246); /* blue-500 */
}
input:checked + .toggle-switch::after {
  transform: translateX(20px);
}
input:focus + .toggle-switch {
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.3);
}

/* Quake-style console */
.quake-console {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 50vh;
  background: rgba(10, 15, 25, 0.97);
  border-bottom: 2px solid rgb(59, 130, 246);
  z-index: 9999;
  transform: translateY(-100%);
  transition: transform 0.25s cubic-bezier(0.33, 1, 0.68, 1);
  display: flex;
  flex-direction: column;
  font-family: "Fira Code", "Consolas", "Monaco", monospace;
}
.quake-console.open {
  transform: translateY(0);
}
.console-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 16px;
  background: rgba(30, 40, 60, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}
.console-title {
  font-size: 14px;
  font-weight: 600;
  color: rgb(59, 130, 246);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.console-filters {
  display: flex;
  gap: 8px;
  flex: 1;
}
.console-select,
.console-input {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 12px;
  color: #e0e0e0;
  outline: none;
}
.console-select:focus,
.console-input:focus {
  border-color: rgb(59, 130, 246);
}
.console-input {
  width: 200px;
}
.console-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  padding: 4px 12px;
  font-size: 12px;
  color: #e0e0e0;
  cursor: pointer;
  transition: background 0.15s;
}
.console-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}
.console-hint {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
}
.console-logs {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}
.console-log-row {
  display: flex;
  gap: 12px;
  padding: 2px 16px;
  font-size: 12px;
  line-height: 1.5;
  border-left: 3px solid transparent;
}
.console-log-row:hover {
  background: rgba(255, 255, 255, 0.03);
}
.console-log-time {
  color: rgba(255, 255, 255, 0.4);
  flex-shrink: 0;
  width: 70px;
}
.console-log-level {
  flex-shrink: 0;
  width: 60px;
  font-weight: 500;
}
.console-log-source {
  color: rgba(255, 255, 255, 0.5);
  flex-shrink: 0;
  width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.console-log-message {
  color: #e0e0e0;
  flex: 1;
  word-break: break-word;
}
/* Level colors */
.level-debug {
  border-left-color: #6b7280;
}
.level-debug .console-log-level {
  color: #6b7280;
}
.level-info {
  border-left-color: #3b82f6;
}
.level-info .console-log-level {
  color: #3b82f6;
}
.level-warning {
  border-left-color: #f59e0b;
}
.level-warning .console-log-level {
  color: #f59e0b;
}
.level-error {
  border-left-color: #ef4444;
}
.level-error .console-log-level {
  color: #ef4444;
}
.level-status {
  border-left-color: #10b981;
}
.level-status .console-log-level {
  color: #10b981;
}
/* Scrollbar styling */
.console-logs::-webkit-scrollbar {
  width: 8px;
}
.console-logs::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}
.console-logs::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}
.console-logs::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}
