/* public/css/header.css */
/* Shared Popcorn Tools top header:
   - Works with tokenStatusBadge + conceptEnvToggle
   - Uses pill badges and a compact, dark app-bar style
*/

:root {
  --pt-header-bg: #050816;
  --pt-header-border: #111827;
  --pt-header-text: #e5e7eb;
  --pt-header-muted: #9ca3af;

  --pt-pill-bg: rgba(15, 23, 42, 0.9);
  --pt-pill-border: rgba(148, 163, 184, 0.5);

  --pt-pill-active-bg: rgba(22, 163, 74, 0.2);
  --pt-pill-active-border: #4ade80;
  --pt-pill-active-text: #bbf7d0;

  --pt-pill-inactive-bg: rgba(127, 29, 29, 0.3);
  --pt-pill-inactive-border: #f97373;
  --pt-pill-inactive-text: #fecaca;

  --pt-nav-link: #e5e7eb;
  --pt-nav-link-muted: #9ca3af;
  --pt-nav-link-hover: #f9fafb;
}

.pt-header {
  background: var(--pt-header-bg);
  border-bottom: 1px solid var(--pt-header-border);
  color: var(--pt-header-text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-size: 14px;
}

.pt-header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.6rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* Left side: logo + page title */

.pt-header-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-width: 0;
}

/* Updated .pt-logo to handle SVG Image */
.pt-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none; /* Removes underline if wrapped in <a> link */
  border: none;
  outline: none;
}

/* NEW: Standardize logo size here instead of inline HTML attributes */
.pt-logo img {
  height: 36px; /* Adjust this value once to change logo size everywhere */
  width: auto;
  display: block; /* Fixes vertical alignment issues */
}

/* Legacy support: Keeps text styling if you ever use text alongside the icon */
.pt-logo-text {
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.85rem;
  color: var(--pt-header-text);
  white-space: nowrap;
}

.pt-page-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--pt-header-text);
  white-space: nowrap;
}

/* Right side: pills + nav */

.pt-header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  min-width: 0;
}

.pt-status-group {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* Generic pill badge */

.pt-pill-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid var(--pt-pill-border);
  background: var(--pt-pill-bg);
  font-size: 0.7rem;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
}

/* Map global.js status classes to visual styles */

.ecv2-status-active,
.pt-pill-active {
  border-color: var(--pt-pill-active-border);
  background: var(--pt-pill-active-bg);
  color: var(--pt-pill-active-text);
}

.ecv2-status-inactive,
.pt-pill-inactive {
  border-color: var(--pt-pill-inactive-border);
  background: var(--pt-pill-inactive-bg);
  color: var(--pt-pill-inactive-text);
}

.pt-pill-unknown {
  border-color: var(--pt-pill-border);
  background: var(--pt-pill-bg);
  color: var(--pt-header-muted);
}

/* Label to the left of the badge */

.pt-badge-label {
  font-size: 0.75rem;
  color: var(--pt-header-muted);
}

/* Concept Env pill toggle */

.pt-concept-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.7rem 0.2rem 0.5rem;
  border-radius: 9999px;
  border: 1px solid var(--pt-pill-border);
  background: var(--pt-pill-bg);
  cursor: pointer;
  font-size: 0.7rem;
  user-select: none;
}

.pt-concept-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pt-pill-toggle {
  width: 1.7rem;
  height: 0.95rem;
  border-radius: 9999px;
  background: #111827;
  position: relative;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(31, 41, 55, 0.8);
}

.pt-pill-toggle::after {
  content: "";
  position: absolute;
  top: 1px;
  left: 1px;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 9999px;
  background: #e5e7eb;
  transition: transform 0.18s ease-out, background 0.18s ease-out;
}

/* Checked state */

.pt-concept-input:checked + .pt-pill-toggle {
  background: #22c55e;
  box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.8);
}

.pt-concept-input:checked + .pt-pill-toggle::after {
  transform: translateX(0.7rem);
  background: #f9fafb;
}

.pt-pill-text {
  color: var(--pt-header-text);
}

/* Nav links */

.pt-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-left: 1.25rem;
  font-size: 0.8rem;
}

.pt-nav-link {
  color: var(--pt-nav-link-muted);
  text-decoration: none;
  padding: 0.15rem 0;
  position: relative;
  white-space: nowrap;
}

.pt-nav-link:hover {
  color: var(--pt-nav-link-hover);
}

.pt-nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.15rem;
  width: 0;
  height: 2px;
  border-radius: 9999px;
  background: #6366f1;
  transition: width 0.15s ease-out;
}

.pt-nav-link:hover::after {
  width: 100%;
}

/* Mobile tweaks */

@media (max-width: 900px) {
  .pt-header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
  }

  .pt-header-right {
    width: 100%;
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .pt-nav {
    margin-left: 0;
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0.9rem;
  }
}
/* Icon bar on the right side of the header */
.pt-header-icons,
.header-icon-bar { /* header-icon-bar kept as alias in case any page uses it */
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 12px;
}

/* Generic round icon button (for <button> and <a>) */
.pt-icon-btn {
  border: none;
  outline: none;
  background: transparent;
  padding: 4px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition:
    background-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.1s ease;
}

.pt-icon-btn svg {
  width: 18px;
  height: 18px;
  fill: #e5e7eb;
}

.pt-icon-btn:hover,
.pt-icon-btn:focus-visible {
  background-color: rgba(148, 163, 184, 0.18);
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.4);
  transform: translateY(-1px);
}

@media (max-width: 640px) {
  .pt-header-icons,
  .header-icon-bar {
    gap: 4px;
    margin-left: 8px;
  }
}
