.main-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dark-theme .main-header {
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.main-header.scrolled {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
}

.dark-theme .main-header.scrolled {
  background: rgba(15, 23, 42, 0.98);
  box-shadow: var(--shadow-dark);
}

.main-header.hidden {
  transform: translateY(-100%);
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem;
}

.nav-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  transition: height 0.3s ease;
}

.main-header.scrolled .nav-content {
  height: 65px;
}

.logo-section {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  transition: var(--transition);
  position: relative;
}

.logo-link:hover {
  transform: translateY(-1px);
}

.logo-image {
  width: 45px;
  height: 45px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid var(--primary-color);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  box-shadow: var(--glow);
}

.logo-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 7px;
}

.dark-theme .logo-image {
  background: var(--card-dark);
}

.main-header.scrolled .logo-image {
  width: 40px;
  height: 40px;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.logo-primary {
  font-size: 1.3rem;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--primary-light)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.3px;
}

.main-header.scrolled .logo-primary {
  font-size: 1.2rem;
}

.dark-theme .logo-primary {
  background: linear-gradient(135deg, var(--primary-light), #94b5ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-secondary {
  font-size: 0.8rem;
  color: #4b5563;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.dark-theme .logo-secondary {
  color: #cbd5e1;
}

.logo-compact {
  display: none;
  font-weight: 800;
  font-size: 1rem;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--primary-light)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.3px;
}

.nav-menu {
  display: flex;
  align-items: center;
}

.nav-links {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 1.5rem;
}

.nav-link {
  text-decoration: none;
  color: #4b5563;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.3rem 0;
  position: relative;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  display: flex;
  align-items: center;
  gap: 5px;
}

.dark-theme .nav-link {
  color: #cbd5e1;
}

.nav-link::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--primary-light)
  );
  transition: width 0.3s ease;
}

.nav-link:hover {
  color: var(--primary-color);
}

.nav-link:hover::before,
.nav-link.active::before {
  width: 100%;
}

.nav-link.active {
  color: var(--primary-color);
}

.nav-link i {
  font-size: 0.85rem;
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.language-selector {
  position: relative;
}

.language-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(59, 130, 246, 0.1);
  border: none;
  border-radius: 6px;
  color: var(--primary-color);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.dark-theme .language-btn {
  background: rgba(148, 181, 255, 0.1);
  color: #94b5ff;
}

.language-btn:hover {
  background: rgba(59, 130, 246, 0.2);
  transform: translateY(-1px);
}

.language-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  background: var(--card-light);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 6px;
  min-width: 140px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: var(--transition);
  z-index: 1001;
}

.dark-theme .language-dropdown {
  background: var(--card-dark);
  box-shadow: var(--shadow-dark);
}

.language-selector.active .language-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
}

.lang-option:hover {
  background: rgba(59, 130, 246, 0.1);
}

.lang-option.active {
  background: rgba(59, 130, 246, 0.15);
  color: var(--primary-color);
}

.flag {
  font-size: 1.1rem;
}

.lang-name {
  font-weight: 500;
  font-size: 0.9rem;
}

.theme-toggle {
  width: 45px;
  height: 45px;
  border: none;
  border-radius: 10px;
  background: rgba(59, 130, 246, 0.1);
  color: var(--primary-color);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dark-theme .theme-toggle {
  background: rgba(148, 181, 255, 0.1);
  color: #94b5ff;
}

.theme-toggle:hover {
  background: rgba(59, 130, 246, 0.2);
  transform: translateY(-1px);
}

.theme-toggle i {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: var(--transition);
  font-size: 1.1rem;
}

.theme-toggle .lni-moon {
  opacity: 0;
  transform: translate(-50%, 20px);
  color: #1e293b;
}

.dark-theme .theme-toggle .lni-moon {
  opacity: 1;
  transform: translate(-50%, -50%);
  color: #f8fafc;
}

.mobile-toggle {
  display: none;
  flex-direction: column;
  width: 38px;
  height: 38px;
  background: rgba(59, 130, 246, 0.1);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  gap: 5px;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.mobile-toggle span {
  width: 22px;
  height: 2px;
  background: var(--primary-color);
  border-radius: 2px;
  transition: var(--transition);
  transform-origin: center;
}

.dark-theme .mobile-toggle span {
  background: #94b5ff;
}

.mobile-toggle:hover {
  background: rgba(59, 130, 246, 0.2);
  transform: translateY(-1px);
}

@media (max-width: 1024px) {
  .logo-text {
    display: none !important;
  }

  .logo-compact {
    display: block !important;
  }
}

@media (max-width: 1024px) {
  .nav-container {
    padding: 0 1rem;
  }

  .nav-content {
    height: 65px;
  }

  .logo-image {
    width: 40px;
    height: 40px;
  }

  .mobile-toggle {
    display: flex;
  }

  .nav-menu {
    position: fixed;
    top: 65px;
    left: 0;
    width: 100%;
    height: auto;
    max-height: calc(100vh - 65px);
    background: var(--card-light);
    box-shadow: var(--shadow);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    overflow-y: auto;
    display: block;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
  }

  .dark-theme .nav-menu {
    background: var(--card-dark);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .nav-menu.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-links {
    flex-direction: column;
    padding: 0.8rem 1rem;
    gap: 0;
    width: 100%;
  }

  .nav-links li {
    width: 100%;
  }

  .nav-link {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    font-size: 1rem;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
  }

  .dark-theme .nav-link {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .nav-link:last-child {
    border-bottom: none;
  }

  .nav-link i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
  }

  .mobile-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .mobile-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .mobile-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  .theme-toggle,
  .mobile-toggle {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
  }

  .language-btn {
    padding: 6px 10px;
    min-width: 40px;
    min-height: 40px;
    justify-content: center;
  }

  .language-btn span {
    display: none;
  }
}

@media (max-width: 768px) {
  .nav-container {
    padding: 0 0.8rem;
  }

  .nav-content {
    height: 60px;
  }

  .nav-menu {
    top: 60px;
    max-height: calc(100vh - 60px);
  }

  .logo-compact {
    font-size: 0.9rem;
  }

  .logo-image {
    width: 36px;
    height: 36px;
  }

  .nav-links {
    padding: 0.6rem 0.8rem;
  }

  .nav-link {
    padding: 0.7rem 0.8rem;
    font-size: 0.95rem;
  }
}

@media (max-width: 480px) {
  .nav-container {
    padding: 0 0.6rem;
  }

  .logo-compact {
    font-size: 0.85rem;
  }

  .logo-image {
    width: 34px;
    height: 34px;
  }

  .nav-controls {
    gap: 0.5rem;
  }

  .theme-toggle,
  .mobile-toggle {
    width: 36px;
    height: 36px;
  }

  .language-btn {
    padding: 5px 8px;
    min-width: 36px;
    min-height: 36px;
  }

  .nav-menu {
    max-height: calc(100vh - 60px);
  }

  .nav-links {
    padding: 0.5rem 0.6rem;
  }

  .nav-link {
    padding: 0.6rem 0.6rem;
    font-size: 0.9rem;
    gap: 8px;
  }

  .nav-link i {
    font-size: 0.9rem;
    width: 18px;
  }
}

@media (max-width: 360px) {
  .logo-compact {
    font-size: 0.8rem;
  }

  .logo-image {
    width: 32px;
    height: 32px;
  }

  .theme-toggle,
  .mobile-toggle {
    width: 34px;
    height: 34px;
  }

  .language-btn {
    min-width: 34px;
    min-height: 34px;
  }

  .nav-links {
    padding: 0.4rem 0.5rem;
  }

  .nav-link {
    padding: 0.5rem 0.5rem;
    font-size: 0.85rem;
  }
}

.rtl .nav-container {
  direction: rtl;
}

.rtl .logo-link {
  flex-direction: row;
}

.rtl .nav-links {
  padding-right: 0;
}

.rtl .nav-links li {
  text-align: right;
}

.rtl .nav-link {
  justify-content: flex-start;
  flex-direction: row-reverse;
}

.rtl .nav-link::before {
  left: auto;
  right: 0;
}

.rtl .nav-controls {
  flex-direction: row-reverse;
}

.rtl .language-selector .language-dropdown {
  right: auto;
  left: 0;
}

.rtl .language-btn {
  flex-direction: row-reverse;
}

.rtl .lang-option {
  flex-direction: row-reverse;
  justify-content: flex-start;
}

@media (max-width: 1024px) {
  .rtl .nav-link {
    justify-content: flex-end;
    text-align: right;
  }
}

.nav-menu {
  scroll-behavior: smooth;
}
