/* Left panel */
.panel {
  position: absolute;
  top: 20px;
  bottom: 20px;
  left: 20px;
  width: var(--panelW);
  max-width: calc(100% - 24px);
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  border-radius: 22px;
  display: flex;
  flex-direction: column;
  min-width: 320px;
  z-index: 700;
  min-height: 0;
  height: calc(100dvh - var(--topbarH) - 40px);
  transition: height 0.5s cubic-bezier(0.19, 1, 0.22, 1), box-shadow 0.3s ease;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);

  &.collapsed {
    height: 66px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
  }

  &.collapsed .panelMetaRow,
  &.collapsed .activeFilters,
  &.collapsed .results {
    transition: opacity 0.1s ease, transform 0.1s ease;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
  }

  &.collapsing .panelMetaRow,
  &.collapsing .activeFilters,
  &.collapsing .results {
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
  }
}

.panelMetaRow,
.activeFilters,
.results {
  transition: opacity 0.4s ease 0.1s, transform 0.4s cubic-bezier(0.19, 1, 0.22, 1) 0.1s;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.panelHeader {
  padding: 14px 14px 10px;
  display: grid;
  grid-template-rows: auto auto;
  gap: 6px;
  flex: 0 0 auto;
}

.panelHeader h1 {
  margin: 0;
  font-size: 16px;
  letter-spacing: -.01em;
  color: #f1e9ff;
  font-weight: 700;
}

.metaCount {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  margin-left: 6px;
}

.panelTitleRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.panelMetaRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
}

.meta {
  margin-top: 0;
  font-size: 12px;
  color: rgba(233, 228, 255, 0.7);
}

.panelToggle {
  border: 1px solid rgba(51, 70, 121, 0.3);
  background: rgba(42, 16, 72, 0.8);
  width: 34px;
  height: 34px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 16px;
  color: #e9e4ff;
  display: flex;
  align-items: center;
  justify-content: center;

  & img {
    width: 16px;
    height: 16px;
    display: block;
  }

  &:hover {
    background: rgba(60, 24, 100, 0.9);
  }
}

.sortControl {
  border: 1px solid rgba(51, 70, 121, 0.28);
  background: rgba(30, 12, 54, 0.9);
  border-radius: 10px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  font-weight: 600;
  color: #e9e4ff;

  &:hover {
    background: rgba(48, 18, 86, 0.95);
  }

  &:disabled {
    opacity: .55;
    cursor: not-allowed;
    box-shadow: none;
  }
}

.sortIcon {
  display: inline-flex;
  align-items: center;
}

.sortIcon img {
  width: 16px;
  height: 16px;
  display: block;
}

#sortLabel {
  font-size: 12px;
}

/* Sticky active filters bar */
.activeFilters {
  position: sticky;
  top: 0;
  z-index: 6;
  background: rgba(18, 10, 32, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 10px 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;

  & .activePresetIdeaBadge {
    position: static;
    width: 100%;
    flex: 1 1 100%;
    background: #118af6 !important;
    opacity: 1;
    transform: none;
    display: inline-flex;
    align-items: center;
  }

  & .activePresetIdeaBadge .presetText {
    flex: 1 1 auto;
    min-width: 0;
  }

  & .activePresetIdeaBadge button {
    margin-left: auto;
    font-size: 14px;
  }
}

.activeFilterChip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(25, 89, 173, 0.16);
  border: 1px solid var(--drawer-border);
  font-size: 12px;
  font-weight: 700;
  color: #efe9ff;
  cursor: pointer;

  & button {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    color: rgba(233, 228, 255, 0.7);
    padding: 0 2px;
  }

  & button:hover {
    color: #fff;
  }
}

.activePresetChip {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: none;
  background: #3c6fda;
  color: #eaedff;
  font-weight: 800;
  font-size: 13px;
  box-shadow: 0 10px 22px rgba(25, 89, 173, 0.35);

  & button {
    border: none;
    background: transparent;
    color: rgba(233, 228, 255, 0.7);
    cursor: pointer;
    font-size: 24px;
  }

  & button:hover {
    background: transparent!important;
  }
}

.presetFeature {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--drawer-border);
  background: rgba(18, 10, 32, 0.9);
  box-shadow: 0 12px 26px rgba(80, 40, 140, 0.35);

  & button {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
    color: var(--muted);
    padding: 4px 6px;
    border-radius: 8px;
  }

  & button:hover {
    color: var(--text);
  }
}

.presetFeatureTitle {
  font-weight: 800;
  font-size: 14px;
  color: var(--text);
}

.presetFeatureDesc {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

/* Results */
.results {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 10px 16px 14px 12px;
  display: block;
  scrollbar-color: #f833a9 rgba(12, 8, 20, 0.9);
  scrollbar-width: thin;
  scrollbar-width: none;

  &::-webkit-scrollbar {
    width: 0;
    height: 0;
  }

  &>* {
    margin-bottom: 20px;
  }

  &>*:last-child {
    margin-bottom: 0;
  }
}

/* Cards */
.card {
  border-radius: 20px;
  overflow: hidden;
  background-color: var(--bg-card);
  cursor: pointer;
  transition: transform .10s ease, box-shadow .10s ease, outline-color .10s ease;
  position: relative;

  &.selected {
    outline: 2px solid var(--xplrit-accent);
    box-shadow: 0 0 24px rgba(46, 242, 255, 0.35);
  }

  &.presetGlow {
    animation: presetGlow 1.5s ease-out;
  }

  &.hovered {
    outline: 2px solid var(--xplrit-accent);
  }
}

@keyframes presetGlow {
  0% {
    box-shadow: 0 0 0 rgba(46, 242, 255, 0), 0 12px 28px rgba(8, 13, 39, 0.45);
  }

  20% {
    box-shadow: 0 0 30px rgba(46, 242, 255, 0.45), 0 0 12px rgba(60, 82, 217, 0.35), 0 12px 28px rgba(8, 13, 39, 0.45);
  }

  100% {
    box-shadow: 0 0 0 rgba(46, 242, 255, 0), 0 12px 28px rgba(8, 13, 39, 0.45);
  }
}

.cardImg {
  height: 400px;
  background: linear-gradient(135deg, rgba(16, 24, 40, .10), rgba(16, 24, 40, .03));
  background-size: cover;
  background-position: center;
  position: relative;
  filter: saturate(1.1) contrast(1.08);

  &::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(10, 6, 18, 0) 0%, rgba(10, 6, 18, 0.65) 55%, rgba(10, 6, 18, 0.9) 100%);
  }
}

.cardPlace {
  font-size: 40px;
  font-weight: 800;
  margin: 0px;
  opacity: 0.2;
}

.cardrating {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(8, 13, 39, 0.9);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 700;
  color: #eaedff;
  box-shadow: 0 8px 18px rgba(60, 82, 217, 0.35);
  display: flex;
  align-items: center;
  gap: 6px;
}

.cardTopRow .cardrating {
  position: static;
  box-shadow: 0 6px 14px rgba(60, 82, 217, 0.25);
}

.saveBtn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--drawer-border);
  background: rgba(8, 13, 39, 0.9);
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(60, 82, 217, 0.35);
  font-size: 16px;

  &.saved {
    background: rgba(8, 13, 39, 0.9);
  }
}

.statusIcon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  display: block;
}

.visitBtn {
  position: absolute;
  top: 10px;
  right: 50px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--drawer-border);
  background: rgba(8, 13, 39, 0.9);
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(60, 82, 217, 0.35);
  font-size: 16px;

  &.visited {
    background: rgba(8, 13, 39, 0.9);
  }
}

.cardBody {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  background: linear-gradient(rgba(16, 9, 28, 0), rgba(0, 0, 0, 0.85) 29.83%, rgba(14, 14, 14, 1));
  border-radius: 14px;
  padding: 20px 12px 12px;
}

.cardTopRow {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  z-index: 2;
}

.cardTopActions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cardIconPill {
  width: 30px;
  height: 30px;

  &.active {
    border-color: rgba(46, 242, 255, 0.45);
    box-shadow: 0 0 14px rgba(46, 242, 255, 0.25);
  }
}

.cardTitle {
  font-size: 14px;
  font-weight: 800;
  margin: 0 0 6px;
  line-height: 1.2;
  color: #eaedff;
}

.cardMeta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  color: rgba(233, 228, 255, 0.7);
}

.cardDetailsRow {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
}

.cardDetailsBtn {
  padding: 0;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 10px;
  font-weight: 300;
  letter-spacing: .06em;
  cursor: pointer;
  height: auto;
  margin: 10px 0px;

  &:hover {
    background: none;
  }
}



.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(25, 89, 173, 0.16);
  border: 1px solid rgba(25, 89, 173, 0.3);
  font-size: 12px;
  color: #efe9ff;
}

.foundByPill {
  background: #1a3662!important;
  border-color: rgba(46, 242, 255, 0.35);
  color: #e6f6ff;
  gap: 10px;
  padding: 6px 12px;
  align-items: center;
  display: flex;
  min-width: 0;
}

.foundByAvatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--xplrit-blue), var(--xplrit-accent));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
}

.foundByCopy {
  display: grid;
  gap: 2px;
  line-height: 1.2;
  min-width: 0;
}

.foundByLabel {
  font-size: 10px;
  letter-spacing: .08em;
  color: rgba(233, 228, 255, 0.65);
  text-transform: uppercase;
}

.foundByName {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
}

.foundByLevel {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
  color: rgba(233, 228, 255, 0.8);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 2px 6px;
  margin-left: auto;
}

.pillIcon {
  font-size: 13px;
  line-height: 1;
  display: inline-block;
  transform: translateY(-.5px);
}

.pillIconImg,
.actListIcon,
.pinIcon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  display: inline-block;
  vertical-align: middle;
  margin-right: 5px;
}

.pinIcon {
  width: 22px;
  height: 22px;
}

/* Sunset badge */
.sunsetBadge {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .02em;
  color: #fff;
  background: linear-gradient(135deg, #253575, #162561);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
  display: flex;
  align-items: center;
  gap: 8px;

  &.muted {
    background: linear-gradient(135deg, #e5e7eb, #d1d5db);
    color: #374151;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
  }
}

.weatherIcon {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  transform: translateY(-1px);

  & img {
    width: 16px;
    height: 16px;
    display: block;
  }
}

.wxIcon {
  display: inline-flex;
  align-items: center;

  & img {
    width: 16px;
    height: 16px;
    display: block;
  }
}

.wxInlineIcon {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin-right: 4px;

  & img {
    width: 14px;
    height: 14px;
    display: block;
  }
}

.wxDot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: rgba(16, 24, 40, .25);
  display: inline-block;
}

/* Mobile bottom sheet overrides */
@media (max-width: 980px) {
  .panel {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 10px;
    height: 44dvh;
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: var(--shadow);
    z-index: 700;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;

    &.collapsed {
      transform: translateY(calc(100% - 60px));
    }
  }

  .activeFilters {
    top: 0;
    border-top: none;
  }
}