/**
 * Wharby Design System & Theme Engine
 * Distinct Solid Granite Slate & Vivid Metallic Steel Blue Palette.
 */

:root {
  /* --- Granite Slate Palette (Solid Stone Base & Surfaces) --- */
  --wharby-granite-950: #020617;
  --wharby-granite-900: #0f172a;
  --wharby-granite-800: #1e293b;
  --wharby-granite-700: #334155;
  --wharby-granite-600: #475569;
  --wharby-granite-500: #64748b;
  --wharby-granite-400: #94a3b8;
  --wharby-granite-300: #cbd5e1;
  --wharby-granite-50:  #f8fafc;

  /* --- Steel Blue Accent Palette (Vivid Metallic 2x4 Beam) --- */
  --wharby-steel-700: #0369a1;
  --wharby-steel-600: #0284c7;
  --wharby-steel-500: #0ea5e9;
  --wharby-steel-400: #38bdf8;
  --wharby-steel-300: #7dd3fc;
  --wharby-steel-200: #bae6fd;
  --wharby-steel-100: #e0f2fe;

  /* --- Functional Tokens --- */
  --wharby-bg-base: var(--wharby-granite-900);
  --wharby-bg-surface: var(--wharby-granite-800);
  --wharby-bg-elevated: var(--wharby-granite-700);
  --wharby-border-subtle: rgba(148, 163, 184, 0.2);
  --wharby-border-strong: rgba(148, 163, 184, 0.4);
  --wharby-text-main: var(--wharby-granite-50);
  --wharby-text-muted: var(--wharby-granite-400);
  --wharby-steel-accent: var(--wharby-steel-400);

  /* --- Typography --- */
  --wharby-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --wharby-font-mono: 'JetBrains Mono', monospace;
}

/* Light Theme Overrides */
[data-theme="light"], .wharby-light {
  --wharby-bg-base: #f8fafc;
  --wharby-bg-surface: #ffffff;
  --wharby-bg-elevated: #f1f5f9;
  --wharby-border-subtle: rgba(15, 23, 42, 0.12);
  --wharby-border-strong: rgba(15, 23, 42, 0.25);
  --wharby-text-main: var(--wharby-granite-900);
  --wharby-text-muted: var(--wharby-granite-600);
  --wharby-steel-accent: var(--wharby-steel-600);
}

/* ==========================================================================
   DYNAMIC HEADER BAR LOGO THEME SWITCHING (Relative Paths for Local & Prod)
   ========================================================================== */

/* Header Bar Logo Base Styling */
.wharby-header-logo,
gr-app-header #logo img,
#gerrit-site-header .wharby-gerrit-logo {
  height: 38px;
  width: auto;
  vertical-align: middle;
}

/* Light Theme Header Bar Logo (Swaps to wharby-logo-light.svg) */
[data-theme="light"] .wharby-header-logo,
.wharby-light .wharby-header-logo,
[data-theme="light"] gr-app-header #logo img,
.wharby-light gr-app-header #logo img,
[data-theme="light"] #gerrit-site-header .wharby-gerrit-logo {
  content: url("wharby-logo-light.svg") !important;
}

/* ==========================================================================
   GERRIT 3.X UI INTEGRATION OVERRIDES
   ========================================================================== */

html, gr-app {
  --header-background-color: var(--wharby-granite-900) !important;
  --header-text-color: var(--wharby-granite-50) !important;
  --header-icon-color: var(--wharby-steel-400) !important;
  --header-title-content: "wharby" !important;

  --primary-button-background-color: var(--wharby-steel-600) !important;
  --primary-button-text-color: #ffffff !important;
  --link-color: var(--wharby-steel-500) !important;
  --selection-background-color: rgba(56, 189, 248, 0.2) !important;
}

/* ==========================================================================
   WHARBY UI COMPONENTS
   ========================================================================== */

.wharby-card {
  background: var(--wharby-bg-surface);
  border: 1px solid var(--wharby-border-subtle);
  border-radius: 8px;
  padding: 24px;
}

.wharby-card:hover {
  border-color: var(--wharby-steel-400);
}

.wharby-btn-steel {
  background: linear-gradient(135deg, var(--wharby-steel-600), var(--wharby-steel-700));
  color: #ffffff;
  font-family: var(--wharby-font-sans);
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 6px;
  border: 1px solid var(--wharby-steel-400);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.wharby-btn-steel:hover {
  background: linear-gradient(135deg, var(--wharby-steel-500), var(--wharby-steel-600));
}

.wharby-badge-steel {
  background: rgba(56, 189, 248, 0.12);
  color: var(--wharby-steel-400);
  border: 1px solid rgba(56, 189, 248, 0.3);
  font-family: var(--wharby-font-mono);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
}

/* ==========================================================================
   HTMX IN-FLIGHT ACTION INDICATORS & ALERTS
   ========================================================================== */

.htmx-indicator {
  display: none;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--wharby-steel-300);
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
  display: inline-flex;
}

.htmx-request.btn,
button.htmx-request,
.htmx-request button,
.htmx-request.wharby-btn {
  pointer-events: none !important;
  opacity: 0.65;
  cursor: wait !important;
}

.alert-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.alert-success {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #86efac;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

