/**
 * Quest Navigator Styles
 * Interactive navigation system with theme-appropriate designs
 */

/* Floating navigation removed - navbar handles quest navigation now */

.nav-icon {
  font-size: 1.25rem;
  display: flex;
  align-items: center;
}

.nav-icon svg {
  transition: transform 0.3s ease;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Theme-specific compass colors removed with floating nav */

.nav-label {
  display: none;
}

@media (min-width: 768px) {
  .nav-label {
    display: inline;
  }
}

/* Navigation Overlay */
.quest-nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0);
  
  /* Hidden by default */
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.quest-nav-overlay.active {
  opacity: 1;
  visibility: visible;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
}


/* Navigation Container */
.quest-nav-container {
  position: relative;
  width: 100%;
  max-width: 800px;
  max-height: 90vh;
  
  padding: 2rem;
  border-radius: 1rem;
  
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  
  overflow-y: auto;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.quest-nav-overlay.active .quest-nav-container {
  transform: scale(1);
}

/* Theme-specific backgrounds */
.space-map {
  background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
  position: relative;
}

.space-map::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(2px 2px at 20% 30%, white, transparent),
    radial-gradient(2px 2px at 60% 70%, white, transparent),
    radial-gradient(1px 1px at 50% 50%, white, transparent),
    radial-gradient(1px 1px at 80% 10%, white, transparent);
  background-size: 200px 200px;
  opacity: 0.3;
  animation: stars 120s linear infinite;
}

@keyframes stars {
  from { transform: translateY(0); }
  to { transform: translateY(-200px); }
}

.mythical-map {
  background: linear-gradient(135deg, #2c1810 0%, #8b4513 50%, #654321 100%);
  border: 3px solid #d4af37;
}

.ancient-map {
  background: linear-gradient(135deg, #3e2723 0%, #5d4037 50%, #4e342e 100%);
  border: 3px solid #cdaa7d;
}

.developer-map {
  background: linear-gradient(135deg, #1e1e1e 0%, #2d2d30 50%, #252526 100%);
  border: 1px solid #007acc;
}

/* Close Button */
.quest-nav-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  
  width: 2rem;
  height: 2rem;
  
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 1.5rem;
  line-height: 1;
  
  cursor: pointer;
  transition: all 0.3s ease;
}

.quest-nav-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

/* Title */
.quest-nav-title {
  margin: 0 0 1.5rem;
  color: white;
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* Realm Selector */
.quest-nav-realms {
  margin-bottom: 1rem;
  text-align: center;
}

.realm-selector {
  display: inline-block;
  padding: 0.5rem 1rem;
  
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 0.5rem;
  
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-size: 0.9rem;
  
  transition: all 0.3s ease;
}

.realm-selector:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
  color: white;
}

/* Home Link */
.quest-nav-home {
  margin-bottom: 1.5rem;
  text-align: center;
}

.home-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  
  padding: 0.75rem 1.5rem;
  
  background: var(--primary-color, #4a90e2);
  border-radius: 0.5rem;
  
  color: white;
  text-decoration: none;
  font-weight: 600;
  
  transition: all 0.3s ease;
}

.home-link:hover {
  background: var(--secondary-color, #357abd);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Progress Bar */
.quest-nav-progress {
  margin-bottom: 2rem;
}

.progress-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
  border-radius: 4px;
  transition: width 0.5s ease;
}

.progress-text {
  display: block;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  text-align: center;
}

/* Quest Grid */
.quest-nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.quest-nav-item {
  position: relative;
  padding: 1rem;
  
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.5rem;
  
  color: white;
  text-decoration: none;
  text-align: center;
  
  transition: all 0.3s ease;
  cursor: pointer;
}

.quest-nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.quest-nav-item.completed {
  background: rgba(76, 175, 80, 0.2);
  border-color: #4caf50;
}

.quest-nav-item.current {
  background: rgba(255, 193, 7, 0.2);
  border-color: #ffc107;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.4); }
  50% { box-shadow: 0 0 0 10px rgba(255, 193, 7, 0); }
}

.quest-nav-item.available {
  opacity: 0.7;
}

.quest-nav-item.available:hover {
  opacity: 1;
}

.quest-number {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
  opacity: 0.8;
}

.quest-title {
  font-size: 0.95rem;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.quest-star {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  font-size: 1.2rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.quest-nav-item.completed .quest-star {
  opacity: 1;
  color: #ffd700;
}

/* Legend */
.quest-nav-legend {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
}

.quest-status {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.quest-status.completed {
  background: #4caf50;
  border-color: #4caf50;
}

.quest-status.current {
  background: #ffc107;
  border-color: #ffc107;
}

.quest-status.available {
  background: rgba(255, 255, 255, 0.1);
}

/* Quest Navigation Enhancement */
.quest-navigation-bottom {
  display: flex;
  align-items: center;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  min-height: 60px; /* Ensure consistent height even with only one button */
  gap: 1rem; /* Add gap between buttons */
}

/* Default: space between when both buttons exist */
.quest-navigation-bottom {
  justify-content: space-between;
}

/* Single button scenarios - use specific classes for better control */
.quest-navigation-bottom.nav-next-only {
  justify-content: flex-end;
}

.quest-navigation-bottom.nav-prev-only {
  justify-content: flex-start;
}

.prev-quest-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  
  padding: 0.75rem 1.5rem;
  
  background: var(--primary-color, #4a90e2);
  border-radius: 0.5rem;
  
  color: white;
  text-decoration: none;
  font-weight: 600;
  
  transition: all 0.3s ease;
}

.next-quest-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  
  padding: 0.75rem 1.5rem;
  
  background: var(--primary-color, #4a90e2);
  border-radius: 0.5rem;
  
  color: white;
  text-decoration: none;
  font-weight: 600;
  
  transition: all 0.3s ease;
}

.prev-quest-btn:hover {
  background: var(--secondary-color, #357abd);
  transform: translateX(-2px);
}

.next-quest-btn:hover {
  background: var(--secondary-color, #357abd);
  transform: translateX(2px);
}

.complete-btn {
  background: linear-gradient(135deg, #4caf50, #8bc34a);
}

.complete-btn:hover {
  background: linear-gradient(135deg, #45a049, #7cb342);
}

/* Mobile Optimizations */
@media (max-width: 768px) {
  
  .quest-nav-container {
    padding: 1.5rem 1rem;
    max-height: 85vh;
  }
  
  .quest-nav-title {
    font-size: 1.5rem;
  }
  
  .quest-nav-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
  }
  
  /* Mobile quest navigation - stack vertically */
  .quest-navigation-bottom {
    flex-direction: column !important;
    justify-content: center !important;
    gap: 1rem;
    text-align: center;
  }
  
  .quest-navigation-bottom.nav-next-only,
  .quest-navigation-bottom.nav-prev-only {
    align-items: center;
  }
  
  .prev-quest-btn,
  .next-quest-btn {
    width: 100%;
    max-width: 300px;
    justify-content: center;
    margin: 0;
  }
  
  /* Order buttons correctly on mobile */
  .prev-quest-btn {
    order: 1;
  }
  
  .next-quest-btn {
    order: 2;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  .quest-nav-overlay,
  .quest-nav-container,
  .quest-nav-item,
  .quest-nav-close {
    animation: none;
    transition: none;
  }
}

/* Light theme adjustments */
@media (prefers-color-scheme: light) {
  
  .developer-map {
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 50%, #d0d0d0 100%);
    color: #333;
  }
  
  .developer-map .quest-nav-title,
  .developer-map .quest-nav-item,
  .developer-map .quest-nav-close,
  .developer-map .progress-text,
  .developer-map .legend-item {
    color: #333;
  }
  
  .developer-map .quest-nav-item {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
  }
  
  .developer-map .realm-selector {
    color: #333;
    border-color: rgba(0, 0, 0, 0.3);
  }
  
  .developer-map .realm-selector:hover {
    background: rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.5);
    color: #000;
  }
}