/* Global dil değiştirici (bkz. Views/Shared/_LanguageSwitcher.cshtml).

   Sol altta: sağ alt köşe editör sayfalarında yakınlaştırma çubuğu ve yapay zekâ
   düğmesiyle dolu. z-index çerez bandının (10000) ALTINDA tutulur; band
   kapatılana kadar onun arkasında kalması doğru davranış, band zaten tek seferlik. */
.lang-switch {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 9500;
  font-family: inherit;
}

/* Küre düğmesi — kapalı durumdaki tek görünen parça. */
.lang-switch-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(20, 20, 28, .12);
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 6px 20px rgba(20, 20, 28, .16);
  backdrop-filter: blur(6px);
  color: #4a4a55;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  cursor: pointer;
  user-select: none;
  transition: color .15s, border-color .15s;
}

/* Varsayılan açılır üçgeni kaldır. */
.lang-switch-toggle::-webkit-details-marker { display: none; }
.lang-switch-toggle { list-style: none; }

.lang-switch-toggle:hover { color: #17171c; border-color: rgba(20, 20, 28, .24); }
.lang-switch-toggle:focus-visible { outline: 2px solid #f4511e; outline-offset: 2px; }

.lang-switch-globe { flex: none; transition: transform .25s ease; }
.lang-switch[open] .lang-switch-globe { transform: rotate(180deg); }
.lang-switch[open] .lang-switch-toggle { color: #f4511e; border-color: rgba(244, 81, 30, .45); }

/* Kapalıyken AÇIKÇA gizlenir. <details> içeriği normalde kendisi gizler ama
   mutlak konumlu panel bu gizlemenin dışında kalıyor; ölçümde kapalı durumda da
   display:flex okunuyordu. Ayrıca display none -> flex geçişi, açılış
   animasyonunun her seferinde çalışmasını sağlıyor. */
.lang-switch:not([open]) .lang-switch-panel { display: none; }

/* Panel kürenin SAĞINA açılır: bileşen sol kenarda durduğu için tek boş yön o.
   Kürenin dikey ortasıyla hizalanır. */
.lang-switch-panel {
  position: absolute;
  left: calc(100% + 8px);
  bottom: 0;
  display: flex;
  gap: 3px;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid rgba(20, 20, 28, .12);
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 6px 20px rgba(20, 20, 28, .16);
  backdrop-filter: blur(6px);
  white-space: nowrap;
  /* Geçiş değil animasyon: <details> içeriği açılışta display kazandığı için
     transition çalışmaz, keyframe animasyonu çalışır. */
  animation: langSwitchOpen .22s ease-out;
  transform-origin: left center;
}

@keyframes langSwitchOpen {
  from { opacity: 0; transform: translateX(-10px) scaleX(.86); }
  to   { opacity: 1; transform: translateX(0) scaleX(1); }
}

.lang-switch-option {
  padding: 7px 14px;
  border-radius: 999px;
  color: #5b5b66;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  transition: background-color .15s, color .15s;
}

.lang-switch-option:hover { color: #17171c; background: rgba(20, 20, 28, .07); }
.lang-switch-option.is-active { color: #fff; background: #f4511e; }
.lang-switch-option.is-active:hover { background: #dc451a; }
.lang-switch-option:focus-visible { outline: 2px solid #f4511e; outline-offset: 2px; }

/* Dar ekranda alt gezinme çubuğu olan sayfalarda üstüne binmesin. */
@media (max-width: 900px) {
  .lang-switch { left: 12px; bottom: 12px; }
  .lang-switch-toggle { height: 34px; padding: 0 10px; font-size: 11px; }
  .lang-switch-option { padding: 6px 11px; font-size: 11px; }
}

/* Çok dar ekranda panel sağa taşabilir; kürenin ÜSTÜNE açılır. */
@media (max-width: 380px) {
  .lang-switch-panel {
    left: 0;
    bottom: calc(100% + 8px);
    transform-origin: left bottom;
    animation-name: langSwitchOpenUp;
  }
  @keyframes langSwitchOpenUp {
    from { opacity: 0; transform: translateY(8px) scale(.92); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
  }
}

@media (prefers-reduced-motion: reduce) {
  .lang-switch-panel { animation: none; }
  .lang-switch-globe { transition: none; }
}

/* Yazdırmada anlamsız. */
@media print { .lang-switch { display: none !important; } }
