/* ============================================================
   W2D Events Explorer — Bottom Sheet
   File: explorer-sheet.css
   Apple-style soft light theme
   ============================================================ */

/* -----------------------------------
   Sheet shell
----------------------------------- */

.w2d-sheet {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  z-index: 30;

  display: flex;
  flex-direction: column;
  overflow: hidden;

  height: 20%;
  min-height: 220px;
  max-height: calc(100% - 28px);

  border-radius: 30px;
  border: 1px solid rgba(17, 24, 39, 0.06);
  background:
    linear-gradient(180deg, rgba(244, 246, 249, 0.92) 0%, rgba(236, 240, 245, 0.97) 100%);
  box-shadow:
    0 24px 60px rgba(15, 23, 42, 0.20),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);

  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);

  transition:
    height 0.24s ease,
    transform 0.24s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease,
    opacity 0.18s ease;
}

/* -----------------------------------
   States
----------------------------------- */

.w2d-sheet.is-animating {
  transition:
    height 0.24s ease,
    transform 0.24s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease,
    opacity 0.18s ease;
}

.w2d-sheet.is-dragging {
  transition: none !important;
}

.w2d-sheet.is-hidden {
  pointer-events: none;
  opacity: 0;
}

.w2d-sheet.is-peek {
  box-shadow:
    0 20px 48px rgba(15, 23, 42, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.w2d-sheet.is-half,
.w2d-sheet.is-full {
  box-shadow:
    0 26px 64px rgba(15, 23, 42, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.90);
}

/* -----------------------------------
   Chrome / handle zone
----------------------------------- */

.w2d-sheet__chrome {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;

  display: flex;
  align-items: center;
  justify-content: center;

  min-height: 40px;
  padding: 10px 18px 4px;
  cursor: grab;
  touch-action: none;
}

.w2d-sheet.is-dragging .w2d-sheet__chrome {
  cursor: grabbing;
}

.w2d-sheet__handle {
  width: 72px;
  max-width: 28%;
  height: 6px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 1px 2px rgba(15, 23, 42, 0.05);
}

.w2d-sheet__chrome::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    rgba(17, 24, 39, 0) 0%,
    rgba(17, 24, 39, 0.07) 20%,
    rgba(17, 24, 39, 0.07) 80%,
    rgba(17, 24, 39, 0) 100%
  );
}

/* -----------------------------------
   Content area
----------------------------------- */

.w2d-sheet__content {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding: 0;
}

/* -----------------------------------
   Sheet views / viewports
----------------------------------- */

.w2d-sheetView {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.w2d-sheetView[hidden] {
  display: none !important;
}

.w2d-sheetViewport {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.w2d-sheetViewport--list {
  padding: 0 0 12px;
}

.w2d-sheetViewport--detail {
  padding: 0 0 12px;
}

/* -----------------------------------
   Peek / half / full behaviour
----------------------------------- */

.w2d-sheet.is-peek .w2d-sheet__content,
.w2d-sheet.is-half .w2d-sheet__content,
.w2d-sheet.is-full .w2d-sheet__content {
  overflow: hidden;
}

.w2d-sheet.is-peek .w2d-sheetViewport--list,
.w2d-sheet.is-half .w2d-sheetViewport--list,
.w2d-sheet.is-full .w2d-sheetViewport--list {
  overflow-y: auto;
}

.w2d-sheet.is-full .w2d-sheetViewport--detail {
  overflow-y: auto;
}

/* -----------------------------------
   Peek content polish
----------------------------------- */

.w2d-explorer.is-sheet-peek .w2d-sheetViewport--list {
  padding-bottom: 12px;
}

.w2d-explorer.is-sheet-peek .w2d-eventsList {
  align-content: start;
}

.w2d-explorer.is-sheet-peek .w2d-eventsList > * {
  flex: 0 0 auto;
}

/* -----------------------------------
   Detail placeholder
----------------------------------- */

.w2d-eventDetail {
  min-height: 100%;
}

/* -----------------------------------
   While filter is open
----------------------------------- */

.w2d-explorer.is-filter-open .w2d-sheet {
  transform: translateY(calc(100% + 28px)) !important;
  pointer-events: none !important;
  opacity: 0 !important;
}

.w2d-explorer.is-filter-open .w2d-sheet__chrome,
.w2d-explorer.is-filter-open .w2d-sheet__content {
  pointer-events: none !important;
}

/* -----------------------------------
   Raised visual polish
----------------------------------- */

.w2d-explorer.is-sheet-raised .w2d-sheet {
  border-color: rgba(17, 24, 39, 0.08);
}

.w2d-explorer.is-sheet-full .w2d-sheet {
  border-radius: 30px;
}

/* -----------------------------------
   Scrollbars
----------------------------------- */

.w2d-sheetViewport::-webkit-scrollbar {
  width: 8px;
}

.w2d-sheetViewport::-webkit-scrollbar-thumb {
  background: rgba(17, 24, 39, 0.14);
  border-radius: 999px;
}

.w2d-sheetViewport::-webkit-scrollbar-thumb:hover {
  background: rgba(17, 24, 39, 0.22);
}

.w2d-sheetViewport::-webkit-scrollbar-track {
  background: transparent;
}

/* -----------------------------------
   Mobile / tablet
----------------------------------- */

@media (max-width: 767px) {
  .w2d-sheet {
    left: 10px;
    right: 10px;
    bottom: 10px;
    min-height: 240px;
    max-height: calc(100% - 20px);
    border-radius: 28px;
  }

  .w2d-sheet__chrome {
    min-height: 38px;
    padding: 10px 16px 4px;
  }

  .w2d-sheet__handle {
    width: 64px;
    height: 6px;
  }

  .w2d-sheetViewport--list,
  .w2d-sheetViewport--detail {
    padding-bottom: 10px;
  }

  .w2d-explorer.is-sheet-peek .w2d-sheetViewport--list {
    padding-bottom: 10px;
  }
}

/* -----------------------------------
   Disable drag interaction when locked
----------------------------------- */

.w2d-sheet.is-drag-locked .w2d-sheet__chrome {
  pointer-events: none;
  cursor: default;
}