/* Shared Navigation Styles for APGI Website */
.main-nav {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

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

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: nowrap;
  overflow: visible;
  padding: 0;
  flex: 1;
  justify-content: flex-start;
}

.nav-link {
  text-decoration: none;
  color: #0f172a;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all 0.3s ease;
  position: relative;
  font-size: 0.9rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-link.nav-brand {
  font-weight: 600;
  font-size: 0.95rem;
  color: #3b82f6;
  background: rgba(59, 130, 246, 0.1);
  margin-right: 8px;
  display: inline-flex;
  align-items: center;
}

.nav-link.nav-brand img {
  height: 22px;
  width: auto;
  display: block;
}

.nav-link:hover {
  background: #2563eb;
  color: white;
  transform: translateY(-1px);
}

.nav-link.active {
  background: #2563eb;
  color: white;
}

.nav-link:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Dropdown Navigation Styles */
.nav-dropdown {
  position: relative;
  display: inline-block;
}

.nav-dropdown-btn {
  background: transparent;
  border: none;
  color: #0f172a;
  font-weight: 500;
  font-size: 0.85rem;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-dropdown-btn:hover,
.nav-dropdown-btn:focus {
  background: #2563eb;
  color: white;
  transform: translateY(-1px);
  outline: none;
}

.dropdown-arrow {
  font-size: 0.7rem;
  transition: transform 0.2s ease;
}

.nav-dropdown.active .dropdown-arrow {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow:
    0 10px 25px -5px rgba(0, 0, 0, 0.15),
    0 8px 10px -6px rgba(0, 0, 0, 0.1);
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  backdrop-filter: blur(20px);
  margin-top: 8px;
}

.nav-dropdown.active .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-link {
  display: block;
  padding: 12px 16px;
  color: #0f172a;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  border-bottom: 1px solid #f1f5f9;
}

.dropdown-link:first-child {
  border-radius: 8px 8px 0 0;
}

.dropdown-link:last-child {
  border-bottom: none;
  border-radius: 0 0 8px 8px;
}

.dropdown-link:hover,
.dropdown-link:focus {
  color: #3b82f6;
  background: rgba(59, 130, 246, 0.1);
  transform: translateX(4px);
  outline: none;
}

.theme-toggle {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #3b82f6;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: 8px;
}

.theme-toggle:hover {
  background: #2563eb;
  color: white;
  transform: translateY(-1px);
  border-color: #3b82f6;
}

.theme-toggle:focus {
  outline: 2px solid #0f172a;
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: #2563eb;
  color: white;
  padding: 8px;
  text-decoration: none;
  border-radius: 4px;
  z-index: 1001;
}

.skip-link:focus {
  top: 6px;
}

/* Dark theme support */
[data-theme="dark"] .main-nav {
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 1px solid #334155;
}

[data-theme="dark"] .nav-link {
  color: #f1f5f9;
}

[data-theme="dark"] .nav-link:hover,
[data-theme="dark"] .nav-link.active {
  background: #2563eb;
}

[data-theme="dark"] .nav-dropdown-btn {
  color: #f1f5f9;
}

[data-theme="dark"] .nav-dropdown-btn:hover,
[data-theme="dark"] .nav-dropdown-btn:focus {
  background: #2563eb;
  color: white;
}

[data-theme="dark"] .dropdown-menu {
  background: #0f172a;
  border-color: #334155;
}

[data-theme="dark"] .dropdown-link {
  color: #f1f5f9;
  border-bottom-color: #1e293b;
}

[data-theme="dark"] .dropdown-link:hover,
[data-theme="dark"] .dropdown-link:focus {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

[data-theme="dark"] .theme-toggle {
  background: #2563eb;
}

[data-theme="dark"] .theme-toggle:hover {
  background: #60a5fa;
}

/* Mobile Navigation */
@media (max-width: 1024px) {
  .nav-container {
    padding: 10px 15px;
    height: auto;
    min-height: 64px;
  }

  .nav-links {
    gap: 1px;
  }

  .nav-link {
    font-size: 0.8rem;
    padding: 5px 8px;
  }

  .nav-link.nav-brand {
    font-size: 0.85rem;
    margin-right: 6px;
  }

  .nav-link.nav-brand img {
    height: 18px;
  }

  .nav-dropdown-btn {
    font-size: 0.8rem;
    padding: 5px 8px;
  }

  .dropdown-arrow {
    font-size: 0.6rem;
  }

  .theme-toggle {
    padding: 5px 8px;
    font-size: 0.75rem;
    gap: 4px;
    margin-left: 6px;
  }

  .theme-text {
    display: none;
  }
}

@media (max-width: 768px) {
  .nav-container {
    padding: 8px 12px;
  }

  .nav-links {
    gap: 0;
  }

  .nav-link {
    font-size: 0.75rem;
    padding: 4px 6px;
  }

  .nav-link.nav-brand {
    font-size: 0.8rem;
    margin-right: 4px;
  }

  .nav-link.nav-brand img {
    height: 16px;
  }

  .nav-dropdown-btn {
    font-size: 0.75rem;
    padding: 4px 6px;
  }

  .dropdown-menu {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    border-radius: 0 0 12px 12px;
    min-width: auto;
    margin-top: 0;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  }

  .dropdown-link {
    padding: 14px 20px;
    font-size: 0.9rem;
  }

  .theme-toggle {
    padding: 4px 6px;
    font-size: 0.7rem;
    gap: 3px;
    margin-left: 4px;
  }

  .dropdown-arrow {
    font-size: 0.55rem;
  }
}
