/* navbar.css - Fully Responsive Navigation */

/* Header Container */
.site-header {
  background: rgba(0, 0, 0, 0.95);
  border-bottom: 3px solid var(--accent, #e10600);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  position: relative;
}

/* Logo */
.logo {
  z-index: 1001;
  flex-shrink: 0;
}

.logo h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.logo h1 a {
  color: #e10600;
  text-decoration: none;
  transition: color 0.3s ease;
}

.logo h1 a:hover {
  color: #ff4500;
}

/* Navigation */
.main-nav {
  flex: 1;
  display: flex;
  justify-content: center;
}

.main-nav ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 8px;
  align-items: center;
}

.main-nav li {
  margin: 0;
}

.main-nav a {
  display: block;
  text-decoration: none;
  color: #f5f5f5;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 10px 16px;
  border-radius: 8px;
  transition: all 0.3s ease;
  position: relative;
  white-space: nowrap;
}

.main-nav a:hover {
  color: #e10600;
  background: rgba(225, 6, 0, 0.1);
  transform: translateY(-2px);
}

.main-nav a.active {
  color: #e10600;
  background: rgba(225, 6, 0, 0.15);
  font-weight: 700;
}

.main-nav a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 16px;
  right: 16px;
  height: 2px;
  background: #e10600;
}

/* Search Button */
.search-button {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 8px 16px;
  color: var(--muted, #bdbdbd);
  cursor: pointer;
  transition: all 0.3s;
  font-size: 1rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: var(--accent, #e10600);
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
  position: relative;
  flex-shrink: 0;
}

.hamburger-icon {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 28px;
  height: 24px;
  position: relative;
}

.hamburger-icon span {
  display: block;
  width: 100%;
  height: 3px;
  background: #fff;
  border-radius: 3px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center;
}

/* Hamburger Animation */
.mobile-menu-toggle.active .hamburger-icon span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.mobile-menu-toggle.active .hamburger-icon span:nth-child(2) {
  opacity: 0;
  transform: translateX(-20px);
}

.mobile-menu-toggle.active .hamburger-icon span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Container to group search and hamburger menu together */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 1001; /* Keeps it above the mobile menu overlay */
}

/* Focus styles for accessibility */
.main-nav a:focus-visible,
.search-button:focus-visible {
  outline: 2px solid #e10600;
  outline-offset: 2px;
}

.mobile-menu-toggle:focus-visible {
  outline: 2px solid #e10600;
  outline-offset: 4px;
  border-radius: 4px;
}

/* RESPONSIVE BREAKPOINTS */

/* Large tablet and below (≤ 1024px) */
@media (max-width: 1024px) {
  .main-nav ul {
    gap: 6px;
  }

  .main-nav a {
    padding: 8px 14px;
    font-size: 0.9rem;
  }
}

/* Tablet and below (≤ 968px) */
@media (max-width: 968px) {
  .header-inner {
    padding: 14px 20px;
  }

  .main-nav ul {
    gap: 4px;
  }

  .main-nav a {
    padding: 8px 12px;
    font-size: 0.85rem;
  }

  .logo h1 {
    font-size: 1.3rem;
  }

  .search-button {
    padding: 8px 12px;
    font-size: 0.9rem;
  }
}

/* Mobile (≤ 768px) */
@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: block;
  }

  .header-inner {
    padding: 12px 16px;
  }

  /* Navigation becomes full-screen overlay */
  .main-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.98);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
  }

  .main-nav.active {
    opacity: 1;
    visibility: visible;
  }

  .main-nav ul {
    flex-direction: column;
    gap: 0;
    width: 100%;
    max-width: 400px;
    padding: 20px;
  }

  .main-nav li {
    width: 100%;
    opacity: 0;
    transform: translateY(20px);
    animation: none;
  }

  /* Stagger animation for menu items */
  .main-nav.active li {
    animation: slideInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  }

  .main-nav.active li:nth-child(1) { animation-delay: 0.1s; }
  .main-nav.active li:nth-child(2) { animation-delay: 0.15s; }
  .main-nav.active li:nth-child(3) { animation-delay: 0.2s; }
  .main-nav.active li:nth-child(4) { animation-delay: 0.25s; }
  .main-nav.active li:nth-child(5) { animation-delay: 0.3s; }
  .main-nav.active li:nth-child(6) { animation-delay: 0.35s; }

  @keyframes slideInUp {
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .main-nav a {
    padding: 16px 24px;
    font-size: 1.2rem;
    text-align: center;
    border-radius: 12px;
    width: 100%;
  }

  .main-nav a.active::after {
    left: 24px;
    right: 24px;
  }

  .logo h1 {
    font-size: 1.2rem;
  }

  .search-button {
    padding: 8px 12px;
  }
}

/* Small mobile (≤ 480px) */
@media (max-width: 480px) {
  .header-inner {
    padding: 10px 12px;
    gap: 12px;
  }

  .logo h1 {
    font-size: 1rem;
    letter-spacing: 1px;
  }

  .hamburger-icon {
    width: 24px;
    height: 20px;
    gap: 4px;
  }

  .hamburger-icon span {
    height: 2.5px;
  }

  .main-nav ul {
    padding: 16px;
    max-width: 100%;
  }

  .main-nav a {
    padding: 14px 20px;
    font-size: 1.1rem;
  }

  .search-button {
    padding: 6px 10px;
    font-size: 0.85rem;
  }
}

/* Extra small devices (≤ 360px) */
@media (max-width: 360px) {
  .logo h1 {
    font-size: 0.9rem;
  }

  .main-nav a {
    padding: 12px 16px;
    font-size: 1rem;
  }

  .search-button {
    padding: 6px 8px;
  }
}

/* ADDITIONAL ENHANCEMENTS */

/* Smooth scroll behavior */
html {
  scroll-behavior: smooth;
}

/* Prevent background scroll when menu is open */
body.menu-open {
  overflow: hidden;
}

/* Touch-friendly tap highlight removal */
.main-nav a,
.mobile-menu-toggle,
.search-button {
  -webkit-tap-highlight-color: transparent;
}

/* Hover effect enhancement for desktop */
@media (hover: hover) and (pointer: fine) {
  .main-nav a:hover {
    box-shadow: 0 4px 12px rgba(225, 6, 0, 0.2);
  }

  .search-button:hover {
    box-shadow: 0 2px 8px rgba(225, 6, 0, 0.15);
  }
}

/* Dark overlay when menu is open (mobile) */
.site-header.menu-open::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Landscape mobile optimization */
@media (max-height: 500px) and (orientation: landscape) {
  .main-nav ul {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    max-height: 80vh;
    overflow-y: auto;
  }

  .main-nav a {
    padding: 12px 16px;
    font-size: 1rem;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .site-header {
    border-bottom-width: 4px;
  }

  .main-nav a {
    font-weight: 700;
  }

  .hamburger-icon span {
    height: 4px;
  }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}