/**
 * Premium Header — AllinPro
 * Glassmorphism, pill nav, flush-to-top
 */

/* Ensure no gap above header */
body { padding-top: 0 !important; }

/* Bar — flush top, strong glass */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(180deg, rgba(12, 10, 20, 0.88) 0%, rgba(7, 6, 11, 0.78) 100%);
  backdrop-filter: blur(24px) saturate(200%);
  -webkit-backdrop-filter: blur(24px) saturate(200%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 1px 0 0 rgba(255, 255, 255, 0.04) inset,
              0 8px 32px -12px rgba(0, 0, 0, 0.5),
              0 0 0 1px rgba(99, 102, 241, 0.03);
}
.site-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(99, 102, 241, 0.4) 50%, transparent 100%);
  opacity: 0.6;
  pointer-events: none;
}

.site-header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

@media (min-width: 1024px) {
  .site-header-inner { padding: 0 2rem; height: 4.5rem; }
}

/* Logo */
.site-header-logo {
  flex-shrink: 0;
}
.site-header-logo a {
  display: flex;
  align-items: center;
  transition: opacity var(--transition-smooth);
}
.site-header-logo a:hover { opacity: 0.9; }
.site-header-logo img {
  height: 1.75rem;
  width: auto;
}
@media (min-width: 640px) {
  .site-header-logo img { height: 2rem; }
}

/* Main nav — pill container */
.site-header-nav {
  display: none;
}
@media (min-width: 1024px) {
  .site-header-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    max-width: 560px;
    margin: 0 auto;
  }
}
.site-header-nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.125rem;
  padding: 0.25rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 100px;
  box-shadow: 0 2px 12px -4px rgba(0, 0, 0, 0.3);
}
.site-header-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  text-decoration: none;
  border-radius: 100px;
  transition: color var(--transition-smooth), background var(--transition-smooth), box-shadow var(--transition-smooth);
}
.site-header-link:hover {
  color: var(--color-text-primary);
  background: rgba(255, 255, 255, 0.05);
}
.site-header-link.active {
  color: var(--color-accent-bright);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.15) 100%);
  box-shadow: 0 0 20px -4px rgba(99, 102, 241, 0.25);
}

/* Admin dropdown — inside pill */
.site-header-admin {
  position: relative;
}
.site-header-admin-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  background: transparent;
  border: none;
  border-radius: 100px;
  cursor: pointer;
  transition: all var(--transition-smooth);
}
.site-header-admin-btn:hover {
  color: var(--color-text-primary);
  background: rgba(255, 255, 255, 0.05);
}
.site-header-admin-btn .icon-chevron-down {
  transition: transform var(--transition-smooth);
}
.site-header-admin.open .site-header-admin-btn {
  color: var(--color-accent-bright);
  background: rgba(99, 102, 241, 0.15);
}
.site-header-admin.open .icon-chevron-down { transform: rotate(180deg); }
.site-header-admin-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  min-width: 12rem;
  background: rgba(18, 16, 26, 0.98);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  padding: 0.5rem;
  box-shadow: 0 12px 40px -12px rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 200;
}
.site-header-admin.open .site-header-admin-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.site-header-admin-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  border-radius: 8px;
  transition: all var(--transition-smooth);
}
.site-header-admin-item:hover {
  color: var(--color-accent-bright);
  background: rgba(99, 102, 241, 0.1);
}

/* Right actions */
.site-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Support button */
.site-header-support {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-primary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 100px;
  text-decoration: none;
  transition: all var(--transition-smooth);
}
@media (min-width: 640px) {
  .site-header-support { display: inline-flex; }
}
.site-header-support:hover {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.25);
  color: var(--color-accent-bright);
  box-shadow: 0 0 20px -4px rgba(99, 102, 241, 0.2);
}

/* Auth buttons (logged out) */
.site-header-auth {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.site-header-btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-primary);
  background: transparent;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all var(--transition-smooth);
}
.site-header-btn-outline:hover {
  border-color: rgba(99, 102, 241, 0.5);
  color: var(--color-accent-bright);
}
.site-header-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  background: var(--gradient-brand);
  border: none;
  border-radius: var(--radius-sm);
  text-decoration: none;
  box-shadow: 0 4px 16px -4px rgba(99, 102, 241, 0.4);
  transition: all var(--transition-smooth);
}
.site-header-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px -4px rgba(99, 102, 241, 0.55), 0 0 0 1px rgba(99, 102, 241, 0.2);
}

/* Profile avatar */
.site-header-avatar {
  flex-shrink: 0;
  position: relative;
}
.site-header-avatar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.4) 0%, rgba(99, 102, 241, 0.4) 100%);
  border: 2px solid rgba(99, 102, 241, 0.3);
  cursor: pointer;
  transition: all var(--transition-smooth);
  overflow: hidden;
}
.site-header-avatar-btn:hover {
  border-color: rgba(99, 102, 241, 0.6);
  box-shadow: 0 0 24px -4px rgba(99, 102, 241, 0.45), 0 0 0 1px rgba(99, 102, 241, 0.1);
  transform: scale(1.02);
}
.site-header-avatar-initial {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* Profile dropdown */
.site-header-profile-dropdown {
  position: absolute;
  top: calc(100% + 0.75rem);
  right: 0;
  width: 20rem;
  max-width: calc(100vw - 2rem);
  background: linear-gradient(160deg, rgba(18, 16, 28, 0.98) 0%, rgba(12, 10, 20, 0.99) 100%);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.6);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.98);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 200;
  overflow: hidden;
}
.site-header-profile-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
.site-header-profile-header {
  padding: 1.5rem 1.5rem 1rem;
  text-align: center;
  border-bottom: 1px solid var(--color-border-subtle);
}
.site-header-profile-avatar {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}
.site-header-profile-name {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 0.25rem;
}
.site-header-profile-email {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
}
.site-header-profile-role {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  border-radius: 100px;
  background: rgba(99, 102, 241, 0.2);
  color: var(--color-accent-bright);
}
.site-header-profile-balance {
  padding: 1rem 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--color-border-subtle);
}
.site-header-profile-balance-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  margin-bottom: 0.25rem;
}
.site-header-profile-balance-amount {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--color-text-primary);
  margin-bottom: 0.75rem;
}
.site-header-deposit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  background: var(--gradient-brand);
  border: none;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all var(--transition-smooth);
}
.site-header-deposit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px -4px rgba(99, 102, 241, 0.5);
}
.site-header-profile-menu {
  padding: 0.5rem;
}
.site-header-profile-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: all var(--transition-smooth);
}
.site-header-profile-item:hover {
  color: var(--color-text-primary);
  background: rgba(255, 255, 255, 0.05);
}
.site-header-profile-item.signout:hover {
  color: #f87171;
  background: rgba(248, 113, 113, 0.1);
}

/* Mobile menu button */
.site-header-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  color: var(--color-text-primary);
  cursor: pointer;
  transition: all var(--transition-smooth);
}
@media (min-width: 1024px) {
  .site-header-menu-btn { display: none; }
}
.site-header-menu-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* Mobile menu overlay */
.site-header-mobile {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: none;
}
.site-header-mobile.show { display: block; }
.site-header-mobile-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  animation: headerFadeIn 0.2s ease;
}
.site-header-mobile-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 100%);
  background: linear-gradient(180deg, rgba(18, 16, 26, 0.99) 0%, rgba(7, 6, 11, 0.99) 100%);
  border-left: 1px solid var(--color-border-subtle);
  box-shadow: -20px 0 60px -20px rgba(0, 0, 0, 0.5);
  animation: headerSlideIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
}
.site-header-mobile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border-subtle);
}
.site-header-mobile-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  color: var(--color-text-primary);
  cursor: pointer;
  transition: all var(--transition-smooth);
}
.site-header-mobile-close:hover {
  background: rgba(255, 255, 255, 0.08);
}
.site-header-mobile-nav {
  padding: 1rem;
}
.site-header-mobile-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: all var(--transition-smooth);
}
.site-header-mobile-link:hover,
.site-header-mobile-link.active {
  color: var(--color-accent-bright);
  background: rgba(99, 102, 241, 0.1);
}

@keyframes headerFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes headerSlideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

/* Impersonation banner */
.site-header-impersonation {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  text-align: center;
  background: rgba(234, 179, 8, 0.1);
  border-bottom: 1px solid rgba(234, 179, 8, 0.2);
  color: #facc15;
}
.site-header-impersonation a {
  margin-left: 0.5rem;
  padding: 0.25rem 0.75rem;
  background: rgba(234, 179, 8, 0.2);
  border-radius: 6px;
  color: #facc15;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.2s;
}
.site-header-impersonation a:hover {
  background: rgba(234, 179, 8, 0.3);
}
