/* ============================================================
 * brody-test subdomain shared theme system
 * File: ~/.openclaw/huilong-v4/shared/theme.css
 * Generated: 2026-06-22  (FABLE agent)
 *
 * CSS Variables:
 *   --bg         Main background
 *   --text       Primary text
 *   --text-muted Secondary/dim text
 *   --brand      Brand orange (#fb8500 extracted from motor.brody-test.com)
 *   --border     Border color
 *   --surface    Card/panel surface
 *
 * Priority order:
 *   1. [data-theme="dark"|"light"]  explicit override
 *   2. @media (prefers-color-scheme)  system preference
 *   3. Fallback: dark (existing dark-first sites)
 * ============================================================ */

/* ---------- DARK THEME (default) ---------- */
:root {
  --bg:          #0D1117;
  --text:        #e6edf3;
  --text-muted:  #8b949e;
  --brand:       #fb8500;
  --border:      #30363d;
  --surface:     #161b22;

  /* Extended palette for compatibility */
  --brand-soft:  rgba(251,133,0,0.12);
  --brand-dim:   #c96e00;
  --success:     #4CAF50;
  --error:       #f85149;
  --warn:        #ffd33d;
}

/* ---------- LIGHT THEME via media query ---------- */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg:          #FFFFFF;
    --text:        #1c1917;
    --text-muted:  #57534e;
    --brand:       #fb8500;
    --border:      #e5e7eb;
    --surface:     #f9fafb;
    --brand-soft:  rgba(251,133,0,0.10);
    --brand-dim:   #c96e00;
    --success:     #16a34a;
    --error:       #b91c1c;
    --warn:        #d97706;
  }
}

/* ---------- EXPLICIT OVERRIDES ---------- */
[data-theme="dark"] {
  --bg:          #0D1117;
  --text:        #e6edf3;
  --text-muted:  #8b949e;
  --brand:       #fb8500;
  --border:      #30363d;
  --surface:     #161b22;
  --brand-soft:  rgba(251,133,0,0.12);
  --brand-dim:   #c96e00;
  --success:     #4CAF50;
  --error:       #f85149;
  --warn:        #ffd33d;
  color-scheme:  dark;
}

[data-theme="light"] {
  --bg:          #FFFFFF;
  --text:        #1c1917;
  --text-muted:  #57534e;
  --brand:       #fb8500;
  --border:      #e5e7eb;
  --surface:     #f9fafb;
  --brand-soft:  rgba(251,133,0,0.10);
  --brand-dim:   #c96e00;
  --success:     #16a34a;
  --error:       #b91c1c;
  --warn:        #d97706;
  color-scheme:  light;
}

/* ---------- THEME TOGGLE BUTTON UI ---------- */
#brody-theme-toggle {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 99999;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

#brody-theme-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

#brody-theme-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
}

#brody-theme-menu {
  display: none;
  position: absolute;
  top: 44px;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 0;
  min-width: 130px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

#brody-theme-menu.open {
  display: block;
}

.brody-theme-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted);
  transition: background 0.1s, color 0.1s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.brody-theme-opt:hover {
  background: var(--brand-soft);
  color: var(--brand);
}

.brody-theme-opt.active {
  color: var(--brand);
  font-weight: 600;
}

/* ---------- PRINT OVERRIDE ---------- */
@media print {
  :root,
  [data-theme="dark"],
  [data-theme="light"] {
    --bg:         #ffffff !important;
    --text:       #000000 !important;
    --text-muted: #555555 !important;
    --surface:    #f5f5f5 !important;
    --border:     #cccccc !important;
  }
}
