/* ===================================
   NAVIGATION IMPROVEMENTS
   =================================== */

/* Sticky Header with Blur Effect */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  border-bottom: 1px solid transparent;
}

header.scrolled {
  background: rgba(10, 10, 10, 0.98);
  backdrop-filter: blur(20px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  border-bottom-color: var(--border-subtle);
}

/* Breadcrumb Navigation */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 0;
  font-size: 0.9rem;
  color: var(--text-tertiary);
  flex-wrap: wrap;
}

.breadcrumb-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.breadcrumb-link {
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.breadcrumb-link:hover {
  color: var(--accent-primary);
}

.breadcrumb-link.active {
  color: var(--text-primary);
  font-weight: 600;
  pointer-events: none;
}

.breadcrumb-separator {
  color: var(--text-tertiary);
  opacity: 0.5;
}

.breadcrumb-separator svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: var(--accent-primary);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(229, 9, 20, 0.4);
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 999;
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover {
  background: var(--accent-secondary);
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(229, 9, 20, 0.5);
}

.back-to-top:active {
  transform: translateY(-2px);
}

.back-to-top svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

/* Progress Indicator */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  z-index: 101;
  transition: width 0.1s ease;
  box-shadow: 0 0 10px rgba(229, 9, 20, 0.5);
}

/* Enhanced Tab Navigation */
.tabs-container {
  position: sticky;
  top: 70px;
  z-index: 50;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(
    180deg,
    rgba(10, 10, 10, 0.95),
    rgba(10, 10, 10, 0.8)
  );
  backdrop-filter: blur(10px);
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid transparent;
  transition: all 0.3s ease;
}

.tabs-container::-webkit-scrollbar {
  display: none;
}

.tabs-container.scrolled {
  background: rgba(10, 10, 10, 0.98);
  backdrop-filter: blur(20px);
  border-bottom-color: var(--border-subtle);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.tab-button {
  position: relative;
  padding: 0.6rem 1.25rem;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  color: var(--text-tertiary);
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.3s ease;
  overflow: hidden;
}

.tab-button::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 3px;
  background: var(--accent-primary);
  transform: translateX(-50%);
  transition: width 0.3s ease;
  border-radius: 3px 3px 0 0;
}

.tab-button:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.tab-button:hover::before {
  width: 60%;
}

.tab-button.active {
  color: white;
  background: var(--accent-primary);
  box-shadow: 0 2px 8px rgba(229, 9, 20, 0.3);
}

.tab-button.active::before {
  width: 100%;
}

/* Tab Indicator Animation */
.tabs-indicator {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--accent-primary);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 3px 3px 0 0;
  box-shadow: 0 0 10px rgba(229, 9, 20, 0.5);
}

/* Section Navigation */
.section-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  margin-bottom: 1rem;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.section-actions {
  display: flex;
  gap: 0.5rem;
}

.section-nav-btn {
  width: 36px;
  height: 36px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.section-nav-btn:hover {
  background: var(--bg-card);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: scale(1.1);
}

.section-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: scale(1);
}

.section-nav-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Quick Navigation Menu */
.quick-nav {
  position: fixed;
  right: 30px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.quick-nav.visible {
  opacity: 1;
  pointer-events: auto;
}

.quick-nav-item {
  width: 12px;
  height: 12px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.quick-nav-item:hover {
  background: var(--accent-primary);
  transform: scale(1.3);
}

.quick-nav-item.active {
  background: var(--accent-primary);
  width: 16px;
  height: 16px;
}

.quick-nav-item::after {
  content: attr(data-label);
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 0.375rem 0.75rem;
  border-radius: 6px;
  font-size: 0.85rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.quick-nav-item:hover::after {
  opacity: 1;
}

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

/* Skip to Content Link (Accessibility) */
.skip-to-content {
  position: fixed;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent-primary);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 0 0 8px 8px;
  font-weight: 600;
  text-decoration: none;
  z-index: 1000;
  transition: top 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.skip-to-content:focus {
  top: 0;
}

/* Mobile Navigation Drawer */
.mobile-nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
}

.mobile-nav-toggle svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.mobile-nav-drawer {
  position: fixed;
  top: 0;
  right: -100%;
  width: 280px;
  height: 100vh;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-subtle);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
  z-index: 1001;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
}

.mobile-nav-drawer.active {
  right: 0;
}

.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mobile-nav-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.mobile-nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.mobile-nav-close {
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s ease;
}

.mobile-nav-close:hover {
  background: rgba(255, 255, 255, 0.1);
}

.mobile-nav-content {
  padding: 1rem;
}

.mobile-nav-item {
  padding: 1rem;
  color: var(--text-primary);
  text-decoration: none;
  display: block;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.mobile-nav-item:hover {
  background: var(--bg-tertiary);
}

.mobile-nav-item.active {
  background: rgba(229, 9, 20, 0.1);
  color: var(--accent-primary);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
  }

  .back-to-top svg {
    width: 20px;
    height: 20px;
  }

  .quick-nav {
    display: none;
  }

  .mobile-nav-toggle {
    display: flex;
  }

  .tabs-container {
    top: 60px;
    padding: 0.5rem 1rem;
    justify-content: flex-start;
  }

  .tab-button {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }

  .breadcrumb {
    font-size: 0.85rem;
    padding: 0.75rem 0;
  }
}

/* Accessibility */
.back-to-top:focus-visible,
.tab-button:focus-visible,
.section-nav-btn:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .back-to-top,
  .tabs-indicator,
  .tab-button::before {
    transition: none;
  }
}
