/* ==========================================================================
   CoreV2 — Üst Bar & Tema Değiştirici (Pro Revize v3)
   Hostkur ikon seti (hki-) + kayan pill (thumb) animasyonu.
   En sonda yüklenir; eski base.css / header.css / cv2-dark-tint.css kurallarını ezer.
   ========================================================================== */

:root {
  --cv2-ts-h: 32px;
  --cv2-ts-seg: 28px;
  --cv2-ts-pad: 3px;
  --cv2-ts-gap: 2px;
  --cv2-ts-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

html body .cv2-theme-switch.cv2-theme-switch--duo#theme-switcher{
  display:grid;
  place-items:center;
  width:40px;
  height:40px;
  padding:0;
  margin:0 2px 0 3px;
  border:0;
  border-radius:50%;
  background:transparent;
  color:var(--cv2-topbar-ink,rgba(255,255,255,.96));
  cursor:pointer;
  box-sizing:border-box;
}
html body .cv2-theme-switch.cv2-theme-switch--duo#theme-switcher:hover{
  background:var(--cv2-topbar-surface,rgba(255,255,255,.06));
}
html body .cv2-theme-switch.cv2-theme-switch--duo#theme-switcher .cv2-theme-icon{
  font-size:17px;
  color:inherit;
}
html body .cv2-theme-switch.cv2-theme-switch--duo .cv2-theme-switch__opt,
html body .cv2-theme-switch.cv2-theme-switch--duo .cv2-theme-switch__thumb,
html body .cv2-theme-switch.cv2-theme-switch--duo .cv2-theme-switch__rail{
  display:none!important;
}

html body .cv2-theme-switch.cv2-theme-switch--icons#theme-switcher,
html body .cv2-theme-switch.cv2-theme-switch--icons#mobile-theme-switcher {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}

/* Rail */
html body .cv2-theme-switch.cv2-theme-switch--icons#theme-switcher .cv2-theme-switch__rail,
html body .cv2-theme-switch.cv2-theme-switch--icons#mobile-theme-switcher .cv2-theme-switch__rail {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: var(--cv2-ts-gap) !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  height: var(--cv2-ts-h) !important;
  min-height: var(--cv2-ts-h) !important;
  max-height: var(--cv2-ts-h) !important;
  padding: var(--cv2-ts-pad) !important;
  box-sizing: border-box !important;
  border-radius: 999px !important;
  background: color-mix(in srgb, var(--CoreV2-secondary, #0f172a) 5%, transparent) !important;
  border: 1px dashed color-mix(in srgb, var(--CoreV2-secondary, #0f172a) 18%, transparent) !important;
  box-shadow: none !important;
  overflow: visible !important;
}

html[data-theme="dark"] body .cv2-theme-switch.cv2-theme-switch--icons#theme-switcher .cv2-theme-switch__rail,
html[data-theme="dark"] body .cv2-theme-switch.cv2-theme-switch--icons#mobile-theme-switcher .cv2-theme-switch__rail {
  background: rgba(255, 255, 255, 0.07) !important;
  border-color: rgba(255, 255, 255, 0.18) !important;
  box-shadow: none !important;
}

/* Kayan pill (thumb) */
html body .cv2-theme-switch.cv2-theme-switch--icons .cv2-theme-switch__thumb {
  position: absolute !important;
  top: var(--cv2-ts-pad) !important;
  left: var(--cv2-ts-pad) !important;
  z-index: 1 !important;
  width: var(--cv2-ts-seg) !important;
  height: var(--cv2-ts-seg) !important;
  border-radius: 999px !important;
  background: #ffffff !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  box-shadow: none !important;
  transform: translate3d(0, 0, 0);
  transition: transform 0.36s var(--cv2-ts-ease), background-color 0.25s ease, box-shadow 0.25s ease;
  pointer-events: none !important;
}

html[data-theme="dark"] body .cv2-theme-switch.cv2-theme-switch--icons .cv2-theme-switch__thumb {
  background: rgba(255, 255, 255, 0.94) !important;
  border-color: rgba(255, 255, 255, 0.22) !important;
  box-shadow: none !important;
}

/* Thumb konumu — tercihe göre kayar */
html[data-theme-preference="light"] body .cv2-theme-switch.cv2-theme-switch--icons .cv2-theme-switch__thumb {
  transform: translate3d(0, 0, 0);
}
html[data-theme-preference="system"] body .cv2-theme-switch.cv2-theme-switch--icons .cv2-theme-switch__thumb {
  transform: translate3d(calc(var(--cv2-ts-seg) + var(--cv2-ts-gap)), 0, 0);
}
html[data-theme-preference="dark"] body .cv2-theme-switch.cv2-theme-switch--icons .cv2-theme-switch__thumb,
html[data-theme="dark"]:not([data-theme-preference]) body .cv2-theme-switch.cv2-theme-switch--icons .cv2-theme-switch__thumb {
  transform: translate3d(calc((var(--cv2-ts-seg) + var(--cv2-ts-gap)) * 2), 0, 0);
}

/* Segment butonları */
html body .cv2-theme-switch.cv2-theme-switch--icons#theme-switcher .cv2-theme-switch__opt,
html body .cv2-theme-switch.cv2-theme-switch--icons#mobile-theme-switcher .cv2-theme-switch__opt {
  position: relative !important;
  z-index: 2 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 auto !important;
  width: var(--cv2-ts-seg) !important;
  min-width: var(--cv2-ts-seg) !important;
  max-width: var(--cv2-ts-seg) !important;
  height: var(--cv2-ts-seg) !important;
  min-height: var(--cv2-ts-seg) !important;
  max-height: var(--cv2-ts-seg) !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: transparent !important;
  box-shadow: none !important;
  color: rgba(100, 116, 139, 0.7) !important;
  cursor: pointer !important;
  pointer-events: auto !important;
  opacity: 1 !important;
  transform: none !important;
  transition: color 0.2s ease, transform 0.3s var(--cv2-ts-ease) !important;
}

/* Hostkur ikon seti */
html body .cv2-theme-switch.cv2-theme-switch--icons .cv2-theme-switch__opt i.hki-stroke {
  font-size: 12px !important;
  line-height: 1 !important;
  display: block !important;
  pointer-events: none !important;
  transition: transform 0.35s var(--cv2-ts-ease), opacity 0.2s ease !important;
}

html body .cv2-theme-switch.cv2-theme-switch--icons .cv2-theme-switch__opt svg {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  width: 14px !important;
  height: 14px !important;
  overflow: visible !important;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 2 !important;
  pointer-events: none !important;
}

html body .cv2-theme-switch.cv2-theme-switch--icons .cv2-theme-switch__opt:hover {
  color: rgba(51, 65, 85, 0.95) !important;
}
html body .cv2-theme-switch.cv2-theme-switch--icons .cv2-theme-switch__opt:hover i.hki-stroke,
html body .cv2-theme-switch.cv2-theme-switch--icons .cv2-theme-switch__opt:hover svg {
  transform: scale(1.12) !important;
}
html[data-theme="dark"] body .cv2-theme-switch.cv2-theme-switch--icons .cv2-theme-switch__opt:hover {
  color: rgba(241, 245, 249, 0.95) !important;
}
html body .cv2-theme-switch.cv2-theme-switch--icons .cv2-theme-switch__opt:active i.hki-stroke,
html body .cv2-theme-switch.cv2-theme-switch--icons .cv2-theme-switch__opt:active svg {
  transform: scale(0.9) !important;
}

/* Aktif segment ikonu — pill üzerinde primary renk */
html[data-theme-preference="light"] body .cv2-theme-switch.cv2-theme-switch--icons .cv2-theme-switch__opt--light,
html[data-theme-preference="system"] body .cv2-theme-switch.cv2-theme-switch--icons .cv2-theme-switch__opt--system,
html[data-theme-preference="dark"] body .cv2-theme-switch.cv2-theme-switch--icons .cv2-theme-switch__opt--dark,
html[data-theme="dark"]:not([data-theme-preference]) body .cv2-theme-switch.cv2-theme-switch--icons .cv2-theme-switch__opt--dark {
  color: var(--CoreV2-primary, var(--cv2-primary, #2563eb)) !important;
  background: transparent !important;
}
html[data-theme-preference="light"] body .cv2-theme-switch.cv2-theme-switch--icons .cv2-theme-switch__opt--light i.hki-stroke,
html[data-theme-preference="system"] body .cv2-theme-switch.cv2-theme-switch--icons .cv2-theme-switch__opt--system i.hki-stroke,
html[data-theme-preference="dark"] body .cv2-theme-switch.cv2-theme-switch--icons .cv2-theme-switch__opt--dark i.hki-stroke,
html[data-theme="dark"]:not([data-theme-preference]) body .cv2-theme-switch.cv2-theme-switch--icons .cv2-theme-switch__opt--dark i.hki-stroke {
  transform: scale(1.06) !important;
}

/* Knob / metin — kullanılmıyor */
html body .cv2-theme-switch.cv2-theme-switch--icons .cv2-theme-switch__knob,
html body .cv2-theme-switch.cv2-theme-switch--icons .cv2-theme-pill__thumb,
html body .cv2-theme-switch.cv2-theme-switch--icons .cv2-theme-switch__txt {
  display: none !important;
}

/* Odak halkası */
html body .cv2-theme-switch.cv2-theme-switch--icons .cv2-theme-switch__opt:focus-visible {
  outline: 2px solid rgba(var(--CoreV2-primary-rgb, 37, 99, 235), 0.55) !important;
  outline-offset: 2px !important;
  box-shadow: none !important;
}

@media (prefers-reduced-motion: reduce) {
  html body .cv2-theme-switch.cv2-theme-switch--icons .cv2-theme-switch__thumb { transition: none !important; }
}


/* ---------- 2) ÜST BAR — kompakt piyasa şeridi ---------- */

.CoreV2-topbar {
  --cv2-topbar-ink: rgba(255, 255, 255, 0.96);
  --cv2-topbar-muted: rgba(255, 255, 255, 0.72);
  --cv2-topbar-faint: rgba(255, 255, 255, 0.5);
  --cv2-topbar-line: rgba(255, 255, 255, 0.16);
  --cv2-topbar-surface: rgba(255, 255, 255, 0.06);
  position: relative;
  width: 100%;
  min-height: 46px;
  margin: 0 !important;
  padding: 0 !important;
  top: 0 !important;
  overflow: visible;
  opacity: 1;
  pointer-events: auto;
  background: var(--cv2-panel,var(--CoreV2-panel,var(--CoreV2-secondary))) !important;
  border-bottom: 1px solid var(--cv2-topbar-line);
  box-shadow: none !important;
  color: var(--cv2-topbar-muted);
  font-size: 12px;
}

html[data-theme="dark"] .CoreV2-topbar {
  --cv2-topbar-ink: rgba(255, 255, 255, 0.96);
  --cv2-topbar-muted: rgba(255, 255, 255, 0.68);
  --cv2-topbar-faint: rgba(255, 255, 255, 0.46);
  --cv2-topbar-line: rgba(255, 255, 255, 0.16);
  --cv2-topbar-surface: rgba(255, 255, 255, 0.06);
  background: var(--cv2-panel,var(--CoreV2-panel,var(--CoreV2-secondary))) !important;
}

.CoreV2-topbar .CoreV2-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 18px;
  min-height: 46px;
  margin-inline: auto;
  padding-top: 3px;
  padding-bottom: 3px;
}

.CoreV2-topbar-left,
.CoreV2-topbar-right {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
  min-height: 36px;
  padding: 2px;
  border: 1px dashed var(--cv2-topbar-line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--cv2-topbar-surface) 78%, transparent);
  backdrop-filter: saturate(115%);
  box-shadow: none !important;
}

.CoreV2-topbar-left {
  flex: 0 1 auto;
  overflow: hidden;
}

.CoreV2-topbar-right {
  flex: 0 0 auto;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.CoreV2-topbar-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--cv2-topbar-muted);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
}

.CoreV2-topbar-link:hover {
  color: var(--cv2-topbar-ink);
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(var(--CoreV2-primary-rgb, 37, 99, 235), 0.38);
  text-decoration: none;
}

.CoreV2-topbar-link:focus-visible,
.CoreV2-social-box:focus-visible,
.CoreV2-fx-btn:focus-visible,
.CoreV2-topbar .CoreV2-lang-select:focus-visible {
  outline: 2px solid rgba(var(--CoreV2-primary-rgb, 37, 99, 235), 0.62);
  outline-offset: 2px;
}

.CoreV2-topbar-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: var(--cv2-topbar-faint);
  opacity: 1;
  transition: color 0.16s ease;
}

.CoreV2-topbar-link:hover .CoreV2-topbar-icon {
  color: var(--CoreV2-primary, var(--cv2-primary));
}

.CoreV2-topbar-divider {
  width: 1px;
  height: 12px;
  margin: 0 3px;
  flex-shrink: 0;
  background: var(--cv2-topbar-line);
}

.CoreV2-social-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--cv2-topbar-faint);
  background: transparent;
  transition: color 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
}

.CoreV2-social-box svg { width: 14px; height: 14px; display: block; }
.CoreV2-social-box i { font-size: 14px; line-height: 1; }

.CoreV2-social-box:hover {
  color: var(--cv2-topbar-ink);
  background: var(--cv2-topbar-surface);
  border-color: var(--cv2-topbar-line);
}

.CoreV2-fx {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 32px;
  margin-left: 3px;
  padding: 3px 4px;
  border: 1px dashed var(--cv2-topbar-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  box-shadow: none !important;
}

.CoreV2-fx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex: 0 0 auto;
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--cv2-topbar-faint);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.CoreV2-fx-btn:hover {
  color: var(--cv2-topbar-ink);
  background: rgba(255, 255, 255, 0.075);
  border-color: rgba(255, 255, 255, 0.12);
}

.CoreV2-fx-btn.active,
.CoreV2-fx-btn.active:hover {
  position: relative;
  background: var(--CoreV2-primary, var(--cv2-primary, #2563eb));
  border-color: var(--CoreV2-primary, var(--cv2-primary, #2563eb));
  color: #ffffff;
  box-shadow: none !important;
}

.CoreV2-fx-btn.active::after {
  display: none !important;
  content: none !important;
}

.CoreV2-fx-btn[data-trend="up"] .fx-rate-m::before,
.CoreV2-fx-btn[data-trend="down"] .fx-rate-m::before,
.CoreV2-fx-btn[data-trend="flat"] .fx-rate-m::before {
  display: inline-block;
  margin-right: 3px;
  font-size: 8px;
  line-height: 1;
}

.CoreV2-fx-btn[data-trend="up"] .fx-rate-m::before { content: "▲"; color: color-mix(in srgb, var(--cv2-topbar-ink) 76%, transparent); }
.CoreV2-fx-btn[data-trend="down"] .fx-rate-m::before { content: "▼"; color: color-mix(in srgb, var(--cv2-topbar-ink) 76%, transparent); }
.CoreV2-fx-btn[data-trend="flat"] .fx-rate-m::before { content: "•"; color: var(--cv2-topbar-faint); }

.CoreV2-fx-btn span,
.CoreV2-fx-btn .fx-rate-m {
  display: inline;
  min-width: 0;
  color: inherit;
  font-size: 10px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  opacity: 0.78;
}

.CoreV2-topbar .CoreV2-selector.CoreV2-lang-select {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  margin-left: 3px;
  padding: 3px 12px 3px 6px;
  border: 1px dashed var(--cv2-topbar-line);
  border-radius: 999px;
  background: var(--cv2-topbar-surface);
  color: var(--cv2-topbar-muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
}

.CoreV2-topbar .CoreV2-selector.CoreV2-lang-select:hover {
  color: var(--cv2-topbar-ink);
  background: rgba(255, 255, 255, 0.075);
  border-color: rgba(var(--CoreV2-primary-rgb, 37, 99, 235), 0.36);
}

.CoreV2-topbar .CoreV2-selector-arrow {
  width: 12px;
  height: 12px;
  opacity: 0.55;
}

.CoreV2-topbar #theme-switcher {
  margin: 0 2px 0 3px;
  color: var(--cv2-topbar-ink) !important;
}

.CoreV2-topbar #theme-switcher:hover {
  background: var(--cv2-topbar-surface) !important;
}

@media screen and (max-width: 1180px) {
  .CoreV2-topbar .CoreV2-container { gap: 10px; }
  .CoreV2-topbar-link { padding-inline: 10px; }
  .CoreV2-fx-btn .fx-rate-m { display: none; }
}

@media screen and (max-width: 1050px) {
  .CoreV2-topbar-left .CoreV2-topbar-link:nth-of-type(2),
  .CoreV2-topbar-left .CoreV2-topbar-link:nth-of-type(5) { display: none; }
  .CoreV2-topbar-left .CoreV2-topbar-divider:nth-of-type(2),
  .CoreV2-topbar-left .CoreV2-topbar-divider:last-of-type { display: none; }
}

@media screen and (max-width: 991px) {
  .CoreV2-topbar { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .CoreV2-topbar *,
  .CoreV2-topbar *::before,
  .CoreV2-topbar *::after { transition: none !important; }
}
