/* =========================================
   Advanced Features (Navigation & Animations)
   ========================================= */

/* --- Scroll Progress Bar --- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  /* Slightly thicker */
  background: transparent;
  z-index: 10001;
  /* Ensure it's on top of everything */
  pointer-events: none;
}

.scroll-progress__bar {
  height: 100%;
  background: #009600;
  /* Medium Green */
  width: 0%;
  transition: width 0.1s linear;
  box-shadow: 0 0 10px #009600, 0 0 20px #009600;
}

/* --- Section Indicators (Dots Navigation) --- */
.section-indicators {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 15px;
  z-index: 100;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
  /* Initially disabled until visible */
}

.section-indicators.visible {
  opacity: 1;
  pointer-events: auto;
}

.section-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.5);
  cursor: pointer;
  position: relative;
  transition: all 0.3s ease;
  padding: 0;
}

/* Light mode overrides */
[data-theme="light"] .section-indicator {
  background: rgba(0, 0, 0, 0.1);
  border-color: rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .section-indicator.active {
  background: #009600;
  border-color: #009600;
  box-shadow: 0 0 8px rgba(0, 150, 0, 0.5);
}

[data-theme="light"] .section-indicator:hover {
  background: rgba(0, 150, 0, 0.3);
  border-color: #009600;
}

.section-indicator:hover {
  background: rgba(0, 150, 0, 0.5);
  border-color: #009600;
  transform: scale(1.2);
}

.section-indicator.active {
  background: #009600;
  border-color: #009600;
  box-shadow: 0 0 8px #009600;
  transform: scale(1.3);
}

.section-indicator__tooltip {
  position: absolute;
  right: 25px;
  top: 50%;
  transform: translateY(-50%) translateX(10px);
  background: rgba(0, 0, 0, 0.8);
  color: #009600;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-family: 'Fira Code', monospace;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  white-space: nowrap;
  border: 1px solid #009600;
}

.section-indicator:hover .section-indicator__tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
}

/* Mobile adjustments for indicators */
@media (max-width: 768px) {
  .section-indicators {
    right: 10px;
    gap: 10px;
  }

  .section-indicator {
    width: 10px;
    height: 10px;
  }

  .section-indicator__tooltip {
    display: none;
    /* Hide tooltips on mobile */
  }
}



/* --- Custom Cursor --- */
@media (pointer: fine) {
  body.custom-cursor-active {
    cursor: none;
    /* Hide default cursor */
  }

  .custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 10000;
    display: none;
    /* Hidden by default, shown by JS */
  }

  .custom-cursor__dot {
    width: 8px;
    height: 8px;
    background: #888888;
    border-radius: 50%;
    position: absolute;
    transform: translate(-50%, -50%);
    transition: transform 0.1s ease;
    box-shadow: 0 0 5px rgba(136, 136, 136, 0.5);
  }

  .custom-cursor__outline {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(136, 136, 136, 0.5);
    border-radius: 50%;
    position: absolute;
    transform: translate(-50%, -50%);
    transition: width 0.2s ease, height 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
  }

  /* Hover state */
  .custom-cursor.hovering .custom-cursor__outline {
    width: 60px;
    height: 60px;
    background-color: rgba(136, 136, 136, 0.1);
    border-color: #888888;
  }

  .custom-cursor.hovering .custom-cursor__dot {
    transform: translate(-50%, -50%) scale(0.5);
  }

  /* Click state */
  .custom-cursor.clicking .custom-cursor__outline {
    width: 30px;
    height: 30px;
    background-color: rgba(136, 136, 136, 0.3);
  }
}

/* --- Keyboard Navigation Highlights --- */
section.keyboard-nav-active {
  position: relative;
}

section.keyboard-nav-active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 4px;
  height: 100%;
  background: #009600;
  box-shadow: 0 0 15px #009600;
  animation: pulseNav 1s infinite alternate;
  z-index: 50;
}

@keyframes pulseNav {
  from {
    opacity: 0.5;
    box-shadow: 0 0 5px #009600;
  }

  to {
    opacity: 1;
    box-shadow: 0 0 15px #009600;
  }
}

/* --- Parallax Base --- */
.parallax-bg {
  transform: translateZ(0);
  /* Hardware accel */
  will-change: transform;
}

/* --- Smooth Scrolling (Global) --- */
html {
  scroll-behavior: smooth;
}

/* Offset for fixed header */
section[id] {
  scroll-margin-top: 80px;
  /* Adjusted for header height + padding */
}