/* ── Mental Health Domain — Custom Mechanic Styles ── */

:root {
  --mh-primary: #0D7377;
  --mh-light: #26A69A;
  --mh-accent: #A8E6CF;
  --mh-warm: #4DB6AC;
  --mh-neutral: #90A4AE;
  --mh-cool: #78909C;
  --mh-deep: #546E7A;
  --mh-bg: #F5F5F5;
  --mh-text: #37474F;
  --mh-text-muted: #90A4AE;
  --mh-snap: cubic-bezier(0.34, 1.56, 0.64, 1);
  --mh-gentle: cubic-bezier(0.33, 1, 0.68, 1);
}

/* Wrapper */
.mh-mech {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) 0;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

/* SVG scene container */
.mh-scene {
  width: 100%;
  border-radius: var(--radius-lg, 16px);
  overflow: hidden;
  position: relative;
  background: var(--mh-bg);
}
.mh-scene svg {
  display: block;
  width: 100%;
  height: auto;
}

/* ── Horizontal Slider ── */
.mh-slider-wrap {
  width: 100%;
  padding: 0 var(--space-sm);
  position: relative;
}
.mh-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 4px;
  outline: none;
  background: linear-gradient(90deg, var(--mh-warm), var(--mh-neutral), var(--mh-cool), var(--mh-deep));
  cursor: pointer;
}
.mh-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--mh-primary);
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  cursor: grab;
  transition: transform 0.15s var(--mh-snap);
}
.mh-slider::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.12);
}
.mh-slider::-moz-range-thumb {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--mh-primary);
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  cursor: grab;
}

/* Vertical slider (Q9) */
.mh-slider-vertical-wrap {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  height: 200px;
  width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mh-slider-vertical {
  -webkit-appearance: none;
  appearance: none;
  width: 200px;
  height: 8px;
  border-radius: 4px;
  outline: none;
  background: linear-gradient(90deg, var(--mh-deep), var(--mh-cool), var(--mh-neutral), var(--mh-warm));
  transform: rotate(-90deg);
  transform-origin: center;
  cursor: pointer;
}
.mh-slider-vertical::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--mh-primary);
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  cursor: grab;
}
.mh-slider-vertical::-moz-range-thumb {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--mh-primary);
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  cursor: grab;
}

/* ── Label Chips ── */
.mh-chips {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
  width: 100%;
}
.mh-chip {
  font-size: 12px;
  font-weight: 400;
  color: var(--mh-text-muted);
  padding: 4px 10px;
  border-radius: 20px;
  background: transparent;
  transition: all 0.2s var(--mh-gentle);
  white-space: nowrap;
}
.mh-chip.active {
  font-weight: 600;
  color: #fff;
  background: var(--mh-primary);
}

/* ── Continue Button ── */
.mh-continue {
  margin-top: var(--space-md);
}

/* ── Hint text ── */
.mh-hint {
  font-size: 13px;
  color: var(--mh-text-muted);
  text-align: center;
  margin-top: 4px;
  opacity: 0.7;
  transition: opacity 0.3s;
}

/* ── Ambient Keyframes ── */
@keyframes mh-breath {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.01); }
}
@keyframes mh-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
@keyframes mh-drift {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(3px); }
}
@keyframes mh-twinkle {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}
@keyframes mh-rain-fall {
  0% { transform: translateY(-10px); opacity: 0.8; }
  100% { transform: translateY(60px); opacity: 0; }
}
@keyframes mh-float-up {
  0% { transform: translateY(0); opacity: 0.2; }
  100% { transform: translateY(-30px); opacity: 0; }
}
@keyframes mh-spin-slow {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
@keyframes mh-wobble {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(var(--mh-wobble-deg, 2deg)); }
  75% { transform: rotate(calc(-1 * var(--mh-wobble-deg, 2deg))); }
}
@keyframes mh-focus-breath {
  0%, 100% { filter: blur(0px); }
  50% { filter: blur(0.8px); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .mh-mech * {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
}
