/* Reusable Bottom Sheet Styles */
/* Modern native-like bottom sheet component */

.bottom-sheet {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.bottom-sheet.open {
  pointer-events: all;
  opacity: 1;
}

.bottom-sheet-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.3s ease;
  /* Prevent any interaction with content behind */
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.bottom-sheet.open .bottom-sheet-backdrop {
  opacity: 1;
}

.bottom-sheet-container {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--black);
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  max-height: 85vh; /* Increased from 80vh for better content fit */
  min-height: 40vh; /* Minimum height for usability */
  display: flex;
  flex-direction: column;
  transform: translate3d(0, 100%, 0);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.3s ease;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.5);
  /* GPU acceleration */
  will-change: transform, opacity;
  /* Prevent text selection while dragging */
  -webkit-user-select: none;
  user-select: none;
}

.bottom-sheet.open .bottom-sheet-container {
  transform: translate3d(0, 0, 0);
}

/* Desktop/Web: standardize width + perfect centering for ALL bottom sheets */
@media screen and (min-width: 768px) {
  .bottom-sheet-container {
    max-width: 600px;
    max-height: 80vh; /* Slightly less on desktop for better proportions */
    min-height: 50vh; /* Higher minimum on desktop */
    /* Center by constraining left/right and letting auto margins do the rest */
    left: 16px;
    right: 16px;
    margin-left: auto;
    margin-right: auto;
    width: auto;
    transform: translate3d(0, 100%, 0);
  }

  .bottom-sheet.open .bottom-sheet-container {
    transform: translate3d(0, 0, 0);
  }
}

.bottom-sheet-handle {
  width: 40px;
  height: 4px;
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  margin: 12px auto 8px;
  cursor: grab;
  touch-action: none;
}

.bottom-sheet-handle:active {
  cursor: grabbing;
}

.bottom-sheet-header {
  padding: 0 24px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.bottom-sheet-title {
  font-family: var(--_fonts---font-family--instrument-serif);
  font-size: 24px;
  font-weight: 400;
  color: var(--yellow);
  margin: 0;
  text-align: center;
}

.bottom-sheet-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 16px 0;
  overscroll-behavior: contain;
  overscroll-behavior-y: contain;
  scroll-behavior: smooth;
}

.bottom-sheet-loading,
.bottom-sheet-error {
  padding: 40px 24px;
  text-align: center;
  font-family: var(--_fonts---font-family--ibm-plex-mono);
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
}

.bottom-sheet-error {
  color: rgba(255, 0, 0, 0.7);
}

/* Mobile optimizations */
@media screen and (max-width: 767px) {
  .bottom-sheet-container {
    max-height: 85vh;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
  }

  .bottom-sheet-title {
    font-size: 20px;
  }
}

/* Smooth scrollbar styling */
.bottom-sheet-content::-webkit-scrollbar {
  width: 6px;
}

.bottom-sheet-content::-webkit-scrollbar-track {
  background: transparent;
}

.bottom-sheet-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.bottom-sheet-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

