/* nav-styles.css - Shared Navigation Styles */
/* Import this file in all HTML pages or include via <link> tag */

/* ========================================
   DESKTOP NAVIGATION
   ======================================== */

.filters-nav {
  background: var(--card-bg, white);
  padding: 1.5rem;
  border-radius: 16px;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm, 0 2px 8px rgba(0,0,0,0.1));
  border: 1px solid var(--border-color, #e0e0e0);
}

.nav-container {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: center;
}

.nav-link {
  padding: 1rem 1.75rem;
  border: 2px solid var(--primary-color, #2d5016);
  background: white;
  color: var(--primary-color, #2d5016);
  text-decoration: none;
  border-radius: 12px;
  font-weight: 600;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
  z-index: 1;
  font-size: 0.95rem;
}

.nav-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--primary-color, #2d5016);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  z-index: -1;
}

.nav-link:hover::before,
.nav-link.active::before {
  transform: translateX(0);
}

.nav-link:hover,
.nav-link.active {
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md, 0 4px 12px rgba(0,0,0,0.15));
}

/* Special styling for pitching links */
.nav-link.pitching {
  border-color: #11998e;
  color: #11998e;
}

.nav-link.pitching::before {
  background: #11998e;
}

.nav-link.pitching:hover,
.nav-link.pitching.active {
  color: white;
}

/* Special styling for batting links */
.nav-link.batting {
  border-color: var(--primary-color, #2d5016);
  color: var(--primary-color, #2d5016);
}

.nav-link.batting::before {
  background: var(--primary-color, #2d5016);
}

/* ========================================
   MOBILE NAVIGATION
   ======================================== */

.mobile-nav-container {
  display: none; /* Hidden by default, shown on mobile */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000; /* Increased from 9999 */
  background: white;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.mobile-nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: var(--primary-color, #2d5016);
  color: white;
}

.mobile-nav-title {
  font-size: 1.2rem;
  font-weight: 700;
}

.hamburger-menu {
  background: none;
  border: none;
  color: white;
  font-size: 1.8rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  line-height: 1;
  transition: transform 0.3s ease;
}

.hamburger-menu:hover {
  transform: scale(1.1);
}

.mobile-nav-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  z-index: 9999; /* Increased */
}

.mobile-nav-menu.open {
  max-height: 80vh !important; /* Added !important to override any conflicts */
  overflow-y: auto !important;
}

.mobile-nav-item {
  display: block;
  padding: 1rem 1.5rem;
  color: var(--text-dark, #333);
  text-decoration: none;
  border-bottom: 1px solid var(--border-color, #e0e0e0);
  transition: background-color 0.2s ease;
  font-weight: 500;
}

.mobile-nav-item:hover {
  background-color: #f5f5f5;
}

.mobile-nav-item.active {
  background-color: var(--primary-color, #2d5016);
  color: white;
  font-weight: 600;
}

.mobile-nav-section-divider {
  padding: 0.75rem 1.5rem;
  background-color: #f5f5f5;
  color: var(--text-light, #666);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-top: 1px solid var(--border-color, #e0e0e0);
  border-bottom: 1px solid var(--border-color, #e0e0e0);
}

/* Mobile sign out button styling */
.mobile-signout-btn {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.mobile-signout-btn:hover {
  background-color: rgba(255, 59, 48, 0.1) !important;
  color: #ff3b30 !important;
}

.mobile-signout-btn:active {
  background-color: rgba(255, 59, 48, 0.2) !important;
}

/* Make sure the sign out button has proper padding like other nav items */
.mobile-nav-item.mobile-signout-btn {
  padding: 1rem 1.5rem;
  display: block;
  font-weight: 500;
}



/* Adjust page content to account for fixed mobile nav */
@media (max-width: 768px) {
  .mobile-nav-container {
    display: block;
  }
  
  /* Add padding to body to account for fixed nav - use !important to override * selector */
  body {
    padding-top: 60px !important;
  }
  
  /* Ensure page header doesn't overlap */
  .page-header {
    margin-top: 0 !important;
  }
  
  .header {
    margin-top: 0 !important;
  }
  
  /* Hide desktop nav on mobile - but keep filters visible */
  .filters-nav .nav-container {
    display: none;
  }
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */

@media (max-width: 1024px) {
  .nav-link {
    padding: 0.8rem 1.25rem;
    font-size: 0.9rem;
  }
}

@media (max-width: 768px) {
  .nav-container {
    display: none;
  }
}

/* Smooth scrolling for mobile menu */
.mobile-nav-menu {
  scroll-behavior: smooth;
}

/* Prevent body scroll when mobile menu is open */
body:has(.mobile-nav-menu.open) {
  overflow: hidden;
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

.nav-link:focus,
.mobile-nav-item:focus,
.hamburger-menu:focus {
  outline: 2px solid var(--primary-color, #2d5016);
  outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  .nav-link,
  .nav-link::before,
  .mobile-nav-menu,
  .hamburger-menu {
    transition: none;
  }
}