.modern-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modern-header.scrolled {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.modern-nav {
  padding: 20px 0;
  transition: padding 0.3s ease;
}

.modern-header.scrolled .modern-nav {
  padding: 12px 0;
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

.nav-brand {
  font-size: 24px;
  font-weight: 900;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  text-decoration: none;
  position: relative;
  z-index: 10;
}

.brand-text {
  background: linear-gradient(135deg, #06b6d4 0%, #0ea5e9 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: all 0.3s ease;
}

.nav-brand:hover .brand-text {
  background: linear-gradient(135deg, #0ea5e9 0%, #14b8a6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 60px;
  flex: 1;
  justify-content: flex-end;
}

.nav-links {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 8px;
}

.nav-link {
  color: var(--color-text);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.nav-link::before {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 16px;
  right: 16px;
  height: 2px;
  background: linear-gradient(135deg, #06b6d4 0%, #0ea5e9 100%);
  transform: scaleX(0);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover {
  color: var(--color-primary);
  background: rgba(6, 182, 212, 0.1);
}

.nav-link:hover::before {
  transform: scaleX(1);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
  text-decoration: none;
  border-radius: 10px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 18px;
  background: transparent;
  border: 1px solid transparent;
}

.nav-icon:hover {
  background: rgba(6, 182, 212, 0.1);
  border-color: var(--glass-border);
  color: var(--color-primary);
  transform: translateY(-2px);
}

.theme-toggle-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--color-text);
  font-size: 16px;
  position: relative;
  overflow: hidden;
}

.theme-toggle-btn:hover {
  background: rgba(6, 182, 212, 0.1);
  border-color: var(--color-primary);
  transform: translateY(-2px);
}

.theme-toggle-btn i {
  transition: all 0.3s ease;
}

[data-theme="dark"] .theme-icon-light {
  display: none;
}

[data-theme="dark"] .theme-icon-dark {
  display: block;
  color: #fbbf24;
}

[data-theme="light"] .theme-icon-light {
  display: block;
  color: #f59e0b;
}

[data-theme="light"] .theme-icon-dark {
  display: none;
}

.btn-cv {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: linear-gradient(135deg, #06b6d4 0%, #0ea5e9 100%);
  color: white;
  text-decoration: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
  position: relative;
  overflow: hidden;
}

.btn-cv::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.btn-cv:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(6, 182, 212, 0.4);
  color: white;
}

.btn-cv:hover::before {
  left: 100%;
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  position: relative;
  z-index: 10;
  transition: all 0.3s ease;
  overflow: visible;
}

.hamburger {
  position: relative;
  display: inline-block;
  width: 20px;
  height: 2px;
  background: var(--color-text);
  transition: all 0.3s ease;
}

.hamburger::before,
.hamburger::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  transform-origin: center;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  transition: all 0.3s ease;
}

.hamburger::before {
  top: -7px;
}

.hamburger::after {
  top: 7px;
}

.nav-toggle.active .hamburger {
  background: transparent;
}

.nav-toggle.active .hamburger::before {
  transform: rotate(45deg);
  top: 0;
}

.nav-toggle.active .hamburger::after {
  transform: rotate(-45deg);
  top: 0;
}


@media (max-width: 1024px) {
  .nav-container {
    padding: 0 24px;
  }

  .nav-menu {
    gap: 40px;
  }

  .nav-links {
    gap: 4px;
  }
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 400px;
    height: 100vh;
    background: #0f172a; /* Solid dark background fallback */
    background: var(--color-background); /* Solid theme background */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-left: 1px solid var(--glass-border);
    flex-direction: column;
    justify-content: flex-start;
    padding: 100px 40px 40px;
    gap: 40px;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -10px 0 50px rgba(0, 0, 0, 0.3);
  }

  .nav-menu.active {
    right: 0;
  }

  .nav-links {
    flex-direction: column;
    width: 100%;
    gap: 8px;
  }

  .nav-link {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
  }

  .nav-actions {
    width: 100%;
    flex-direction: column;
    gap: 12px;
  }

  .nav-icon,
  .theme-toggle-btn,
  .btn-cv {
    width: 100%;
    justify-content: center;
  }

  .btn-cv {
    padding: 14px 24px;
    font-size: 16px;
  }
}
