/* Scrollbar genişliği */
::-webkit-scrollbar {
  width: 8px;
  /* İnce scrollbar */
}

/* Scrollbar arka planı */
::-webkit-scrollbar-track {
  background: #f4f1ea;
  /* Açık kahverengi arka plan */
  border-radius: 10px;
}

/* Scrollbar hareketli kısmı */
::-webkit-scrollbar-thumb {
  background: #6f5f2a;
  /* Kahverengi scrollbar */
  border-radius: 10px;
  transition: background 0.3s ease;
}

/* Scrollbar üzerine gelindiğinde rengi değişsin */
::-webkit-scrollbar-thumb:hover {
  background: #5a4c20;
  /* Daha koyu kahverengi */
}

/* --- */

:root {
  --nhb: #ffffff;
}

.navbar ul {
  list-style: none;
  display: flex;
}

.navbar ul li {
  position: relative;
  margin: 0 15px;
}

.navbar ul li a {
  text-decoration: none;
  color: white;
  font-size: 18px;
  padding: 10px 15px;
  position: relative;
  display: inline-block;
  overflow: hidden;
  transition: background 0.5s ease-in-out;
  z-index: 1;
  /* Yazının önde kalmasını sağladık */
}

/* Arka Plan Geçişi (Soldan Sağa, Yazının Arkasında) */
.navbar ul li a::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg,
      rgba(133, 106, 17, 0.3) 50%,
      rgba(230, 185, 4, 0.8) 100%);
  transition: left 0.5s ease-in-out;
  transition-delay: 0.2s;
  z-index: -1;
  /* Arka planın yazının arkasında kalmasını sağladık */
}

/* Üst Çizgi */
.navbar ul li a::after {
  content: "";
  position: absolute;
  width: 0%;
  height: 2px;
  background: var(--nhb);
  top: 0;
  left: 50%;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    left 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Alt Çizgi */
.navbar ul li a span.bottom-border {
  content: "";
  position: absolute;
  width: 0%;
  height: 2px;
  background: var(--nhb);
  bottom: 0;
  left: 50%;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    left 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Sol Çizgi */
.navbar ul li a span.left-border {
  content: "";
  position: absolute;
  height: 0%;
  width: 2px;
  background: var(--nhb);
  left: 0;
  top: 50%;
  transition: height 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    top 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Sağ Çizgi */
.navbar ul li a span.right-border {
  content: "";
  position: absolute;
  height: 0%;
  width: 2px;
  background: var(--nhb);
  right: 0;
  top: 50%;
  transition: height 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    top 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hover Efektleri */
.navbar ul li a:hover::before {
  animation: backgroundSlide 0.5s ease-out forwards;
}

.navbar ul li a:hover::after {
  width: 100%;
  left: 0;
}

.navbar ul li a:hover span.bottom-border {
  width: 100%;
  left: 0;
}

.navbar ul li a:hover span.left-border {
  height: 100%;
  top: 0;
}

.navbar ul li a:hover span.right-border {
  height: 100%;
  top: 0;
}

@keyframes backgroundSlide {
  0% {
    left: -100%;
    opacity: 1;
  }

  100% {
    left: 100%;
    opacity: 0;
  }
}

/* ---- */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  transition: background 0.3s ease-in-out, backdrop-filter 0.5s ease-in-out;
}

nav a,
nav #menuButton {
  color: white;
}

nav li {
  border-bottom: 2px solid transparent;
}

.scrolled {
  background: rgba(255, 255, 255, 0.4);
  /* Hafif şeffaf beyaz */
  backdrop-filter: blur(10px);
  /* Blurlu efekt */
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.navbar ul li,
.navbar #menuButton {
  transition: color 0.3s ease-in-out;
}

.scrolled ul li,
.scrolled #menuButton,
.scrolled a {
  color: black !important;
}

.mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 75%;
  height: 100vh;
  background: white;
  box-shadow: -2px 0 6px rgba(0, 0, 0, 0.1);
  transition: right 0.3s ease-in-out;
}

.mobile-menu.open {
  right: 0;
}

.mobile-menu a {
  color: black;
  font-weight: bold;
}

/* responsive navbar */
@media (max-width: 768px) {
  nav ul {
    display: none !important;
  }
}