/* Mirage Admin Theme - Black/White with #D33D03 accent */
/* Uses system preference (prefers-color-scheme) - no manual toggle */

:root {
  /* Light theme */
  --primary: #d33d03;
  --accent: #d33d03;
  --secondary: #d33d03;
  --primary-fg: #fff;

  --body-fg: #1a1a1a;
  --body-bg: #fff;
  --body-quiet-color: #555;
  --body-loud-color: #000;

  --header-color: #fff;
  --header-branding-color: #fff;
  --header-bg: #1a1a1a;
  --header-link-color: #fff;

  --breadcrumbs-fg: #fff;
  --breadcrumbs-link-fg: #fff;
  --breadcrumbs-bg: #d33d03;

  --link-fg: #d33d03;
  --link-hover-color: #a02e02;
  --link-selected-fg: #a02e02;

  --hairline-color: #e0e0e0;
  --border-color: #ccc;

  --error-fg: #d33d03;

  --message-success-bg: #e8f5e9;
  --message-warning-bg: #fff3e0;
  --message-error-bg: #ffebee;

  --darkened-bg: #f5f5f5;
  --selected-bg: #fff5f2;
  --selected-row: #fff5f2;

  --button-fg: #fff;
  --button-bg: #1a1a1a;
  --button-hover-bg: #333;

  --default-button-bg: #d33d03;
  --default-button-hover-bg: #a02e02;

  --close-button-bg: #555;
  --close-button-hover-bg: #333;

  --delete-button-bg: #d33d03;
  --delete-button-hover-bg: #a02e02;

  --object-tools-fg: #fff;
  --object-tools-bg: #1a1a1a;
  --object-tools-hover-bg: #333;
}

/* Dark theme - system preference */
@media (prefers-color-scheme: dark) {
  :root {
    --primary: #d33d03;
    --accent: #d33d03;
    --secondary: #ff6b3d;
    --primary-fg: #fff;

    --body-fg: #f0f0f0;
    --body-bg: #121212;
    --body-quiet-color: #aaa;
    --body-loud-color: #fff;

    --header-color: #fff;
    --header-branding-color: #fff;
    --header-bg: #0a0a0a;
    --header-link-color: #fff;

    --breadcrumbs-fg: #fff;
    --breadcrumbs-link-fg: #fff;
    --breadcrumbs-bg: #d33d03;

    --link-fg: #ff6b3d;
    --link-hover-color: #ff8c5a;
    --link-selected-fg: #ff8c5a;

    --hairline-color: #333;
    --border-color: #444;

    --error-fg: #ff6b3d;

    --message-success-bg: #1b3d1b;
    --message-warning-bg: #3d2e1b;
    --message-error-bg: #3d1b1b;

    --darkened-bg: #1a1a1a;
    --selected-bg: #2a1a15;
    --selected-row: #2a1a15;

    --button-fg: #fff;
    --button-bg: #333;
    --button-hover-bg: #444;

    --default-button-bg: #d33d03;
    --default-button-hover-bg: #ff6b3d;

    --close-button-bg: #444;
    --close-button-hover-bg: #555;

    --delete-button-bg: #d33d03;
    --delete-button-hover-bg: #ff6b3d;

    --object-tools-fg: #fff;
    --object-tools-bg: #1a1a1a;
    --object-tools-hover-bg: #333;
  }
}

/* Hide theme toggle button */
#toggle-theme-btn,
.theme-toggle,
button[title="Toggle theme"] {
  display: none !important;
}

/* Additional overrides for consistent styling */
#header {
  background: var(--header-bg);
  color: var(--header-color);
}

#branding h1,
#branding h1 a:link,
#branding h1 a:visited {
  color: var(--header-branding-color);
}

div.breadcrumbs {
  background: var(--breadcrumbs-bg);
  color: var(--breadcrumbs-fg);
}

div.breadcrumbs a {
  color: var(--breadcrumbs-link-fg);
}

a:link,
a:visited {
  color: var(--link-fg);
}

a:hover {
  color: var(--link-hover-color);
}

/* Module headers */
.module h2,
.module caption,
.inline-group h2 {
  background: var(--primary);
  color: var(--primary-fg);
}

/* Buttons */
input[type="submit"],
button,
.submit-row input,
a.button {
  background: var(--button-bg);
  color: var(--button-fg);
}

input[type="submit"]:hover,
button:hover,
.submit-row input:hover,
a.button:hover {
  background: var(--button-hover-bg);
}

input[type="submit"].default,
.submit-row input.default {
  background: var(--default-button-bg);
}

input[type="submit"].default:hover,
.submit-row input.default:hover {
  background: var(--default-button-hover-bg);
}

.deletelink,
.deletelink:link,
.deletelink:visited {
  color: var(--delete-button-bg);
}

.deletelink:hover {
  color: var(--delete-button-hover-bg);
}

/* Object tools */
.object-tools a:link,
.object-tools a:visited {
  background: var(--object-tools-bg);
  color: var(--object-tools-fg);
}

.object-tools a:hover {
  background: var(--object-tools-hover-bg);
}

/* Calendar and time widgets */
.calendar caption,
.calendarbox h2 {
  background: var(--primary);
  color: var(--primary-fg);
}

.calendar td a:hover,
.timelist a:hover {
  background: var(--primary);
  color: var(--primary-fg);
}

/* Selected row highlighting */
tr.selected {
  background: var(--selected-row);
}

/* Admin title */
#site-name a {
  color: var(--header-branding-color);
}
