/**
 * Hole Navigation Drawer
 * Bottom sheet drawer for navigating between holes on the scorecard
 */

/* Drawer container - slides up from bottom */
.hole-nav-drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 70vh;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 9999;
  overflow: hidden;
  pointer-events: none;
}

.hole-nav-drawer.active {
  transform: translateY(0);
  pointer-events: auto;
}

/* Backdrop overlay - BLOCKS ALL CLICKS when active */
.hole-nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 9998;
  pointer-events: none;
  touch-action: none;
}

.hole-nav-backdrop.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  touch-action: none;
}

/* Header */
.hole-nav-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
}

/* Close button */
.hole-nav-close-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  color: #6b7280;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease, color 0.15s ease;
}

.hole-nav-close-btn:active {
  background: rgba(0, 0, 0, 0.12);
  color: #374151;
}

.hole-nav-title {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 4px;
}

.hole-nav-subtitle {
  font-size: 14px;
  color: #6b7280;
}

/* Hole grid */
.hole-nav-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 20px;
  max-height: calc(70vh - 120px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Hole button - reuse existing hole-progress-dot styling */
.hole-nav-button {
  min-width: 64px;
  height: 64px;
  border-radius: 8px;
  background: rgba(243, 244, 246, 0.8);
  border: 2px solid transparent;
  font-weight: 700;
  font-size: 18px;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

/* Current hole - green gradient */
.hole-nav-button.current {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
  transform: scale(1.05);
}

/* Completed hole - dark green with checkmark */
.hole-nav-button.completed {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
}

/* Skipped hole - amber with X */
.hole-nav-button.skipped {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: #78350f;
  border-color: rgba(120, 53, 15, 0.1);
}

/* Touch interaction */
.hole-nav-button:active {
  transform: scale(0.92);
}

.hole-nav-button.current:active {
  transform: scale(0.97);
}

/* Hover state for desktop */
.hole-nav-button:hover:not(.current) {
  transform: scale(1.02);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .hole-nav-drawer {
    background: #1f2937;
    border-top: 1px solid #374151;
  }

  .hole-nav-header {
    border-bottom-color: #374151;
  }

  .hole-nav-title {
    color: #f9fafb;
  }

  .hole-nav-subtitle {
    color: #9ca3af;
  }

  .hole-nav-close-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #9ca3af;
  }

  .hole-nav-close-btn:active {
    background: rgba(255, 255, 255, 0.2);
    color: #d1d5db;
  }

  .hole-nav-button {
    background: rgba(31, 41, 55, 0.8);
    color: #9ca3af;
    border-color: rgba(75, 85, 99, 0.3);
  }

  .hole-nav-backdrop {
    background: rgba(0, 0, 0, 0.7);
  }
}

/* Responsive - 3 columns on smaller screens */
@media (max-width: 375px) {
  .hole-nav-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .hole-nav-button {
    min-width: 56px;
    height: 56px;
    font-size: 16px;
  }
}

/* Responsive - 6 columns on larger screens */
@media (min-width: 768px) {
  .hole-nav-grid {
    grid-template-columns: repeat(6, 1fr);
  }

  .hole-nav-drawer {
    max-height: 60vh;
  }
}

/* Prevent body scroll when drawer is open */
body.hole-nav-open {
  overflow: hidden;
}

/* Scrollbar styling for drawer grid */
.hole-nav-grid::-webkit-scrollbar {
  width: 8px;
}

.hole-nav-grid::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 8px;
}

.hole-nav-grid::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
}

.hole-nav-grid::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

/* Dark mode scrollbar */
@media (prefers-color-scheme: dark) {
  .hole-nav-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
  }

  .hole-nav-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
  }

  .hole-nav-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
  }
}

/* Dark mode via body.dark-mode class (scorecard theme system) */
.dark-mode .hole-nav-drawer {
  background: #1f2937;
  border-top: 1px solid #374151;
}
.dark-mode .hole-nav-header {
  border-bottom-color: #374151;
}
.dark-mode .hole-nav-title {
  color: #f9fafb;
}
.dark-mode .hole-nav-subtitle {
  color: #9ca3af;
}
.dark-mode .hole-nav-close-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #9ca3af;
}
.dark-mode .hole-nav-close-btn:active {
  background: rgba(255, 255, 255, 0.2);
  color: #d1d5db;
}
.dark-mode .hole-nav-button {
  background: rgba(31, 41, 55, 0.8);
  color: #9ca3af;
  border-color: rgba(75, 85, 99, 0.3);
}
.dark-mode .hole-nav-backdrop {
  background: rgba(0, 0, 0, 0.7);
}
.dark-mode .hole-nav-grid::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}
.dark-mode .hole-nav-grid::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
}
.dark-mode .hole-nav-grid::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}
