.glassy-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  padding: 5px 0;
  transition: all 0.3s ease;
  /* Transparent by default */
  background: transparent;
  border-bottom: 1px solid transparent;
  box-shadow: none;
}

/* Glass effect on hover or when scrolled */
.glassy-header:hover,
.glassy-header.scrolled {
  backdrop-filter: blur(10px);
  background: var(--bg-overlay);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  transition-duration: 1000ms;
  
}

/* Glass effect on hover or when scrolled for dark theme */
.dark-theme .glassy-header:hover,
.dark-theme .glassy-header.scrolled {
  backdrop-filter: blur(10px);
  background: rgba(30, 30, 30, 0.3);
  border-bottom: 1px solid rgba(80, 80, 80, 0.4);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
  
}

/* Glass effect on hover or when scrolled for buttons */
.glassy-header:hover .glassy-button,
.glassy-header.scrolled .glassy-button {
  backdrop-filter: blur(5px);
  border: 1px solid var(--glass-border);
  box-shadow: none;
  
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Desktop layout adjustments */
.menu-button-container {
  display: none;
}



.logo {
  margin: 0;
  transition: all 0.3s ease;
  width: 75px;
  height: 75px;
  fill: var(--text-color);
}

/* Keep logo visible even when header is transparent */
.glassy-header:hover .logo h1,
.glassy-header.scrolled .logo h1 {
  color: white;
}

.nav {
  display: block;
}

@media (max-width: 768px) {
  .nav {
    display: none;
  }
}

.nav-list {
  display: flex;
  list-style: none;
  gap: 15px;
}

.nav-item {
  position: relative;
}

.glassy-link {
  display: block;
  text-decoration: none;
  padding: 12px 25px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  color: var(--text-color);
  font-family: 'Tajawal', sans-serif;
  font-size: 1.1rem;
  font-weight: 500;
  /* Transparent by default */
  backdrop-filter: blur(0px);
  background: transparent;
  border-radius: 25px;
  border: 1px solid transparent;
  box-shadow: none;
}

.glassy-link:hover {
  color: var(--text-color);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15);

}

.glassy-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
  z-index: -1;
}

.glassy-link:hover::before {
  transform: translateX(100%);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 15px;
}

.theme-icon svg {
  fill: var(--text-color);
  width: 32px;
  height: 32px;
}

/* Theme toggle icon visibility */
.sun-icon {
  display: block;
}

.moon-icon {
  display: none;
}

.dark-theme .sun-icon {
  display: none;
}

.dark-theme .moon-icon {
  display: block;
}

.theme-toggle {
  display: flex;
  cursor: pointer;
  transition: all 0.3s ease;
  /* Transparent by default */
  background: transparent;
  box-shadow: none;
}

/* Only the theme toggle button is visible on large screens */
.theme-toggle {
  display: flex;
}

/* The menu toggle button is hidden on large screens */
.menu-toggle {
  display: none;
}

.glassy-button {
  flex-direction: column;
  cursor: pointer;
  padding: 12px;
  backdrop-filter: blur(0px);
  background: transparent;
  border: 1px solid transparent;
  box-shadow: none;
  color: var(--text-color);
}

.glassy-button:focus {
  outline: none !important;
  /* Ensure no focus outline appears */
}

.glassy-button span {
  width: 25px;
  height: 3px;
  background: white;
  margin: 3px 0;
  transition: 0.3s;
  border-radius: 2px;
}

.menu-toggle span {
  background: var(--text-color);
}

@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
  }
}

@media (max-width: 768px) {
  .nav-list {
    position: fixed;
    top: 75px;
    left: -110%;
    width: 100vw;
    height: 100vh;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 50px;
    gap: 20px;
    transition: left 0.3s ease;
    z-index: 101;
  }

  .nav-list.active {
    left: 0;
    backdrop-filter: blur(10px);
    background: var(--bg-overlay);
  }

  .glassy-link {
    padding: 15px 40px;
    font-size: 1.2rem;
  }

  /* Both buttons are visible on mobile */
  .theme-toggle {
    display: flex;
  }

  .menu-toggle {
    display: flex;
  }

  .glassy-button.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
  }

  .glassy-button.active span:nth-child(2) {
    opacity: 0;
  }

  .glassy-button.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
  }
}

/* Mobile layout adjustments */
@media (max-width: 768px) {
  .header-container {
    position: relative;
    justify-content: space-between;
  }

  .menu-button-container {
    display: block;
    order: 1;
    z-index: 102;
  }

  .logo-container {
    order: 2;
    flex: 1;
    display: flex;
    justify-content: center;
    position: absolute;
    left: 0;
    right: 0;
    z-index: 100;
  }

  .nav {
    display: none;
  }

  .header-controls {
    order: 3;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 102;
  }


}

/* More specific RTL adjustments for Arabic */
.glassy-header[dir="rtl"] .menu-button-container {
  order: 1;
}

.glassy-header[dir="rtl"] .header-controls {
  order: 3;
}
