﻿.header {
  padding: 1rem 0;
  background: linear-gradient(180deg, #0c1420 0%, #0a1018 100%);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.header-content {
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-logo {
  text-decoration: none;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: all 0.2s ease;
}

.header-logo:hover { opacity: 0.9; }

.header-logo-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(47, 143, 255, 0.3));
}

.header-logo h1 {
  font-size: 1.375rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.5px;
}

.header-logo h1 .logo-playlist {
  color: var(--text-primary);
}

/* Was a --gradient-primary text-clip - gradients are banned app-wide now
   (see base.css's token comment), flat accent-cyan instead. */
.header-logo h1 .logo-lab { color: var(--accent-cyan); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: 0.5rem;
  padding-left: 1rem;
  border-left: 1px solid var(--border);
}

/* htmx adds .htmx-request to whichever button made the in-flight
   hx-get - these buttons load a full page into #modal-root, and Generate
   in particular can take a couple of real seconds server-side even with
   its genre/mood lookups cached fast on repeat opens (a genuinely slow
   first Plex round-trip, not something client-side can hide). Without
   any feedback here the click just looked like it did nothing. */
.header-actions button.htmx-request {
  opacity: 0.6;
  cursor: wait;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.header-settings-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  color: var(--text-secondary);
  transition: all 0.15s ease;
}

.header-settings-btn:hover {
  color: var(--text-primary);
  background-color: var(--surface);
}

.header-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-light);
}

.header-user-name {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.btn-logout {
  background-color: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  padding: 0.375rem 0.75rem;
}

.btn-logout:hover {
  border-color: var(--error);
  color: var(--error);
  background-color: rgba(239, 83, 80, 0.08);
}

@media (max-width: 768px) {
  .header-user-name { display: none; }
  .header-user { gap: 0.5rem; }
  .header-logo-icon { width: 28px; height: 28px; }
  .header-logo h1 { font-size: 1.125rem; }
  .header-actions { display: none; }
  /* Avatar, logout and settings all live in the slide-out menu on mobile. */
  .header-settings-btn,
  .header-user-avatar,
  .header-user .btn-logout { display: none; }
}