[data-theme="dark"] .shiki,
[data-theme="dark"] .shiki span {
  color: var(--shiki-dark) !important;
  background-color: var(--shiki-dark-bg) !important;
  /* Optional, if you also want font styles */
  font-style: var(--shiki-dark-font-style) !important;
  font-weight: var(--shiki-dark-font-weight) !important;
  text-decoration: var(--shiki-dark-text-decoration) !important;
}

html[data-theme="light"] .term-bar {
  --term-bar-bg: #e1e4e8; /* light tema rengi */
  --copy-btn-bg: rgba(0, 0, 0, 0.6);
  --copy-btn-text: #ffffff;
}

/* Dark theme terminal bar */
html[data-theme="dark"] .term-bar {
  --term-bar-bg: #2c2c2c; /* dark tema rengi */
  --copy-btn-bg: rgba(255, 255, 255, 0.2);
  --copy-btn-text: #ffffff;
}

html[data-theme="light"] #toc .outline-marker,
html[data-theme="light"] #toc.toc-fixed {
  --color: #333333;
  --bg-color: #bbbbbb;
}

/* Dark theme terminal bar */
html[data-theme="dark"] #toc .outline-marker,
html[data-theme="dark"] #toc.toc-fixed {
  --color: #ffffff;
  --bg-color: #5c5c5c;
}

html[data-theme="dark"] {
  /* Text Colors */
  --color-100: #ffffff; /* ana metin */
  --color-200: #cccccc; /* ikincil metin */
  --color-300: #999999; /* açıklama metni */

  /* Background Colors */
  --bg-color-100: #121212; /* ana arka plan */
  --bg-color-200: #1e1e1e; /* kart / yüzey */
  --bg-color-300: #2a2a2a; /* sınır / vurgu arka plan */
}

html[data-theme="light"] {
  /* Text Colors */
  --color-100: #1a1a1a; /* en koyu metin */
  --color-200: #4a4a4a; /* ikincil metin */
  --color-300: #7a7a7a; /* açıklama metni */

  /* Background Colors */
  --bg-color-100: #ffffff; /* ana arka plan */
  --bg-color-200: #f5f5f5; /* kart / yüzey */
  --bg-color-300: #e0e0e0; /* sınır / vurgu arka plan */
}

:root {
  --primary-color: #8400ff;
}

/* ****************** */
/* Kod blokları için stiller */
/* ****************** */

@import url('https://fonts.googleapis.com/css2?family=Cascadia+Mono:ital@0;1&display=swap');

/* Kod bloğu wrapper <pre> */
pre.shiki {
  position: relative;
  overflow-x: auto;
  scrollbar-width: thin;
  font-family: monospace;
  margin-top: 0;
  border-radius: 0 0 5px 5px;
}

code {
  font-family: "Cascadia Mono", sans-serif;
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
}

/* Overlay div sağ üstte, kod bloğu üzerinde */
.code-overlay-label {
  position: absolute;
  right: 0.5rem;
  top: 2rem;
  pointer-events: none;
  font-size: 0.75rem;
  z-index: 10;
  padding: 0;
  opacity: 1;
  transition: opacity 0.25s ease-in-out;
}

.terminal-wrapper:hover .code-overlay-label {
  opacity: 0;
}

/* Terminal bar */
.terminal-wrapper {
  position: relative;

  /* Gölge ekliyoruz */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: box-shadow 0.25s ease-in-out;
}

/* Hover ile hafif artırabiliriz */
.terminal-wrapper:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.term-bar {
  width: 100%;
  height: 1.75rem;
  background: var(--term-bar-bg);
  display: flex;
  align-items: center;
  padding-left: 0.5rem;
  border-top-left-radius: 0.5rem;
  border-top-right-radius: 0.5rem;
  position: relative;
}

.term-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.term-label > span {
	font-size: small;
	pointer-events: none;
}

/* Renkli noktalar */
.term-buttons {
  display: flex;
  gap: 0.4rem;
}

.term-buttons span {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  display: inline-block;
}

.term-bar .term-buttons span.red {
  background-color: #ff5f56 !important;
}
.term-bar .term-buttons span.yellow {
  background-color: #ffbd2e !important;
}
.term-bar .term-buttons span.green {
  background-color: #27c93f !important;
}

/* Copy buton container */
.code-copy-btn {
  position: absolute;
  top: 2rem; /* terminal bar altında */
  right: 0.25rem;
  background-color: var(--copy-btn-bg);
  color: var(--copy-btn-text);
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 0.25rem;
  cursor: pointer;
  opacity: 0;
  pointer-events: auto;
  transition: opacity 0.2s ease-in-out;
  z-index: 15; /* overlay üstünde */
}

/* Hover olunca görünür */
.terminal-wrapper:hover .code-copy-btn {
  opacity: 1;
}

/* ****************** */
/* TOC sabit sağ menü */
/* ****************** */

#toc.toc-fixed {
  position: fixed;
  top: 100px; /* header varsa altına gelsin */
  right: 40px; /* kenardan biraz boşluk */
  width: 240px;
  max-height: 80vh;
  overflow-y: auto;
  border-left: 1px solid var(--bg-color);
  padding-left: 1rem;
  backdrop-filter: blur(4px);
  z-index: 1000;
}

#toc .toc-wrapper {
  position: relative;
}

/* marker çizgisi */
#toc .outline-marker {
  position: absolute;
  left: -1rem;
  width: 2px;
  background: var(--color);
  transition: top 0.2s ease, height 0.2s ease, opacity 0.2s ease;
  pointer-events: none;
  border-radius: 1px;
}

/* başlık */
#toc .toc-title {
  font-weight: bold;
  margin-bottom: 0.5rem;
}

/* liste */
#toc ul {
  list-style: none;
  margin: 0;
  margin-top: 0.25rem;
}

#toc li {
  margin-bottom: 0.25rem;
}

#toc li ul {
  margin-left: 1rem;
}

#toc a {
  text-decoration: none;
  transition: filter 0.2s ease, color 0.2s ease;
}

#toc a:hover {
  filter: brightness(1.5);
}

/* aktif başlık vurgusu */
#toc a.active {
  filter: brightness(1.5);
}

/* Mobilde gizle */
@media (max-width: 1024px) {
  #toc.toc-fixed {
    display: none;
  }
}

/* ****************** */
/* Matematik SVG stilleri */
/* ****************** */

/* Matematik SVG stilleri */
.math_svg {
  display: block; /* SVG’yi block hâline getir */
  text-align: center; /* inline içeriğini ortala */
  margin: 1em 0; /* üst-alt boşluk */
}
.math_svg svg {
  display: inline-block; /* SVG’yi inline-block yap */
}

/* ****************** */
/* h anchor link stilleri */
/* ****************** */

.heading {
  position: relative;
}

.anchor-link {
	position: absolute;
	transform: translateX(-100%);
	text-decoration: none;
	left: 0;
	opacity: 0;
	transition: opacity 0.2s ease, color 0.2s ease, filter 0.2s ease;
}

.anchor-link::after {
	height: auto;
	width: 0.5rem;
	content: "";
  display: inline-block;
}

.heading > span.text:hover {
  filter: brightness(1.5);
}

.heading > span.text {
  transition: filter 0.2s ease;
}

.anchor-link:hover {
  filter: brightness(1.5);
}

.heading:hover .anchor-link {
  opacity: 1;
}

.vpi-sun {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2m0 16v2M4.93 4.93l1.41 1.41m11.32 11.32l1.41 1.41M2 12h2m16 0h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.41'/%3E%3C/g%3E%3C/svg%3E");
}

.vpi-moon {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M12 3a6 6 0 0 0 9 9a9 9 0 1 1-9-9'/%3E%3C/svg%3E");
}

.theme-switch {
  position: relative;
  width: 40px;
  height: 24px;
  border: 1px solid var(--color-300);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
  cursor: pointer;
  margin: 0;
  background: var(--bg-color-300) !important;
  transition: border-color 0.25s ease;
}

.theme-switch:hover {
  border-color: var(--primary-color);
}

/* Icon ortak stil */
.theme-switch .sunmoon {
  position: absolute;
  width: 18px;
  height: 18px;
  display: block;
  transition: opacity 0.4s ease, transform 0.4s ease;
  mask: var(--icon) no-repeat;
  background-color: var(--color-100) !important;
}

.theme-switch .sunmoon {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 12px;
    height: 12px;
}

/* Light theme */
[data-theme="light"] .vpi-sun {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}
[data-theme="light"] .vpi-moon {
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
}

.theme-switch .icon {
  position: relative;
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  overflow: hidden;
  background-color: var(--bg-color-100);
}

.theme-switch .slider {
  position: absolute;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  transition: transform 0.4s ease;
}

html[data-theme="dark"] .theme-switch .slider {
  transform: translate(16px);
}

/* Dark theme */
[data-theme="dark"] .vpi-sun {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}
[data-theme="dark"] .vpi-moon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}
