/* 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) {
  /* Mobil üst satır 2.5rem sabit; logo scale + zorunlu height (index critical CSS ile aynı) */
  #header-root .site-header__mobile-top {
    grid-template-columns: minmax(0, 1fr) minmax(min(11rem, 46vw), 1.55fr) minmax(0, 1fr) !important;
  }

  #header-root .site-header__mobile-logo {
    min-width: min(11rem, 46vw);
    flex-shrink: 0;
    overflow: hidden;
  }

  #header-root .site-header__mobile-logo .site-header__logo-link {
    height: 2.5rem !important;
    max-height: 2.5rem !important;
    min-height: 2.5rem !important;
    overflow: hidden;
  }

  #header-root .site-header__mobile-logo .site-header__logo-box--mobile,
  #header-root .site-header__mobile-logo .site-header__logo-box {
    width: min(17.5rem, 72vw) !important;
    max-width: min(17.5rem, 72vw) !important;
    height: 2.5rem !important;
    max-height: 2.5rem !important;
    min-height: 2.5rem !important;
    flex-shrink: 0;
    overflow: hidden;
  }

  #header-root .site-header__mobile-logo .site-header__logo-box img,
  #header-root .site-header__mobile-logo .site-brand-logo--header {
    height: 2.5rem !important;
    min-height: 2.5rem !important;
    max-height: 2.5rem !important;
    width: auto !important;
    max-width: min(17.5rem, 72vw) !important;
    object-fit: contain;
    object-position: center center;
    transform: scale(1.34);
    transform-origin: center center;
  }

  .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;
}

/* Mobil alt menü — orta menü butonu (yalnızca alt bar) */
.site-bottom-nav {
  overflow: visible;
}

.site-bottom-nav .bottom-nav-center {
  position: relative;
  z-index: 2;
  align-self: stretch;
  margin-inline: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: #93c5fd;
  transition: color 0.15s ease;
}

.site-bottom-nav .bottom-nav-center__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  margin-top: -0.875rem;
  border-radius: 1rem;
  border: 1px solid rgba(22, 119, 255, 0.42);
  background: linear-gradient(
    165deg,
    rgba(22, 119, 255, 0.32) 0%,
    rgba(22, 119, 255, 0.16) 100%
  );
  box-shadow:
    0 6px 18px rgba(22, 119, 255, 0.28),
    0 2px 6px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transform: translateY(-0.125rem);
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease,
    margin-top 0.15s ease;
}

.site-bottom-nav .bottom-nav-center:hover {
  color: #bfdbfe;
}

.site-bottom-nav .bottom-nav-center:hover .bottom-nav-center__icon {
  margin-top: -1rem;
  border-color: rgba(105, 177, 255, 0.55);
  background: linear-gradient(
    165deg,
    rgba(22, 119, 255, 0.4) 0%,
    rgba(22, 119, 255, 0.22) 100%
  );
  box-shadow:
    0 8px 22px rgba(22, 119, 255, 0.34),
    0 2px 8px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
  transform: translateY(-0.25rem);
}

.site-bottom-nav .bottom-nav-center:active .bottom-nav-center__icon {
  margin-top: -0.75rem;
  transform: translateY(0) scale(0.94);
}

.site-bottom-nav .bottom-nav-center__label {
  color: #94a3b8;
}

.site-bottom-nav .bottom-nav-center:hover .bottom-nav-center__label {
  color: #e2e8f0;
}

.bottom-nav-menu-icon {
  width: 1.375rem;
  height: 1.375rem;
}

[data-theme="light"] .site-bottom-nav .bottom-nav-center {
  color: #1677ff;
}

[data-theme="light"] .site-bottom-nav .bottom-nav-center__icon {
  border-color: rgba(22, 119, 255, 0.34);
  background: linear-gradient(
    165deg,
    rgba(22, 119, 255, 0.14) 0%,
    rgba(22, 119, 255, 0.06) 100%
  );
  box-shadow: 0 4px 12px rgba(22, 119, 255, 0.14);
}

[data-theme="light"] .site-bottom-nav .bottom-nav-center:hover {
  color: #0958d8;
}

[data-theme="light"] .site-bottom-nav .bottom-nav-center:hover .bottom-nav-center__icon {
  background: linear-gradient(
    165deg,
    rgba(22, 119, 255, 0.2) 0%,
    rgba(22, 119, 255, 0.1) 100%
  );
}

[data-theme="light"] .site-bottom-nav .bottom-nav-center__label {
  color: var(--site-text-soft, #64748b);
}

[data-theme="light"] .site-bottom-nav .bottom-nav-center:hover .bottom-nav-center__label {
  color: #334155;
}
