/**
 * ============================================================================
 * slide-up-sheet.css — Slide-up overlay and panel (mobile app shell)
 * ============================================================================
 *
 * PURPOSE:
 *   Styles the overlay backdrop and slide-up panel used for the calculator
 *   menu and settings sheet on mobile. All animation is CSS-driven (JS only
 *   toggles .sheet--open / .sheet-overlay--visible).
 *
 * BEM STRUCTURE:
 *   .sheet-overlay       — Full-screen dimmed backdrop
 *   .sheet              — Slide-up panel (contains .sheet__inner)
 *   .sheet__inner        — Scrollable content area
 *   .sheet__header       — Title row with close button
 *   .sheet__title        — Panel title
 *   .sheet__close        — Close button
 *   .sheet-list          — List of links (calculators or settings items)
 *   .sheet-list__link    — Single link/row
 *
 * ANIMATION:
 *   Overlay: opacity 0 → 1, ease-out 0.25s
 *   Panel: translateY(100%) → 0, ease-out 0.3s
 *   prefers-reduced-motion: instant (0.01ms)
 *
 * ============================================================================
 */

/* --- Overlay: dimmed backdrop --- */
.sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background-color: rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.33, 1, 0.68, 1);
}

.sheet-overlay--visible {
  opacity: 1;
  pointer-events: auto;
}

/* --- Panel: slides up from bottom --- */
.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 101;
  max-height: 85vh;
  background-color: var(--color-bg);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.33, 1, 0.68, 1);
  display: flex;
  flex-direction: column;
}

.sheet--open {
  transform: translateY(0);
}

.sheet__inner {
  overflow-y: auto;
  padding: var(--space-md);
  padding-bottom: calc(var(--space-xl) + env(safe-area-inset-bottom));
}

.sheet__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding-bottom: var(--space-md);
  margin-bottom: var(--space-sm);
  border-bottom: var(--border);
}

.sheet__title {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--color-text);
  margin: 0;
}

.sheet__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background-color: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.sheet__close:hover,
.sheet__close:focus-visible {
  background-color: var(--color-border);
  outline: none;
}

.sheet__close .icon {
  color: inherit;
}

/* --- Calculator list in menu sheet --- */
.sheet-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sheet-list__link {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  margin-bottom: var(--space-2xs);
  border-radius: var(--radius-md);
  color: var(--color-text);
  text-decoration: none;
  font-weight: var(--weight-medium);
  transition: background-color var(--transition-fast);
  min-height: 44px;
}

.sheet-list__link:hover,
.sheet-list__link:focus-visible {
  background-color: var(--color-surface);
  color: var(--color-text);
  text-decoration: none;
}

.sheet-list__icon {
  color: var(--color-accent);
  flex-shrink: 0;
}

.sheet-list__name {
  flex: 1;
}

/* --- Settings sheet: theme + rates block --- */
.sheet__section {
  margin-bottom: var(--space-xl);
}

.sheet__section:last-child {
  margin-bottom: 0;
}

.sheet__section-title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-text);
  margin-bottom: var(--space-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Rate display inside sheet — reuse rate-display block, slightly tighter */
.sheet .rate-display {
  padding: var(--space-md);
}

.sheet .rate-display__title {
  font-size: var(--text-md);
  margin-bottom: var(--space-sm);
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  .sheet-overlay,
  .sheet {
    transition-duration: 0.01ms;
  }
}
