/* Overlay */
.boulder-drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px); /* Safari support */
  z-index: 10100; /* Higher than header dropdown (10000) */
  animation: fadeIn 0.3s ease;
}

/* Bottom drawer container */
.boulder-bottom-drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: rgb(33, 37, 41);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  max-height: 90vh;
  z-index: 99999; /* Maximum z-index for drawer */
  display: flex;
  flex-direction: column;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

.boulder-bottom-drawer.active {
  animation: slideUp 0.3s ease;
}

/* Drag handle */
.boulder-drawer-handle {
  width: 40px;
  height: 4px;
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  margin: 12px auto 8px;
  cursor: grab;
  transition: background-color 0.2s;
  touch-action: none; /* Prevent browser gestures on drag handle */
  -webkit-touch-callout: none; /* iOS Safari */
  -webkit-user-select: none; /* Safari */
  user-select: none; /* Standard */
}

.boulder-drawer-handle:hover {
  background-color: rgba(255, 255, 255, 0.5);
}

.boulder-drawer-handle:active {
  cursor: grabbing;
}

/* Close button */
.boulder-drawer-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s;
  z-index: 1;
}

.boulder-drawer-close-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Content area */
.boulder-drawer-content {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
  color: white;
  font-family: 'DINRegular', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
  touch-action: pan-y; /* Allow vertical scroll in content area */
  overscroll-behavior: contain; /* Prevent scroll chaining */
}

/* Ensure content text styling */
.boulder-drawer-content h2 {
  color: white;
  margin-bottom: 20px;
  font-size: 24px;
  font-weight: bold;
}

.boulder-drawer-content h3 {
  color: white;
  margin-top: 24px;
  margin-bottom: 12px;
  font-size: 18px;
  font-weight: 600;
}

.boulder-drawer-content p {
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 12px;
  line-height: 1.5;
}

/* Grade badge in drawer */
.boulder-drawer-content .grade-custom-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  color: white;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .boulder-drawer-content {
    padding: 20px;
  }

  .boulder-drawer-content h2 {
    font-size: 20px;
  }

  .boulder-drawer-content h3 {
    font-size: 16px;
  }
}

/* Prevent body scroll when drawer is open - handled in JS */
body.drawer-open {
  overflow: hidden;
}