/**
 * Navigation Styles
 * Provides smooth transitions and loading indicators
 */

/* Navigation Loading Overlay */
.navigation-loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(2px);
}

/* Full-page loading curtains caused a blue/black flash and could remain over
   the destination page when navigation was interrupted. Storefront links use
   normal document navigation, so this curtain must never cover the page. */
#navigation-loader,
.navigation-loading-overlay {
  display: none !important;
  background: transparent !important;
  backdrop-filter: none !important;
}

.navigation-loading-overlay .spinner-border {
  width: 3rem;
  height: 3rem;
}

/* Smooth Page Transitions */
body {
  transition: none;
}

body:not(.modal-open) > .modal-backdrop { display: none !important; }

/* Navigation Link Hover Effects */
.nav-link {
  transition: all 0.2s ease;
  position: relative;
}

.nav-link:hover {
  transform: translateY(-1px);
}

/* The imported navbar owns its active and hover states. The former global
   purple underline conflicted with that design and appeared as a stray strip
   beneath links in the billing and admin panels. */

.dropdown-item.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

/* Smooth Dropdown Animations */
.dropdown-menu {
  animation: dropdownFadeIn 0.2s ease;
  transform-origin: top;
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: scaleY(0.8) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: scaleY(1) translateY(0);
  }
}

/* Page Content Transitions */
main,
.container,
#app {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Navigation Progress Bar */
.navigation-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  z-index: 10000;
  transition: width 0.3s ease;
}

/* Smooth Scroll Behavior */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px; /* Account for fixed navbar */
}

/* Ensure body scrolls properly */
body {
  overflow-x: hidden;
  scroll-behavior: smooth;
}

/* Smooth scrolling for all elements */
* {
  scroll-behavior: smooth;
}

/* Navigation Link Focus States */
.nav-link:focus,
.dropdown-item:focus {
  outline: 2px solid #667eea;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Mobile Navigation Improvements */
@media (max-width: 768px) {
  .navbar-nav {
    transition: all 0.3s ease;
  }
  
  .navbar-collapse {
    animation: mobileMenuSlide 0.3s ease;
  }
  
  @keyframes mobileMenuSlide {
    from {
      opacity: 0;
      transform: translateY(-20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

/* Loading States for Navigation */
.nav-link.loading {
  pointer-events: none;
  opacity: 0.7;
}

.nav-link.loading::before {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid #667eea;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 1s linear infinite;
  margin-right: 8px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Navigation History Indicator */
.navigation-history-indicator {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 8px 12px;
  border-radius: 20px;
  font-size: 12px;
  z-index: 1000;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
}

.navigation-history-indicator.show {
  opacity: 1;
  transform: translateY(0);
}

/* Smooth Page Load */
.page-content {
  animation: pageFadeIn 0.5s ease;
}

@keyframes pageFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Navigation Link States */
.nav-link:active {
  transform: scale(0.95);
}

.nav-link.disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* Dropdown Improvements */
.dropdown-toggle::after {
  transition: transform 0.2s ease;
}

.dropdown.show .dropdown-toggle::after {
  transform: rotate(180deg);
}

/* Mobile Menu Toggle Animation */
.navbar-toggler {
  transition: all 0.3s ease;
}

.navbar-toggler:focus {
  box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Navigation Brand Hover Effect */
.navbar-brand {
  transition: all 0.3s ease;
}

.navbar-brand:hover {
  transform: scale(1.05);
}

/* Smooth Backdrop Transitions */
.navbar-collapse {
  transition: backdrop-filter 0.3s ease;
}

@media (max-width: 991.98px) {
  .navbar-collapse {
    backdrop-filter: blur(10px);
    background: rgba(33, 37, 41, 0.95);
  }
} 
