/* ============================================
   SACRED VERSES - NAVIGATION STYLES
   Bottom navigation bar with buttons and progress
   ============================================ */

/* ===========================================
   NAVIGATION CONTAINER
   =========================================== */

.navigation {
  position: fixed;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-index-navigation, 10);
  
  display: flex;
  align-items: center;
  gap: 1.5rem;
  
  background: var(--bg-secondary);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  
  border: 1px solid var(--border-color);
  border-radius: 2rem;
  
  padding: 0.75rem 1.5rem;
  
  box-shadow: 
    0 10px 25px var(--shadow-color),
    0 0 0 1px var(--accent-glow);
  
  transition: all var(--transition-normal);
  
  /* Load animation */
  animation: slideInNavigation 0.8s ease-out backwards;
}

.navigation:hover {
  box-shadow: 
    0 15px 35px var(--shadow-color),
    0 0 0 1px var(--accent-glow),
    0 0 20px var(--accent-glow);
  
  transform: translateX(-50%) translateY(-2px);
}

/* ===========================================
   NAVIGATION BUTTONS
   =========================================== */

.nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  
  appearance: none;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 1.5rem;
  
  padding: 0.75rem 1rem;
  min-width: 3.5rem;
  height: 3rem;
  position: relative;
  
  color: var(--text-primary);
  font-family: var(--font-primary, inherit);
  font-size: var(--font-size-sm, 0.875rem);
  font-weight: var(--font-weight-medium, 500);
  
  cursor: pointer;
  outline: none;
  margin: 0;
  text-decoration: none;

  box-shadow: 
    0 10px 25px var(--shadow-color),
    0 0 0 1px var(--accent-glow);
  
  transition: all var(--transition-fast);
  
  will-change: transform, background-color, box-shadow;
  transform: translateZ(0);
  backface-visibility: hidden;
  
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  
  /* Load animation */
  animation: fadeInButton 0.6s ease-out backwards;
}

/* ===========================================
   BUTTON STATES
   =========================================== */

.nav-btn:hover {
  background: var(--accent-primary);
  color: var(--bg-primary);
  border-color: var(--accent-primary);
  
  transform: translateY(-1px) scale(1.02);
  
  box-shadow: 
    0 8px 24px var(--accent-glow),
    0 0 0 4px var(--accent-glow);
}

.nav-btn:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 
    0 4px 12px var(--accent-glow),
    0 0 0 2px var(--accent-glow);
}

.nav-btn:focus-visible {
  outline: none;
  box-shadow: 
    0 0 0 2px var(--bg-primary),
    0 0 0 4px var(--accent-primary);
}

.nav-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  pointer-events: none;
}

.nav-btn:disabled:hover {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-color);
  box-shadow: none;
}

/* Ripple effect */
.nav-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.3s ease, height 0.3s ease;
  pointer-events: none;
}

.nav-btn:active::before {
  width: 100px;
  height: 100px;
}

/* ===========================================
   BUTTON CONTENT
   =========================================== */

.nav-icon {
  width: 1.25rem;
  height: 1.25rem;
  stroke-width: 2;
  transition: transform var(--transition-fast);
  flex-shrink: 0;
}

.nav-btn:hover .nav-icon {
  transform: scale(1.1);
}

/* ===========================================
   PROGRESS INDICATOR
   =========================================== */

.progress-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  min-width: 4rem;
}

.progress-counter {
  font-size: var(--font-size-sm, 0.875rem);
  font-weight: var(--font-weight-semibold, 600);
  color: var(--text-primary);
  letter-spacing: var(--letter-spacing-wide, 0.025em);
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
}

#counter-current {
  color: var(--accent-primary);
  font-weight: var(--font-weight-bold, 700);
  transition: all var(--transition-fast);
}

#counter-total {
  opacity: 0.7;
  font-weight: var(--font-weight-medium, 500);
}

.progress-bar {
  width: 100%;
  height: 0.25rem;
  background: var(--border-color);
  border-radius: 0.125rem;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.progress-fill {
  height: 100%;
  background: var(--accent-primary);
  border-radius: 0.125rem;
  transition: width var(--transition-normal);
  position: relative;
  box-shadow: 0 0 4px var(--accent-glow);
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.3) 50%,
    transparent 50%
  );
  animation: progressShine 2s ease-in-out infinite;
}

/* ===========================================
   HELP BUTTON
   =========================================== */

.help-btn {
  position: fixed;
  top: 50px;
  right: 50px;
  z-index: var(--z-index-navigation, 10);
  
  display: flex;
  align-items: center;
  justify-content: center;
  
  width: 3rem;
  height: 3rem;
  
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  
  color: var(--text-secondary);
  cursor: pointer;
  
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  
  box-shadow: 
    0 4px 12px var(--shadow-color),
    0 0 0 1px var(--accent-glow);
  
  transition: all var(--transition-fast);
  
  /* Load animation */
  animation: fadeInButton 0.6s ease-out 0.4s backwards;
}

.help-btn:hover {
  background: var(--accent-primary);
  color: var(--bg-primary);
  border-color: var(--accent-primary);
  
  transform: scale(1.05);
  
  box-shadow: 
    0 8px 20px var(--accent-glow),
    0 0 0 4px var(--accent-glow);
}

.help-btn:active {
  transform: scale(0.95);
}

/* ===========================================
   THEME-SPECIFIC NAVIGATION STYLES
   =========================================== */

/* Classic theme - golden accents */
[data-theme="classic"] .nav-btn:hover {
  box-shadow: 
    0 8px 24px rgba(184, 134, 11, 0.2),
    0 0 0 8px rgba(184, 134, 11, 0.15),
    0 0 20px rgba(184, 134, 11, 0.1);
}

/* Comfort theme - warm orange glow */
[data-theme="comfort"] .nav-btn:hover {
  box-shadow: 
    0 8px 24px rgba(245, 158, 11, 0.3),
    0 0 0 8px rgba(245, 158, 11, 0.2),
    0 0 20px rgba(245, 158, 11, 0.1);
}

/* Gruvbox themes - retro glow */
[data-theme^="gruvbox"] .nav-btn:hover {
  box-shadow: 
    0 8px 24px var(--accent-glow),
    0 0 0 6px var(--accent-glow),
    0 0 16px var(--accent-glow);
}

/* Catppuccin themes - pastel glow */
[data-theme^="catppuccin"] .nav-btn:hover {
  box-shadow: 
    0 8px 24px var(--accent-glow),
    0 0 0 8px var(--accent-glow),
    0 0 20px var(--accent-glow);
}

/* ===========================================
   ANIMATIONS
   =========================================== */

@keyframes slideInNavigation {
  0% {
    opacity: 0;
    transform: translateY(100px) translateX(-50%);
  }
  100% {
    opacity: 1;
    transform: translateY(0) translateX(-50%);
  }
}

@keyframes fadeInButton {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes progressShine {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(50%); }
}

/* Animation delay for staggered entry */
.progress-container {
  animation-delay: 0.2s;
}

/* ===========================================
   RESPONSIVE DESIGN
   =========================================== */

/* Large screens */
@media (min-width: 768px) {
  .nav-btn {
    padding: 0.75rem 1.25rem;
    min-width: 4rem;
  }
}

/* Mobile devices */
@media (max-width: 768px) {
  .navigation {
    bottom: 20px;
    left: 50%;
    padding: 0.5rem 1rem;
    gap: 1rem;
  }
  
  .nav-btn {
    padding: 0.625rem;
    min-width: 3rem;
    height: 2.75rem;
  }
  
  .help-btn {
    top: 20px;
    right: 20px;
    width: 2.75rem;
    height: 2.75rem;
  }
  
}

/* Very small screens */
@media (max-width: 480px) {
  .navigation {
    bottom: 10px;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
  }
  
  .nav-btn {
    padding: 0.5rem;
    min-width: 2.75rem;
    height: 2.5rem;
  }
  
  .nav-icon {
    width: 1rem;
    height: 1rem;
    margin: 0 !important;
  }
  
  .progress-container {
    min-width: 3rem;
  }
  
  .progress-counter {
    font-size: var(--font-size-xs, 0.75rem);
  }
}

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

@media (prefers-contrast: high) {
  .nav-btn,
  .help-btn {
    border-width: 3px;
    font-weight: var(--font-weight-bold, 700);
  }
  
  .nav-btn:focus-visible,
  .help-btn:focus-visible {
    outline-width: 4px;
  }
  
  .progress-bar {
    border: 2px solid var(--text-primary);
  }
  
  .progress-fill {
    border: 1px solid var(--accent-primary);
  }
}

@media (prefers-reduced-motion: reduce) {
  .navigation,
  .nav-btn,
  .help-btn {
    animation: none;
  }
  
  .nav-btn::before,
  .progress-fill::after {
    display: none;
  }
  
  .nav-btn,
  .help-btn {
    transition: background-color 0.1s ease, color 0.1s ease;
  }
  
  .progress-fill {
    transition: width 0.2s ease;
  }
}

@media (hover: none) and (pointer: coarse) {
  .nav-btn {
    min-width: 3rem;
    min-height: 3rem;
    padding: 0.75rem;
  }
  
  .nav-btn:hover {
    transform: none;
  }
  
  .nav-btn:active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
    transform: scale(0.95);
  }
}

/* ===========================================
   PRINT STYLES
   =========================================== */

@media print {
  .navigation,
  .help-btn {
    display: none !important;
  }
}

/* ===========================================
   SPIRITUAL MODE STYLES
   =========================================== */

/* Spiritual mode body states */
.spiritual-mode {
  /* Base spiritual mode state */
}

.spiritual-mode.ui-hidden {
  /* UI hidden state with cursor management */
  cursor: none;
}

/* Element-specific spiritual mode styles
   NOTE: transform and opacity are intentionally left untransitioned here -
   spiritual-mode.js's GSAP tweens drive both directly (fade + x/y position),
   and a CSS transition on those same properties fights GSAP's own frame
   updates, visibly offsetting the bar. Hover-only properties (box-shadow,
   background/border color) are safe to transition since GSAP never touches them. */
.spiritual-mode .navigation {
  transition: box-shadow var(--transition-normal), border-color var(--transition-normal);
  will-change: transform, opacity;
}

.spiritual-mode .help-btn {
  transition:
    background-color var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast),
    box-shadow var(--transition-fast);
  will-change: transform, opacity;
}

/* Prevent interaction when UI is hidden */
.spiritual-mode.ui-hidden .navigation,
.spiritual-mode.ui-hidden .help-btn {
  pointer-events: none;
}

/* Performance optimization */
.spiritual-mode .navigation,
.spiritual-mode .help-btn {
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* Reduced motion support for spiritual mode */
@media (prefers-reduced-motion: reduce) {
  .spiritual-mode .navigation,
  .spiritual-mode .help-btn {
    transition: opacity 0.1s ease !important;
    transform: none !important;
  }
}

/* High contrast support */
@media (prefers-contrast: high) {
  .spiritual-mode.ui-hidden {
    /* Ensure UI elements are still discoverable in high contrast */
    outline: 2px solid transparent;
  }
}
