/**
 * SnowBounty Shared Header Styles
 * 
 * Common styles for header and navigation components.
 * Include this file before page-specific styles.
 * 
 * @version 1.0.0
 */

/* Reset body margin for pages using this header */
html, body {
  margin: 0;
  padding: 0;
}

/* ============ STICKY HEADER ============ */
/*
 * Scope header colors here so it renders consistently regardless of
 * what individual pages set in their :root block.
 */
.sticky-header,
.sb-info-bar,
.sb-bottom-nav {
  --color-primary: #00d4aa;
  --color-accent: #00d4aa;
  --color-accent-dark: #00b894;
  --color-background: #ffffff;
  --color-text: #1a1a2e;
  --color-text-light: #6c757d;
  --color-border: #e0e0e0;
}

/* Header placeholder needs display:contents for sticky to work inside it */
#header-placeholder {
  display: contents;
}

.sticky-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--color-background, #fff);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

/* ============ TOP NAVIGATION BAR ============ */
.sb-top-nav {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 13px;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: #fff;
}

.sb-top-nav .container {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 20px;
}

.sb-top-nav a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  transition: color 0.2s ease;
}

.sb-top-nav a:hover {
  color: #00d4aa;
}

.sb-top-nav-left,
.sb-top-nav-right {
  display: flex;
  gap: 25px;
  align-items: center;
}

/* Action buttons in top nav */
.sb-top-nav .btn-post-bounty {
  background: #00d4aa !important;
  color: #000 !important;
  padding: 5px 12px;
  border-radius: 4px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.sb-top-nav .btn-post-bounty:hover {
  background: #00f5c4 !important;
  transform: translateY(-1px);
}

.sb-top-nav .btn-accept-bounty {
  background: #00d4aa !important;
  color: #000 !important;
  padding: 5px 12px;
  border-radius: 4px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.sb-top-nav .btn-accept-bounty:hover {
  background: #00f5c4 !important;
  transform: translateY(-1px);
}

/* Auth links - hidden until logged in */
.sb-top-nav .auth-required {
  display: none;
}

.sb-top-nav .auth-required.show {
  display: inline;
}

/* ============ MAIN HEADER ============ */
.sb-main-header {
  display: flex;
  align-items: center;
  padding: 15px 0;
  gap: 20px;
  background: var(--color-background, #fff);
  border-bottom: 1px solid #eee;
}

.sb-main-header .container {
  display: flex;
  align-items: center;
  gap: 20px;
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ============ SEASON INDICATOR ============ */
.sb-season-indicator {
  font-size: 14px;
  margin-left: 6px;
  opacity: 0.9;
  animation: seasonPulse 3s ease-in-out infinite;
  cursor: default;
}

@keyframes seasonPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* ============ LOGO ============ */
.sb-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.sb-logo:hover {
  transform: scale(1.02);
}

.sb-logo-circle {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #00d4aa 0%, #0077b6 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 3px 12px rgba(0, 212, 170, 0.3);
}

.sb-logo-circle::before {
  content: '';
  position: absolute;
  width: 40px;
  height: 40px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
}

.sb-logo-circle .flake {
  font-size: 22px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.sb-logo-wordmark {
  font-family: 'Righteous', cursive;
  font-size: 26px;
  color: var(--color-text, #1a1a2e);
  letter-spacing: 0.5px;
}

.sb-logo-wordmark span {
  background: linear-gradient(135deg, #00d4aa 0%, #0077b6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============ SEARCH IN HEADER ============ */
.sb-search-category {
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
  color: var(--color-text-light, #6c757d);
  padding: 8px 15px;
  border-left: 3px solid #00d4aa;
  background: #f8f9fa;
  cursor: pointer;
}

.sb-search-box {
  flex: 1;
  max-width: 400px;
}

.sb-search-box input {
  width: 100%;
  padding: 10px 15px;
  border: 2px solid #e0e0e0;
  border-radius: 25px;
  font-family: inherit;
  font-size: 14px;
  transition: all 0.2s ease;
}

.sb-search-box input:focus {
  outline: none;
  border-color: #00d4aa;
  box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.15);
}

.sb-search-box input::placeholder {
  color: #999;
}

.sb-search-buttons {
  display: flex;
  gap: 15px;
  font-size: 13px;
  margin-left: auto;
  white-space: nowrap;
}

.sb-search-buttons span {
  padding: 8px 16px;
  background: #f5f5f5;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sb-search-buttons span:hover {
  background: #e0e0e0;
}

.sb-search-buttons span:first-child {
  background: var(--color-primary, #1a1a2e);
  color: #fff;
}

.sb-search-buttons span:first-child:hover {
  background: var(--color-secondary, #16213e);
}

/* ============ SUB NAVIGATION ============ */
.sb-sub-nav {
  display: flex;
  padding: 12px 0;
  font-size: 13px;
  background: #fafafa;
  border-bottom: 1px solid #eee;
}

.sb-sub-nav .container {
  display: flex;
  gap: 20px;
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 20px;
  padding-left: 40px;
}

.sb-sub-nav a {
  color: var(--color-text-light, #6c757d);
  text-decoration: none;
  transition: color 0.2s ease;
  position: relative;
}

.sb-sub-nav a:hover {
  color: #00d4aa;
}

.sb-sub-nav a::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 2px;
  background: #00d4aa;
  transition: width 0.2s ease;
}

.sb-sub-nav a:hover::after {
  width: 100%;
}

.sb-sub-nav a.active {
  color: #00d4aa;
}

.sb-sub-nav a.active::after {
  width: 100%;
}

/* ============ AUTH BUTTONS & USER MENU ============ */
.sb-auth-buttons {
  display: flex;
  gap: 10px;
  align-items: center;
}

.sb-auth-buttons.hidden {
  display: none;
}

.sb-btn-signin {
  padding: 8px 18px;
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  transition: all 0.2s ease;
}

.sb-btn-signin:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.8);
}

/* User menu (shown when logged in) */
.sb-user-menu {
  display: none;
  align-items: center;
  gap: 12px;
}

.sb-user-menu.active {
  display: flex;
}

.sb-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00d4aa 0%, #0077b6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  text-decoration: none;
}

.sb-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sb-user-avatar .profile-alert {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 12px;
  height: 12px;
  background: #ff6b6b;
  border-radius: 50%;
  border: 2px solid #1a1a2e;
}

.sb-user-name {
  color: #fff;
  font-size: 14px;
  font-weight: 500;
}

.sb-btn-signout {
  padding: 6px 12px;
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
}

.sb-btn-signout:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* Notification badge */
.sb-notification-link {
  position: relative;
  color: rgba(255, 255, 255, 0.85) !important;
}

.sb-notification-badge {
  position: absolute;
  top: -5px;
  right: -8px;
  min-width: 18px;
  height: 18px;
  background: #ff6b6b;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  border-radius: 9px;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

.sb-notification-badge.show {
  display: flex;
}

/* ============ MOBILE MENU ============ */
.sb-mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.sb-mobile-menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text, #1a1a2e);
  transition: all 0.3s ease;
}

.sb-mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.sb-mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.sb-mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile menu drawer */
.sb-mobile-nav {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  z-index: 1000;
  overflow-y: auto;
  padding: 20px;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}

.sb-mobile-nav.active {
  transform: translateX(0);
}

.sb-mobile-nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.sb-mobile-nav-close {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sb-mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.sb-mobile-nav-links a {
  display: block;
  padding: 15px 20px;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-size: 16px;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.sb-mobile-nav-links a:hover,
.sb-mobile-nav-links a.active {
  background: rgba(255, 255, 255, 0.1);
  color: #00d4aa;
}

.sb-mobile-nav-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 15px 0;
}

.sb-mobile-auth {
  margin-top: 20px;
}

.sb-mobile-btn-signin {
  display: block;
  width: 100%;
  padding: 15px;
  background: #00d4aa;
  color: #000;
  text-align: center;
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
}

.sb-mobile-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  margin-bottom: 15px;
}

.sb-mobile-user-info .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00d4aa 0%, #0077b6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #fff;
}

.sb-mobile-user-info .name {
  color: #fff;
  font-weight: 500;
}

/* ============ BREADCRUMBS ============ */
.sb-breadcrumbs {
  padding: 12px 0;
  font-size: 13px;
  color: var(--color-text-light, #6c757d);
}

.sb-breadcrumbs .container {
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 20px;
}

.sb-breadcrumbs a {
  color: var(--color-text, #1a1a2e);
  text-decoration: none;
}

.sb-breadcrumbs a:hover {
  text-decoration: underline;
}

.sb-breadcrumbs .separator {
  margin: 0 8px;
  color: #ccc;
}

.sb-breadcrumbs .current {
  color: var(--color-text-light, #6c757d);
}

/* ============ LOCATION BAR ============ */
.sb-location-bar {
  padding: 12px 0;
  font-size: 13px;
  background: linear-gradient(90deg, #e8f5f1 0%, #fff 100%);
  border-bottom: 1px solid #e0e0e0;
}

.sb-location-bar .container {
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 20px;
}

.sb-location-bar a {
  color: var(--color-text, #1a1a2e);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #fff;
  border-radius: 20px;
  border: 1px solid #ddd;
  transition: all 0.2s ease;
}

.sb-location-bar a:hover {
  border-color: #00d4aa;
  box-shadow: 0 2px 8px rgba(0, 212, 170, 0.15);
}

/* ============ INFO BAR ============ */
/* Hidden by default - shown via JS when links are populated */
.sb-info-bar {
  display: none;
  padding: 8px 0;
  font-size: 12px;
  background: #f8f9fa;
  border-bottom: 1px solid #eee;
}

.sb-info-bar.has-links {
  display: block;
}

.sb-info-bar .container {
  display: flex;
  justify-content: flex-end;
  gap: 20px;
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 20px;
}

.sb-info-bar a {
  color: var(--color-text-light, #6c757d);
  text-decoration: none;
}

.sb-info-bar a:hover {
  color: #00d4aa;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
  .sb-top-nav-left {
    display: none;
  }

  .sb-top-nav-right {
    flex: 1;
    justify-content: flex-end;
  }

  .sb-top-nav .btn-accept-bounty {
    display: none;
  }

  .sb-main-header .container {
    gap: 10px;
  }

  .sb-search-category {
    display: none;
  }

  .sb-search-box {
    max-width: none;
  }

  .sb-search-buttons {
    display: none;
  }

  .sb-sub-nav {
    display: none;
  }

  .sb-mobile-menu-toggle {
    display: flex;
  }

  .sb-mobile-nav {
    display: block;
  }

  .sb-logo-wordmark {
    display: none;
  }

  .sb-user-name {
    display: none;
  }
}

@media (max-width: 480px) {
  .sb-auth-buttons .sb-btn-signin {
    padding: 6px 10px;
    font-size: 12px;
  }

  .sb-user-avatar {
    width: 30px;
    height: 30px;
    font-size: 12px;
  }
}

/* ============ ACCESSIBILITY: SKIP LINK ============ */
.sb-skip-link {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a2e;
  color: #fff;
  padding: 12px 24px;
  border-radius: 0 0 8px 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  z-index: 9999;
  transition: top 0.2s ease;
}

.sb-skip-link:focus {
  top: 0;
  outline: 3px solid #00d4aa;
  outline-offset: 2px;
}

/* ============ ACCESSIBILITY: FOCUS STYLES ============ */
/* Visible focus ring for all interactive elements */
.sb-top-nav a:focus,
.sb-sub-nav a:focus,
.sb-info-bar a:focus,
.sb-logo:focus,
.sb-breadcrumbs a:focus,
.sb-location-bar a:focus {
  outline: 2px solid #00d4aa;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Button focus styles */
.sb-btn-signin:focus,
.sb-btn-signout:focus,
.sb-mobile-menu-toggle:focus,
.sb-mobile-nav-close:focus,
.sb-mobile-btn-signin:focus,
.btn-post-bounty:focus,
.btn-accept-bounty:focus {
  outline: 2px solid #00d4aa;
  outline-offset: 2px;
}

/* Mobile navigation link focus */
.sb-mobile-nav-links a:focus {
  outline: 2px solid #00d4aa;
  outline-offset: -2px;
  background: rgba(255, 255, 255, 0.1);
}

/* User avatar focus */
.sb-user-avatar:focus {
  outline: 2px solid #00d4aa;
  outline-offset: 2px;
}

/* Search buttons focus */
.sb-search-buttons span:focus {
  outline: 2px solid #00d4aa;
  outline-offset: 2px;
}

/* High contrast focus for dark backgrounds */
.sb-top-nav a:focus-visible,
.sb-mobile-nav a:focus-visible {
  outline-color: #fff;
  box-shadow: 0 0 0 4px rgba(0, 212, 170, 0.4);
}
