/* Dream Lands — Preferences section + For You strip */

/* ── Inline prefs section ── */
.prefs-section {
  border-radius: var(--radius);
  background: var(--card-bg);
  border: 1px solid var(--border);
  padding: 1.25rem;
  margin: 0 1rem 1.5rem;
}

.prefs-body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.prefs-group {
  display: flex;
  flex-direction: column;
  gap: .55rem;
}

.prefs-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
}

.prefs-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.prefs-budget-display {
  font-size: .82rem;
  font-weight: 600;
  color: var(--green-light);
}

/* ── Chips with checkbox indicator ── */
.prefs-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}

.prefs-chip {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .38rem .75rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--card-bg-2);
  color: var(--muted);
  font-size: .8rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .12s, color .12s, background .12s;
  user-select: none;
}

/* Unchecked box — hollow square */
.prefs-chip-box {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 1.5px solid currentColor;
  border-radius: 3px;
  flex-shrink: 0;
  opacity: .5;
}

/* Checked checkmark SVG */
.prefs-chip-check {
  flex-shrink: 0;
  color: var(--green-light);
}

.prefs-chip svg:not(.prefs-chip-check) {
  flex-shrink: 0;
  opacity: .7;
}

.prefs-chip.active {
  border-color: var(--green-light);
  background: rgba(76, 175, 80, .12);
  color: var(--text);
}

.prefs-chip.active svg:not(.prefs-chip-check) {
  opacity: 1;
}

/* ── Dual-handle range slider ── */
.prefs-dual-slider {
  position: relative;
  height: 2.4rem;
  display: flex;
  align-items: center;
}

.prefs-slider-track {
  position: absolute;
  left: 0; right: 0;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  pointer-events: none;
}

.prefs-slider-fill {
  position: absolute;
  top: 0; bottom: 0;
  border-radius: 2px;
  background: var(--green-light);
}

.prefs-range {
  position: absolute;
  width: 100%;
  height: 4px;
  appearance: none;
  background: transparent;
  pointer-events: none;
  outline: none;
}

.prefs-range::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--green-light);
  border: 2px solid var(--bg);
  cursor: pointer;
  pointer-events: all;
  box-shadow: 0 1px 5px rgba(0,0,0,.5);
}

.prefs-range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--green-light);
  border: 2px solid var(--bg);
  cursor: pointer;
  pointer-events: all;
}

.prefs-range-min { z-index: 2; }
.prefs-range-max { z-index: 3; }

/* Tick labels below slider */
.prefs-ticks {
  position: relative;
  height: 1.3rem;
  margin-top: .2rem;
}

.prefs-tick {
  position: absolute;
  transform: translateX(-50%);
  font-size: .6rem;
  color: var(--muted);
  white-space: nowrap;
  /* Show only every other tick to avoid crowding on small screens */
}

/* Hide odd ticks on narrow screens */
@media (max-width: 440px) {
  .prefs-tick:nth-child(even) { display: none; }
}

/* ── Save button + message ── */
.prefs-footer {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.prefs-save-btn {
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: .6rem 1.4rem;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
}

.prefs-save-btn:hover { background: #1b5e20; }

.prefs-save-msg {
  font-size: .78rem;
  color: var(--green-light);
}

/* ── For You strip ── */
#for-you-section .section-head {
  align-items: center;
}

.for-you-title-row {
  display: flex;
  align-items: center;
  gap: .45rem;
}

.for-you-edit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .25rem;
  color: var(--muted);
  cursor: pointer;
  line-height: 0;
}

.for-you-edit-btn:hover {
  color: var(--green-light);
  border-color: var(--green-light);
}

.for-you-row {
  padding: 0 1rem .5rem;
}

#for-you-section .reel-card {
  flex: 0 0 220px;
  scroll-snap-align: start;
}

.prefs-empty-cta {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.prefs-empty {
  color: var(--muted);
  font-size: .85rem;
  margin: 0;
}

/* Section see-all / action button */
.section-see-all {
  font-size: .78rem;
  font-weight: 600;
  color: var(--green-light);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  white-space: nowrap;
}

/* ── Preferences dialog ── */
.prefs-dialog-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  z-index: 1000;
  align-items: flex-end;
  justify-content: center;
}

.prefs-dialog-backdrop.open {
  display: flex;
}

.prefs-dialog {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 18px 18px 0 0;
  width: 100%;
  max-width: 620px;
  max-height: 90dvh;
  overflow-y: auto;
  padding: 1.25rem;
  animation: dlg-slide-up .22s ease;
}

@keyframes dlg-slide-up {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.prefs-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.prefs-dialog-title {
  font-size: 1.05rem;
  font-weight: 700;
}

.prefs-dialog-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: .2rem;
  display: flex;
}

.prefs-dialog-close:hover { color: var(--text); }

@media (min-width: 480px) {
  .prefs-dialog {
    border-radius: 18px;
    margin-bottom: 2rem;
  }
}

/* Mobile tweaks */
@media (max-width: 480px) {
  .prefs-section {
    margin: 0 0 1.25rem;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
}
