/**
 * BottomSheet Styles
 *
 * Mobile bottom sheet with:
 * - Backdrop overlay
 * - Slide-up animation
 * - Large touch targets (48px min)
 * - Swipe down gesture support
 */

/* Backdrop */
.bottom-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  display: flex;
  align-items: flex-end;
  animation: bottomSheetBackdropIn 0.2s ease-out;
}

@keyframes bottomSheetBackdropIn {
  from {
    background: rgba(0, 0, 0, 0);
  }
  to {
    background: rgba(0, 0, 0, 0.5);
  }
}

/* Sheet Container */
.bottom-sheet {
  width: 100%;
  max-height: 80vh;
  background: white;
  border-radius: 16px 16px 0 0;
  overflow: hidden;
  animation: bottomSheetSlideUp 0.25s ease-out;
  touch-action: none;
}

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

/* Drag Handle */
.bottom-sheet__handle {
  display: flex;
  justify-content: center;
  padding: 12px 0 8px;
}

.bottom-sheet__handle-bar {
  width: 36px;
  height: 4px;
  background: #ddd;
  border-radius: 2px;
}

/* Header */
.bottom-sheet__header {
  padding: 0 16px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.bottom-sheet__title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary, #333);
  text-align: center;
}

/* Content */
.bottom-sheet__content {
  padding: 8px 0;
  max-height: calc(80vh - 140px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Menu Item */
.bottom-sheet__item {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  min-height: 52px;
  padding: 14px 20px;
  border: none;
  background: transparent;
  text-align: left;
  font-size: 16px;
  color: var(--text-primary, #333);
  cursor: pointer;
  transition: background-color 0.15s;
}

.bottom-sheet__item:active {
  background-color: rgba(0, 0, 0, 0.08);
}

/* Item Icon */
.bottom-sheet__item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  font-size: 18px;
  color: var(--text-secondary, #666);
}

.bottom-sheet__item:active .bottom-sheet__item-icon {
  color: var(--text-primary, #333);
}

/* Item Label */
.bottom-sheet__item-label {
  flex: 1;
  font-weight: 500;
}

/* Danger Variant */
.bottom-sheet__item--danger {
  color: var(--danger-color, #d32f2f);
}

.bottom-sheet__item--danger .bottom-sheet__item-icon {
  color: var(--danger-color, #d32f2f);
}

.bottom-sheet__item--danger:active {
  background-color: rgba(211, 47, 47, 0.08);
}

/* Disabled State */
.bottom-sheet__item--disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Divider */
.bottom-sheet__divider {
  height: 1px;
  margin: 8px 16px;
  background-color: rgba(0, 0, 0, 0.08);
}

/* Footer with Cancel */
.bottom-sheet__footer {
  padding: 8px 16px 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.bottom-sheet__cancel {
  width: 100%;
  min-height: 48px;
  padding: 12px;
  border: none;
  background: var(--bg-secondary, #f5f5f5);
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary, #333);
  cursor: pointer;
  transition: background-color 0.15s;
}

.bottom-sheet__cancel:active {
  background: #e5e5e5;
}

/* Safe Area Bottom (for notch devices) */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .bottom-sheet__footer {
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .bottom-sheet {
    background: var(--bg-dark, #2a2a2a);
  }

  .bottom-sheet__handle-bar {
    background: #555;
  }

  .bottom-sheet__header {
    border-bottom-color: rgba(255, 255, 255, 0.1);
  }

  .bottom-sheet__title {
    color: var(--text-primary-dark, #fff);
  }

  .bottom-sheet__item {
    color: var(--text-primary-dark, #fff);
  }

  .bottom-sheet__item:active {
    background-color: rgba(255, 255, 255, 0.08);
  }

  .bottom-sheet__item-icon {
    color: var(--text-secondary-dark, #aaa);
  }

  .bottom-sheet__divider {
    background-color: rgba(255, 255, 255, 0.1);
  }

  .bottom-sheet__footer {
    border-top-color: rgba(255, 255, 255, 0.1);
  }

  .bottom-sheet__cancel {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary-dark, #fff);
  }

  .bottom-sheet__cancel:active {
    background: rgba(255, 255, 255, 0.15);
  }
}
