/* Meditopia WellnessPass — post & story generator */

:root {
  --purple:      #432778;
  --purple-deep: #2F1B54;
  --coral:       #FFA17F;

  --bg:      #14101f;
  --surface: #1c1730;
  --line:    #2e2748;
  --text:    #f2eefb;
  --muted:   #a79fc0;

  --radius: 14px;
}

* { box-sizing: border-box; }

/* .drop / .thumb are flex, which would otherwise beat the [hidden] default */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(1100px 700px at 85% -10%, rgba(67, 39, 120, .55), transparent 60%),
    radial-gradient(800px 600px at 5% 105%, rgba(255, 161, 127, .10), transparent 60%),
    var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }

/* ── top bar ──────────────────────────────────────────────────── */
.topbar {
  padding: 22px 28px;
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 14px; }

.brand h1 { font-size: 17px; }

.brand p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }

.mark {
  width: 38px; height: 38px;
  flex: none;
  border-radius: 10px;
  background: url("assets/meditopia-logo-512w.png") center / cover no-repeat;
  box-shadow: 0 6px 18px rgba(143, 107, 255, .35);
}

/* ── layout ───────────────────────────────────────────────────── */
.layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  padding: 28px;
  max-width: 1360px;
  margin: 0 auto;
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; padding: 20px; }
}

/* ── control panel ────────────────────────────────────────────── */
.panel {
  position: sticky;
  top: 28px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

@media (max-width: 900px) { .panel { position: static; } }

.block h2 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin-bottom: 12px;
}

.note { margin: 0 0 12px; font-size: 12.5px; color: var(--muted); }

.empty { margin: 0; font-size: 13px; color: var(--muted); }

/* dropzone */
.drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 28px 16px;
  text-align: center;
  border: 1.5px dashed #3d3462;
  border-radius: 12px;
  background: rgba(255, 255, 255, .02);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}

.drop:hover, .drop.over { border-color: #8f6bff; background: rgba(143, 107, 255, .08); }

.drop.slim { padding: 16px; }

.drop-icon {
  width: 26px; height: 26px;
  color: #b9a4ff;
  margin-bottom: 2px;
}

.drop-title { font-weight: 600; font-size: 14px; }

.drop-hint { font-size: 12px; color: var(--muted); }

/* thumbnail row */
.thumb {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .02);
}

.thumb img {
  width: 46px; height: 46px;
  flex: none;
  object-fit: cover;
  border-radius: 8px;
}

.thumb-meta { min-width: 0; flex: 1; display: flex; flex-direction: column; }

.thumb-meta strong {
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thumb-meta span { font-size: 12px; color: var(--muted); }

/* switch */
.switch {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  cursor: pointer;
  margin-bottom: 12px;
}

.switch input { position: absolute; opacity: 0; pointer-events: none; }

.switch .track {
  width: 38px; height: 22px;
  flex: none;
  border-radius: 99px;
  background: #352d55;
  position: relative;
  transition: background .18s;
}

.switch .track::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform .18s;
}

.switch input:checked + .track { background: #8f6bff; }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid #b9a4ff; outline-offset: 2px; }

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 14px;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  background: #2b2447;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: filter .15s, transform .05s;
}

.btn:hover:not(:disabled) { filter: brightness(1.15); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn em {
  font-style: normal;
  font-weight: 400;
  font-size: 12px;
  opacity: .7;
}

.btn.primary {
  background: linear-gradient(135deg, var(--purple), #6b45c4);
  border-color: transparent;
}

.btn.ghost { background: transparent; }

.btn.sm { padding: 7px 10px; font-size: 12.5px; }

.dl { display: flex; flex-direction: column; gap: 9px; }

/* ── previews ─────────────────────────────────────────────────── */
.previews {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.card header { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.card header h3 { font-size: 14px; }
.card header span { font-size: 12px; color: var(--muted); }

.stage {
  position: relative;
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  background: #0d0a16;
  touch-action: none;
}

.stage.post  { aspect-ratio: 1080 / 1350; }
.stage.story { aspect-ratio: 1080 / 1920; }

.stage canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.stage.ready { cursor: grab; }
.stage.ready:active { cursor: grabbing; }

.controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.controls label {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.controls input[type=range] {
  flex: 1;
  min-width: 0;
  accent-color: #8f6bff;
}

.tip { margin: 0; font-size: 11.5px; color: var(--muted); opacity: .8; }

.card.disabled { opacity: .55; pointer-events: none; }

/* ── toast ────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 20px);
  padding: 11px 18px;
  background: #2b2447;
  border: 1px solid var(--line);
  border-radius: 99px;
  font-size: 13.5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }
