/* Project Frontier - Shared Site Header
 * Provides unified top-bar navigation, branding, account integration, and action-bar styling.
 */

@font-face {
  font-family: "Cinzel";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("../../assets/fonts/cinzel-variable.woff2") format("woff2");
}

@font-face {
  font-family: "Michroma";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../../assets/fonts/michroma-regular.ttf") format("truetype");
}

@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../../assets/fonts/barlow-condensed-500.woff2") format("woff2");
}

@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../../assets/fonts/barlow-condensed-700.woff2") format("woff2");
}

@font-face {
  font-family: "Orbitron";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../../assets/fonts/orbitron-700.woff2") format("woff2");
}

:root {
  --pf-ui-font: "Michroma", "Rajdhani", system-ui, sans-serif;
  --pf-header-h: 76px;
  --bg-black: #02080d;
  --panel: rgba(4, 15, 24, 0.92);
  --cyan: #3fc4ff;
  --cyan-bright: #68d7ff;
  --cyan-dark: #0879b8;
  --border: rgba(83, 183, 230, 0.28);
  --border-subtle: rgba(83, 183, 230, 0.14);
  --text-primary: #edf7ff;
  --text-secondary: #91a9b9;
  --text-muted: #5e7788;
  --accent-gold: #f0c66c;
  --accent-amber: #e5b14a;
  --accent-red: #ec4c44;
  --accent-green: #48c76c;

  --ease: cubic-bezier(.22, .61, .36, 1);
  --t-fast: 160ms;
  --t-slow: 240ms;
}

/* --- Fixed Top Header ----------------------------------------------------- */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 900;
  display: flex;
  align-items: stretch;
  height: var(--pf-header-h);
  padding: 0 20px 0 0;
  border-bottom: none;
  background: transparent;
  box-shadow: none;
  box-sizing: border-box;
}

/* Brand block */
.site-brand {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 0 24px;
  border-right: none;
  color: var(--text-primary);
  text-decoration: none;
  flex: 0 0 auto;
}

.brand-mark {
  position: relative;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 1.5px solid rgba(83, 183, 230, 0.55);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, #0a1d2a, #030a10);
  box-shadow: 0 0 16px rgba(63, 196, 255, 0.28), inset 0 0 12px rgba(63, 196, 255, 0.2);
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  border-radius: 50%;
}

.brand-mark::before {
  inset: 6px;
  border: 1px solid rgba(79, 184, 255, 0.69);
}

.brand-mark::after {
  inset: 13px;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
}

.brand-word {
  font: 400 12px/1.32 var(--pf-ui-font);
  letter-spacing: .28em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--text-primary);
}

/* Nav links */
.site-nav {
  display: flex;
  align-items: stretch;
  flex: 0 0 auto;
}

.site-nav-link {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 22px;
  border-right: none;
  color: var(--text-secondary);
  font: 400 12px/1 var(--pf-ui-font);
  letter-spacing: .18em;
  text-transform: uppercase;
  text-decoration: none;
  text-shadow: 0 2px 5px rgba(0, 0, 0, .85), 0 1px 2px rgba(0, 0, 0, .9);
  transition: color var(--t-fast) var(--ease);
  white-space: nowrap;
}

.site-nav-link:hover {
  color: var(--text-primary);
}

.site-nav-link.is-current {
  color: var(--cyan-bright);
}

.site-nav-link.is-current::after {
  content: "";
  position: absolute;
  inset: auto 16% -1px;
  height: 2px;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan), 0 0 22px rgba(63, 196, 255, 0.55);
}

/* Top bar action controls area */
.site-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  padding-left: 16px;
  flex: 1 1 auto;
  justify-content: flex-end;
  min-width: 0;
}

.site-header-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Account pill */
.site-account {
  display: flex;
  gap: 9px;
  align-items: center;
  align-self: center;
  padding: 9px 18px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-primary);
  background: linear-gradient(180deg, rgba(11, 28, 40, 0.9), rgba(6, 15, 22, 0.9));
  box-shadow: inset 0 1px 0 rgba(104, 215, 255, 0.12);
  font: 400 11px/1 var(--pf-ui-font);
  letter-spacing: .16em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition:
    border-color var(--t-fast) var(--ease),
    box-shadow var(--t-fast) var(--ease),
    color var(--t-fast) var(--ease);
  cursor: pointer;
}

.site-account:hover {
  border-color: rgba(104, 215, 255, 0.65);
  box-shadow: inset 0 1px 0 rgba(104, 215, 255, 0.22), 0 0 18px rgba(63, 196, 255, 0.22);
  color: #fff;
}

.account-avatar {
  position: relative;
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.account-avatar::before {
  content: "";
  position: absolute;
  top: 0;
  left: 4px;
  width: 7px;
  height: 7px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  box-sizing: border-box;
}

.account-avatar::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0.5px;
  width: 14px;
  height: 7px;
  border: 1.5px solid currentColor;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  box-sizing: border-box;
}

/* --- Top-Bar Unified Action Buttons & Controls --------------------------- */

.header-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-primary);
  background: linear-gradient(180deg, rgba(14, 34, 48, 0.9), rgba(7, 18, 27, 0.9));
  box-shadow: inset 0 1px 0 rgba(104, 215, 255, 0.12);
  font: 400 11px/1.2 var(--pf-ui-font);
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease);
}

.header-btn:hover {
  border-color: rgba(104, 215, 255, 0.6);
  background: linear-gradient(180deg, rgba(20, 48, 68, 0.95), rgba(10, 26, 38, 0.95));
  box-shadow: inset 0 1px 0 rgba(104, 215, 255, 0.25), 0 0 12px rgba(63, 196, 255, 0.2);
}

.header-btn.is-primary {
  border-color: rgba(104, 215, 255, 0.7);
  background: linear-gradient(180deg, rgba(14, 76, 114, 0.95), rgba(6, 42, 66, 0.95));
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(104, 215, 255, 0.4), 0 0 16px rgba(63, 196, 255, 0.28);
}

.header-btn.is-primary:hover {
  border-color: #68d7ff;
  background: linear-gradient(180deg, rgba(22, 102, 150, 1), rgba(10, 58, 90, 1));
  box-shadow: inset 0 1px 0 rgba(104, 215, 255, 0.6), 0 0 22px rgba(63, 196, 255, 0.45);
}

.header-btn.is-icon {
  padding: 6px 10px;
  min-width: 36px;
  font-size: 14px;
}

.header-field-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-input,
.header-select {
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: rgba(4, 15, 24, 0.88);
  color: var(--text-primary);
  font: 400 12px var(--pf-ui-font);
  outline: none;
  box-sizing: border-box;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}

.header-input:focus,
.header-select:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 10px rgba(63, 196, 255, 0.3);
}

.header-select option {
  background: #06121a;
  color: #edf7ff;
}

.header-segmented {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  background: rgba(3, 10, 16, 0.85);
}

.header-segmented-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 12px;
  border: none;
  border-right: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-secondary);
  font: 400 11px/1 var(--pf-ui-font);
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease);
}

.header-segmented-btn:last-child {
  border-right: none;
}

.header-segmented-btn:hover {
  color: var(--text-primary);
  background: rgba(63, 196, 255, 0.08);
}

.header-segmented-btn.selected,
.header-segmented-btn.is-active,
.header-segmented-btn[aria-pressed="true"] {
  color: var(--cyan-bright);
  background: linear-gradient(180deg, rgba(63, 196, 255, 0.22), rgba(63, 196, 255, 0.08));
  box-shadow: inset 0 0 12px rgba(63, 196, 255, 0.2);
}

.header-sep {
  width: 1px;
  height: 24px;
  background: var(--border);
  opacity: 0.5;
  margin: 0 4px;
}

.header-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: rgba(8, 24, 36, 0.7);
  color: var(--cyan-bright);
  font: 400 11px/1 var(--pf-ui-font);
  letter-spacing: .12em;
  text-transform: uppercase;
}

/* Responsive adjustments */
@media (max-width: 1100px) {
  .site-brand {
    padding: 0 16px;
    gap: 10px;
  }
  .site-nav-link {
    padding: 0 14px;
    letter-spacing: .12em;
  }
  .brand-word {
    font-size: 11px;
    letter-spacing: .2em;
  }
}

@media (max-width: 768px) {
  :root {
    --pf-header-h: auto;
  }
  .site-header {
    flex-wrap: wrap;
    height: auto;
    padding: 8px 12px;
    gap: 8px;
  }
  .site-brand {
    padding: 0 12px 0 0;
    border-right: none;
  }
  .site-nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    border-top: 1px solid var(--border-subtle);
    padding-top: 4px;
  }
  .site-header-actions {
    margin-left: auto;
  }
}
