/* Site header — profesyonel shell */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  min-width: 0;
  isolation: isolate;
  background: var(--site-surface);
  backdrop-filter: blur(18px) saturate(1.25);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 10px 36px -14px rgba(0, 0, 0, 0.5);
}

.site-header::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(22, 119, 255, 0.45) 50%,
    transparent 100%
  );
  pointer-events: none;
  opacity: 0.85;
}

.site-header__bar {
  position: relative;
  z-index: 1;
}

.site-header__brand {
  border-color: rgba(255, 255, 255, 0.06) !important;
}

/* Sidebar sütunu logosu (masaüstü header brand) — tek kaynak */
@media (min-width: 1024px) {
  #header-root .site-header__brand {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 0.375rem;
    min-height: var(--site-header-h);
    height: 100%;
    padding: 0 0.5rem 0 0.75rem !important;
    box-sizing: border-box;
  }

  #header-root .site-header__brand-toggle {
    position: static;
    flex-shrink: 0;
    align-self: center;
    transform: none;
    margin: 0;
  }

  #header-root .site-header__logo-link--desktop {
    display: flex !important;
    flex: 1 1 auto;
    align-items: center !important;
    justify-content: center !important;
    width: auto;
    min-width: 0;
    height: auto;
    max-height: 100%;
    margin: 0 !important;
    padding: var(--site-sidebar-logo-pad-top, 10px) 0 var(--site-sidebar-logo-pad-bottom, 5px) !important;
    box-sizing: border-box !important;
  }

  #header-root .site-header__logo-box--desktop {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 0;
    min-width: 0;
  }

  #header-root .site-header__logo-box--desktop .site-brand-logo,
  #header-root .site-header__logo-box--desktop img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: var(--site-sidebar-logo-max-h, 70px);
    object-fit: contain;
    object-position: center center;
  }
}

/* Mobil sidebar üstü: logo + kapat + dil aynı dikey hizada */
@media (max-width: 1023px) {
  .site-sidebar__head {
    align-items: center !important;
  }

  .site-sidebar__head #sidebar-locale-details {
    align-self: center;
  }

  .site-sidebar__head-actions {
    align-self: center;
    display: flex;
    align-items: center;
  }

  .site-sidebar__logo-link {
    align-self: center !important;
    height: auto !important;
    max-height: 100%;
  }
}

.site-sidebar__logo-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  box-sizing: border-box;
  padding: var(--site-sidebar-logo-pad-top, 10px) 0 var(--site-sidebar-logo-pad-bottom, 5px);
}

.site-sidebar__logo-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 0;
  min-width: 0;
}

.site-sidebar__logo-box img,
.site-sidebar__logo-box .site-brand-logo {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: var(--site-sidebar-logo-max-h, 70px);
  object-fit: contain;
  object-position: center center;
}

.site-header__toolbar {
  border-color: rgba(255, 255, 255, 0.06) !important;
  gap: 0.5rem;
}

.site-header__search-trigger,
#site-search-trigger {
  background: rgba(8, 12, 20, 0.55) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  color: #94a3b8;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease,
    color 0.2s ease;
}

.site-header__search-trigger:hover,
#site-search-trigger:hover {
  background: rgba(22, 119, 255, 0.1) !important;
  border-color: rgba(22, 119, 255, 0.32) !important;
  color: #cbd5e1;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 0 0 1px rgba(22, 119, 255, 0.08);
}

.site-header__search-field svg {
  color: rgba(148, 163, 184, 0.85);
}

.site-header__social-wrap {
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
  background: rgba(8, 12, 20, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.site-header__social-label {
  color: rgba(148, 163, 184, 0.7);
  letter-spacing: 0.18em;
}

.btn-social-brand--header {
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.03);
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    transform 0.15s ease,
    box-shadow 0.2s ease;
}

.btn-social-brand--header:hover {
  border-color: rgba(22, 119, 255, 0.35);
  background: rgba(22, 119, 255, 0.1);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px -8px rgba(22, 119, 255, 0.35);
}

.site-header__lang {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.site-header__locale-btn {
  min-width: 2.25rem;
  min-height: 2.25rem;
  padding: 0 !important;
  line-height: 1;
  color: #94a3b8 !important;
}

@media (min-width: 1280px) {
  .site-header__locale-btn {
    min-width: 2.5rem;
    min-height: 2.5rem;
  }
}

.site-header__locale-btn[aria-pressed="true"] {
  border-color: rgba(22, 119, 255, 0.45) !important;
  background: rgba(22, 119, 255, 0.18) !important;
  color: #f1f5f9 !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 14px -4px rgba(22, 119, 255, 0.35);
}

.site-header__lang .k-locale-btn {
  min-width: 2.25rem;
  border-radius: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.site-header__lang .k-locale-btn[aria-pressed="true"] {
  background: rgba(22, 119, 255, 0.18) !important;
  color: #f1f5f9 !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 14px -4px rgba(22, 119, 255, 0.35);
}

.site-header__action-btn:focus-visible,
.site-header__brand-toggle:focus-visible,
.site-header__mobile-btn:focus-visible,
.site-header__search-trigger:focus-visible,
#site-search-trigger:focus-visible {
  outline: 2px solid rgba(22, 119, 255, 0.55);
  outline-offset: 2px;
}

.site-header__action-btn,
.site-header__brand-toggle,
.site-header__mobile-btn {
  border-radius: 0.6875rem !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: rgba(255, 255, 255, 0.04) !important;
  color: #cbd5e1 !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.15s ease;
}

.site-header__action-btn:hover,
.site-header__brand-toggle:hover,
.site-header__mobile-btn:hover {
  border-color: rgba(22, 119, 255, 0.38) !important;
  background: rgba(22, 119, 255, 0.12) !important;
  color: #f1f5f9 !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 18px -6px rgba(22, 119, 255, 0.35);
}

.site-header__action-btn:active,
.site-header__brand-toggle:active,
.site-header__mobile-btn:active {
  transform: scale(0.97);
}

.site-header__coin-badge {
  border-radius: 0.6875rem !important;
  border: 1px solid rgba(22, 119, 255, 0.28) !important;
  background: linear-gradient(
    180deg,
    rgba(22, 119, 255, 0.16) 0%,
    rgba(22, 119, 255, 0.06) 100%
  ) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 4px 14px -8px rgba(22, 119, 255, 0.25);
}

.site-header__toolbar .btn-site-secondary,
.site-header__toolbar .btn-site-primary {
  border-radius: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* Giriş / Kayıt — aynı yükseklik ve genişlik */
.header-auth-btn {
  box-sizing: border-box;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 0;
  width: 100%;
  flex: 1 1 0;
  min-height: 2.5rem;
  height: 2.5rem;
  padding: 0 1rem !important;
  font-size: 0.8125rem !important;
  font-weight: 600 !important;
  line-height: 1.25 !important;
  border-radius: 0.75rem !important;
  white-space: nowrap;
}

.site-header__toolbar [data-auth-area="guest"] {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(5.75rem, 1fr));
  gap: 0.375rem;
  align-items: stretch;
}

.site-header__toolbar [data-auth-area="guest"].hidden,
.header-auth-guest-mobile.hidden {
  display: none !important;
}

.site-header__toolbar .header-auth-btn {
  width: 100%;
  min-width: 0;
}

.site-chat-guest-auth,
.site-chat-guest-auth .header-auth-btn {
  width: 100%;
}

@media (min-width: 1024px) {
  .site-header__toolbar .header-auth-btn {
    min-height: 2.25rem;
    height: 2.25rem;
    padding: 0 0.75rem !important;
    font-size: 0.75rem !important;
  }

  .site-header__toolbar [data-auth-area="guest"] {
    grid-template-columns: repeat(2, minmax(5.25rem, 1fr));
  }
}

@media (min-width: 1280px) {
  .site-header__toolbar .header-auth-btn {
    min-height: 2.5rem;
    height: 2.5rem;
    padding: 0 0.875rem !important;
    font-size: 0.8125rem !important;
  }

  .site-header__toolbar [data-auth-area="guest"] {
    grid-template-columns: repeat(2, minmax(5.75rem, 1fr));
    gap: 0.5rem;
  }
}

@media (max-width: 1023px) {
  .site-header__mobile {
    gap: 0.625rem;
  }

  .site-header__mobile-top {
    padding-bottom: 0.125rem;
  }

  .header-auth-guest-mobile .header-auth-btn {
    min-height: 2.625rem;
    height: 2.625rem;
    font-weight: 600;
  }

  .header-mobile-coin-btn {
    border-radius: 0.75rem !important;
    border-color: rgba(22, 119, 255, 0.28) !important;
    background: linear-gradient(
      180deg,
      rgba(22, 119, 255, 0.14) 0%,
      rgba(22, 119, 255, 0.06) 100%
    ) !important;
  }

  .header-mobile-market-btn {
    border-radius: 0.75rem !important;
  }
}

@media (min-width: 1024px) {
  .site-header__mid {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .site-header__toolbar {
    padding-left: 1.125rem !important;
    padding-right: 1.5rem !important;
  }
}

[data-theme="light"] .site-header {
  background: var(--site-raised) !important;
  border-bottom-color: rgba(15, 23, 42, 0.08) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 8px 24px -12px rgba(15, 23, 42, 0.1) !important;
}

[data-theme="light"] .site-header::before {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(22, 119, 255, 0.25) 50%,
    transparent 100%
  );
}

[data-theme="light"] .site-header__search-trigger,
[data-theme="light"] #site-search-trigger {
  background: #fff !important;
  border-color: rgba(15, 23, 42, 0.1) !important;
  color: #64748b;
}

[data-theme="light"] .site-header__social-wrap {
  background: rgba(255, 255, 255, 0.7);
  border-color: rgba(15, 23, 42, 0.08) !important;
}

[data-theme="light"] .site-header__locale-btn[aria-pressed="true"] {
  background: rgba(22, 119, 255, 0.14) !important;
  border-color: rgba(22, 119, 255, 0.35) !important;
  color: #0f172a !important;
}

[data-theme="light"] .site-header__lang {
  background: transparent !important;
  border: none !important;
}

[data-theme="light"] .site-header__action-btn,
[data-theme="light"] .site-header__brand-toggle,
[data-theme="light"] .site-header__mobile-btn {
  background: #fff !important;
  border-color: rgba(15, 23, 42, 0.1) !important;
  color: #64748b !important;
}

[data-theme="light"] .site-header__action-btn:hover,
[data-theme="light"] .site-header__brand-toggle:hover,
[data-theme="light"] .site-header__mobile-btn:hover {
  background: #f1f5f9 !important;
  border-color: rgba(22, 119, 255, 0.28) !important;
  color: #0f172a !important;
}

[data-theme="light"] .btn-social-brand--header {
  background: rgba(22, 119, 255, 0.06);
  border-color: rgba(15, 23, 42, 0.08);
}

/* Header search palette hard overrides */
#search-palette .search-palette__backdrop {
  background: rgba(14, 19, 28, 0.64) !important;
}

#search-palette-panel {
  background: var(--site-surface-gradient) !important;
}

#search-palette .search-palette__scroll {
  background: var(--site-surface-gradient) !important;
}

#search-palette-input {
  background: var(--site-raised-gradient) !important;
}

[data-theme="light"] #search-palette .search-palette__backdrop {
  background: rgba(241, 245, 249, 0.72) !important;
}

[data-theme="light"] #search-palette .search-palette__scroll {
  background: var(--site-surface-gradient) !important;
}
