/* Mobile-first navigation styles */
.main-navbar {
  padding: 1rem;
}

/* Mobile-first logo sizing */
.navbar-brand {
  max-width: 180px;
}

.navbar-brand img {
  width: 100%;
  height: auto;
}

/* Improved hamburger menu for touch */
.navbar-toggler {
  padding: 0.75rem;
  margin-right: 0.5rem;
  min-width: 44px;
  min-height: 44px;
}

/* Enhanced dropdown behavior */
.dropdown-menu {
  border: none;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  width: 100%;
  padding: 0.5rem 0;
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: #fff;
  min-width: 200px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  z-index: 1;
  border: none;
  padding: 0.5rem 0;
}

.dropdown-content .menu-text {
  min-height: 44px;
  padding: 0.75rem 1rem;
  margin: 0;
  display: flex;
  align-items: center;
  transition: background-color 0.2s ease;
}

.dropdown-content .menu-text:active {
  background-color: rgba(0,0,0,0.1);
}

@media (min-width: 577px) {
  .dropdown-content .menu-text:hover {
    background-color: rgba(0,0,0,0.05);
  }
}

/* Menu text and links */
.menu-text,
.menu-link {
  padding: 0.75rem;
  display: block;
  min-height: 44px;
  min-width: 44px;
  line-height: 1.2;
  text-decoration: none;
  color: inherit;
  margin: 0.25rem;
  transition: all 0.2s ease;
}

.menu-text:active,
.menu-link:active {
  background-color: rgba(0,0,0,0.1);
  border-radius: 4px;
}

/* Desktop hover states */
@media (min-width: 577px) {
  .menu-text:hover,
  .menu-link:hover {
    background-color: rgba(0,0,0,0.05);
    border-radius: 4px;
  }
}

/* Navbar nav styles */
.navbar-nav {
  width: 100%;
  padding: 0;
  margin: 0;
  list-style: none;
}

.nav-item {
  margin: 0;
  padding: 0;
}

.navbar-nav .nav-item {
  width: 100%;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}

.navbar-nav .nav-item:last-child {
  border-bottom: none;
}

@media (max-width: 576px) {
  /* Stack menu items vertically on mobile */
  .navbar-collapse .container-fluid {
    padding: 0;
  }

  /* Mobile navigation layout */
  .navbar-nav {
    flex-direction: column;
  }

  .nav-item {
    width: 100%;
  }

  /* Full width dropdown on mobile */
  .dropdown {
    width: 100%;
  }

  .dropdown-content {
    width: 100%;
    position: static;
    padding: 0;
    box-shadow: none;
    background-color: #f8f9fa;
  }

  /* Show dropdown content when parent is clicked/tapped */
  .dropdown:focus-within .dropdown-content {
    display: block;
  }

  .menu-text,
  .menu-link {
    padding: 1rem;
  }

  /* Enhance touch targets */
  .nav-item > .menu-text,
  .nav-item > .menu-link,
  .dropdown-content .menu-text {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
}

/* Footer Mobile Navigation */
.footer-mobile-nav {
  margin-top: 1rem;
}

.footer-mobile-nav .accordion-button {
  min-height: 44px;
  min-width: 44px;
  padding: 1rem;
  font-weight: 500;
  background-color: #f8f9fa;
  border: none;
  width: 100%;
  text-align: left;
  margin: 0.25rem 0;
  transition: all 0.2s ease;
  border-radius: 4px;
}

.footer-mobile-nav .accordion-button:not(.collapsed) {
  background-color: #e9ecef;
  color: #000;
}

.footer-mobile-nav .accordion-button:focus {
  box-shadow: none;
  border-color: rgba(0,0,0,0.125);
}

.footer-mobile-nav .accordion-button:active {
  background-color: rgba(0,0,0,0.1);
}

.footer-mobile-nav .accordion-button::after {
  width: 1.25rem;
  height: 1.25rem;
  background-size: 1.25rem;
}

.footer-mobile-nav .accordion-body {
  padding: 0;
  display: flex;
  flex-direction: column;
}

.footer-mobile-nav .footer-link {
  padding: 0.875rem 1rem;
  min-height: 44px;
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid rgba(0,0,0,0.1);
  transition: background-color 0.2s ease;
}

.footer-mobile-nav .footer-link:last-child {
  border-bottom: none;
}

.footer-mobile-nav .footer-link:active {
  background-color: rgba(0,0,0,0.1);
}

/* Footer Desktop Navigation */
.footer-nav-desktop {
  display: grid;
  gap: 2rem;
}

.footer-nav-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #333;
}

.footer-nav-section {
  margin-bottom: 1.5rem;
}

.footer-nav-subsection {
  margin-bottom: 1.5rem;
}

.footer-nav-subsection:last-child {
  margin-bottom: 0;
}

.footer-nav-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-nav-desktop .footer-link {
  text-decoration: none;
  color: #666;
  transition: all 0.2s ease;
  padding: 0.75rem 0;
  display: flex;
  align-items: center;
  min-height: 44px;
  margin: 0.25rem 0;
  line-height: 1.5;
}

.footer-nav-desktop .footer-link:hover {
  color: #333;
}

.footer-nav-desktop .footer-link:active {
  background-color: rgba(0,0,0,0.1);
  border-radius: 4px;
}

/* Responsive grid layouts */
@media (min-width: 992px) {
  .footer-nav-desktop {
    grid-template-columns: 2fr 2fr 1fr;
  }
}

@media (min-width: 768px) and (max-width: 991px) {
  .footer-nav-desktop {
    grid-template-columns: 1fr 1fr;
  }
  
  /* Make About & Contact section full width on tablet */
  .footer-nav-desktop > div:last-child {
    grid-column: 1 / -1;
  }
}

/* Original desktop adjustments */
@media (min-width: 577px) {
  .navbar-brand {
    max-width: 220px;
  }

  /* Desktop navigation layout */
  .navbar-nav {
    flex-direction: row;
    align-items: center;
  }

  .nav-item {
    width: auto;
    border: none;
    margin: 0 0.5rem;
  }

  .dropdown-content {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-radius: 4px;
    padding: 0.5rem 0;
  }

  /* Show dropdown on hover for desktop */
  .dropdown:hover .dropdown-content {
    display: block;
  }

  .menu-text,
  .menu-link {
    white-space: nowrap;
  }
}