/**
 * Shared header styles for Aretta Dashboard pages.
 *
 * Expects these CSS variables to be defined:
 *   --surface, --border, --bg
 *   --primary, --primary-hover
 *   --text, --text-muted
 *
 * If your page uses different variable names (e.g. --accent instead of --primary),
 * add aliases in your page's :root block:
 *   --primary: var(--accent);
 *   --text: var(--text-1);
 *   --text-muted: var(--text-2);
 */

.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 200;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.header-logo {
  height: 24px;
  width: 24px;
  object-fit: contain;
  cursor: pointer;
}

.header h1 {
  font-size: 18px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  margin: 0;
}

.header h1:hover {
  opacity: 0.85;
}

.header .header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Connection status badge (dashboard only) */
.header .connection {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
}

.header .connection.connected {
  background: rgba(74, 222, 128, 0.15);
  color: #4ade80;
}

.header .connection.connecting {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
}

.header .connection.disconnected {
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
}

/* Share button */
.header .share-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
}

.header .share-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Theme toggle button */
.header .theme-toggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 4px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 14px;
}

.header .theme-toggle:hover {
  border-color: var(--primary);
  color: var(--text);
}

/* ---- Mobile Responsive ---- */
@media (max-width: 768px) {
  .header { padding: 12px 16px; gap: 10px; }
  .header h1 { font-size: 15px; }
  .header .share-btn { padding: 8px 12px; min-height: 36px; }
  .header .theme-toggle { padding: 6px 10px; min-height: 36px; }
  .header .connection { font-size: 10px; padding: 3px 6px; }
}

@media (max-width: 480px) {
  .header h1 { font-size: 14px; }
  .header .header-actions { gap: 4px; }
}
