/* ==========================================================================
   MOVO · Editable System · Styles
   ========================================================================== */

/* ---------- Image slot ---------- */
.edit-img-slot {
  position: relative;
  display: grid;
  place-items: center;
  background-color: var(--bg-card);
  background-image:
    repeating-linear-gradient(135deg,
      rgba(165, 107, 255, 0.08) 0 12px,
      rgba(78, 207, 217, 0.05) 12px 24px);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border: 1px dashed var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
  color: var(--text-3);
  cursor: pointer;
  transition: border-color var(--t-fast), transform var(--t-fast);
  min-height: 120px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.edit-img-slot::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 30%, rgba(165, 107, 255, 0.14), transparent 40%),
    radial-gradient(circle at 70% 70%, rgba(78, 207, 217, 0.10), transparent 40%);
  pointer-events: none;
}
.edit-img-slot .edit-img-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 16px;
  transition: opacity var(--t-fast);
}
.edit-img-label { color: var(--text-2); font-weight: 600; font-size: 12px; margin-bottom: 4px; letter-spacing: 0.03em; }
.edit-img-hint  { color: var(--text-4); font-size: 11px; }
.edit-img-slot:hover {
  border-color: var(--brand-purple);
}
.edit-img-slot.drag {
  border-color: var(--brand-cyan);
  transform: scale(1.01);
  box-shadow: 0 0 0 4px rgba(78, 207, 217, 0.2);
}
.edit-img-slot.has-image {
  border: 1px solid transparent;
  background-color: transparent;
}
.edit-img-slot.has-image::before { opacity: 0; }
.edit-img-slot.has-image .edit-img-inner { opacity: 0; }
.edit-img-slot.has-image:hover .edit-img-inner {
  opacity: 1;
  backdrop-filter: blur(6px);
}
.edit-img-slot.has-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 70%, rgba(0,0,0,0.4));
  opacity: 0;
  transition: opacity var(--t-fast);
  pointer-events: none;
}
.edit-img-slot.has-image:hover::after { opacity: 1; }

/* aspect helpers */
.edit-img-slot.ratio-16-9 { aspect-ratio: 16 / 9; }
.edit-img-slot.ratio-4-3  { aspect-ratio: 4 / 3; }
.edit-img-slot.ratio-1-1  { aspect-ratio: 1 / 1; }
.edit-img-slot.ratio-3-2  { aspect-ratio: 3 / 2; }
.edit-img-slot.ratio-3-4  { aspect-ratio: 3 / 4; }
.edit-img-slot.ratio-21-9 { aspect-ratio: 21 / 9; }

/* ---------- Editable text markers (only visible when editing) ---------- */
[data-editable-text] {
  position: relative;
  white-space: pre-line;
}
body.mt-editing [data-editable-text] {
  outline: 1px dashed rgba(78, 207, 217, 0.45);
  outline-offset: 3px;
  border-radius: 4px;
  cursor: text;
  transition: outline-color var(--t-fast);
}
body.mt-editing [data-editable-text]:hover {
  outline-color: var(--brand-cyan);
  background: rgba(78, 207, 217, 0.06);
}
[data-editable-text].mt-flash {
  animation: mtFlash 0.5s ease;
}
@keyframes mtFlash {
  0%   { background: rgba(78, 207, 217, 0.3); }
  100% { background: transparent; }
}

/* ---------- Tweaks drawer ---------- */
.movo-tweaks {
  position: fixed;
  top: 0; right: 0;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 100vh;
  background: rgba(14, 14, 22, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-left: 1px solid var(--border);
  color: var(--text-2);
  z-index: 9999;
  transform: translateX(100%);
  transition: transform 0.36s var(--ease-brand);
  display: flex;
  flex-direction: column;
  box-shadow: -30px 0 80px rgba(0,0,0,0.5);
  font-family: 'Inter', sans-serif;
}
body.mt-open .movo-tweaks { transform: translateX(0); }

.mt-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border-2);
}
.mt-title { color: white; font-weight: 700; font-size: 15px; }
.mt-sub { color: var(--text-4); font-size: 12px; margin-top: 4px; }
.mt-close {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-2);
  color: var(--text-2);
  width: 32px; height: 32px;
  border-radius: 8px;
  font-size: 20px;
  cursor: pointer;
  flex: none;
  transition: background var(--t-fast);
}
.mt-close:hover { background: rgba(255,255,255,0.12); color: white; }

.mt-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  padding: 12px 20px;
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--border-2);
  font-size: 12px;
  color: var(--text-3);
}
.mt-summary b { color: white; font-weight: 700; }
.mt-summary button {
  background: transparent;
  border: 1px solid var(--border-2);
  color: var(--text-3);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
  transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast);
}
.mt-summary .mt-export {
  margin-left: auto;
  color: var(--brand-cyan);
  border-color: rgba(78, 207, 217, 0.35);
}
.mt-summary .mt-export:hover {
  color: white;
  border-color: var(--brand-cyan);
  background: rgba(78, 207, 217, 0.1);
}
.mt-summary .mt-reset {
  color: var(--text-3);
}
.mt-summary .mt-reset:hover { color: var(--accent-red); border-color: var(--accent-red); }

.mt-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0 40px;
}
.mt-body::-webkit-scrollbar { width: 8px; }
.mt-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 4px; }

.mt-group {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-2);
}
.mt-group h3 {
  color: var(--brand-cyan);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 0 0 12px;
}
.mt-row {
  margin-bottom: 14px;
}
.mt-row label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}
.mt-label { color: var(--text-2); font-size: 13px; font-weight: 600; }
.mt-key {
  color: var(--text-5);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
}
.mt-row input,
.mt-row textarea {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-2);
  color: var(--text-1);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  transition: border-color var(--t-fast);
  resize: vertical;
}
.mt-row input:focus,
.mt-row textarea:focus {
  outline: none;
  border-color: var(--brand-purple);
  background: rgba(255,255,255,0.06);
}
.mt-row textarea { min-height: 60px; line-height: 1.45; }

.mt-sections {
  background: rgba(78, 207, 217, 0.04);
}
.mt-section-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  color: var(--text-2);
  font-size: 13px;
}
.mt-section-row + .mt-section-row {
  border-top: 1px solid var(--border-2);
}
.mt-section-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mt-section-row button {
  min-width: 70px;
  border: 1px solid rgba(78, 207, 217, 0.45);
  background: rgba(78, 207, 217, 0.1);
  color: white;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 11px;
  cursor: pointer;
}
.mt-section-row button[aria-pressed="false"] {
  border-color: var(--border-2);
  background: rgba(255,255,255,0.03);
  color: var(--text-4);
}

.mt-empty {
  padding: 24px 20px;
  color: var(--text-3);
  line-height: 1.5;
}
.mt-empty h3 {
  color: white;
  font-size: 16px;
  margin: 0 0 8px;
}
.mt-empty p {
  margin: 0 0 16px;
}
.mt-page-list {
  display: grid;
  gap: 8px;
}
.mt-page-list a {
  color: var(--text-2);
  text-decoration: none;
  border: 1px solid var(--border-2);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.04);
}
.mt-page-list a:hover {
  color: white;
  border-color: var(--brand-cyan);
}

/* ---------- Floating toggle FAB ---------- */
.mt-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: rgba(14, 14, 22, 0.85);
  backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  z-index: 9998;
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
  transition: transform var(--t-fast), border-color var(--t-fast);
}
.mt-fab:hover {
  transform: translateY(-2px);
  border-color: var(--brand-cyan);
  color: white;
}
.mt-fab svg { width: 16px; height: 16px; }
body.mt-open .mt-fab { display: none; }

@media (max-width: 600px) {
  .movo-tweaks { width: 100%; }
}
