/**
 * 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: 24px 24px 0 0;
  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: 1000;
  overflow: hidden;
}

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

/* Backdrop overlay */
.hole-nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 999;
  pointer-events: none;
}

.hole-nav-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* Drag handle */
.hole-nav-handle {
  width: 40px;
  height: 4px;
  background: #d1d5db;
  border-radius: 2px;
  margin: 12px auto 8px;
}

/* Header */
.hole-nav-header {
  padding: 0 20px 16px;
  border-bottom: 1px solid #e5e7eb;
}

.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: 12px;
  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-handle {
    background: #4b5563;
  }

  .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: 4px;
}

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

.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);
  }
}
