/* ============================================================
   mg.css - HALAMAN /motion-graphic/ (G538, Webi)
   Tema: dark navy situs (--bg-dark #05060f) + aksen ungu-pink
   sesuai mockup Boss RK-F161BB. Navbar/footer global tetap dari
   /styles.css - file ini hanya scope halaman motion graphic.
   G540 (order Boss RK-F4EYIN): fix dropdown option putih-di-putih
   (color-scheme dark + styling option native popup) + style label
   & select logo custom + chip catatan skill.
   ============================================================ */

.mg-page { background:
  radial-gradient(900px 420px at 85% -5%, rgba(147, 51, 234, 0.14), transparent 60%),
  radial-gradient(700px 380px at 8% 12%, rgba(107, 124, 255, 0.12), transparent 55%),
  var(--bg-dark);
}

/* ---------- layout utama: sidebar + konten ---------- */
.mg-wrap { width: 100%; max-width: 1280px; margin: 0 auto; padding: 28px 24px 60px; }
.mg-layout { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 24px; align-items: start; }

/* ---------- sidebar ---------- */
.mg-side { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 8px; }
.mg-side a, .mg-side button.mg-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 12px;
  color: var(--text-muted-light); font-size: 0.95rem; font-weight: 500;
  border: 1px solid transparent; background: transparent; cursor: pointer; text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
  min-height: 44px; width: 100%;
}
.mg-side a:hover, .mg-side button.mg-nav-item:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.mg-side a.active { color: #fff; background: linear-gradient(135deg, rgba(107, 124, 255, 0.22), rgba(147, 51, 234, 0.18)); border-color: rgba(107, 124, 255, 0.35); }
.mg-side svg { flex: 0 0 auto; }

.mg-side-card {
  margin-top: 18px; padding: 20px 16px; border-radius: 16px; text-align: center;
  background: linear-gradient(180deg, rgba(107, 124, 255, 0.14), rgba(147, 51, 234, 0.10));
  border: 1px solid rgba(107, 124, 255, 0.28);
}
.mg-side-ic { display: inline-flex; width: 44px; height: 44px; align-items: center; justify-content: center; border-radius: 12px; color: #fff; background: linear-gradient(135deg, #6b7cff, #9333ea); margin-bottom: 10px; }
.mg-side-title { font-size: 0.92rem; font-weight: 600; color: #fff; margin-bottom: 12px; }
.mg-side-sub { font-size: 0.78rem; color: var(--text-muted-light); margin-top: 10px; }
.mg-side-btn { width: 100%; }

/* ---------- hero ---------- */
.mg-hero {
  position: relative; overflow: hidden; border-radius: 20px; padding: 30px 30px 26px;
  background: linear-gradient(120deg, rgba(107, 124, 255, 0.16), rgba(147, 51, 234, 0.12) 55%, rgba(236, 72, 153, 0.10));
  border: 1px solid var(--line-light);
}
.mg-hero-badge { display: inline-block; padding: 5px 14px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; color: #fff; background: linear-gradient(135deg, #6b7cff, #9333ea); margin-bottom: 14px; }
.mg-hero h1 {
  font-size: clamp(2rem, 4.6vw, 2.9rem); line-height: 1.1; font-weight: 800; letter-spacing: -0.02em;
  background: linear-gradient(90deg, #ffffff 20%, #c4b5fd 60%, #f0abfc);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: 10px;
}
.mg-hero p.lead { max-width: 640px; color: var(--text-muted-light); font-size: 0.98rem; margin-bottom: 18px; }
.mg-hero-feats { display: flex; flex-wrap: wrap; gap: 10px; }
.mg-feat { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line-light); font-size: 0.82rem; color: var(--text-light); }
.mg-feat strong { color: #fff; font-weight: 600; }
.mg-feat small { display: block; color: var(--text-muted-light); font-weight: 400; font-size: 0.72rem; }
.mg-hero-robot {
  position: absolute; right: 4%; top: 50%; transform: translateY(-50%);
  width: 200px; height: 200px; border-radius: 50%; pointer-events: none;
  background:
    radial-gradient(circle at 32% 30%, rgba(255, 255, 255, 0.35), transparent 42%),
    radial-gradient(circle at 50% 55%, rgba(147, 51, 234, 0.55), rgba(107, 124, 255, 0.35) 55%, transparent 72%);
  filter: blur(0.5px);
}
.mg-hero-robot::after {
  content: ""; position: absolute; inset: 28%; border-radius: 26%;
  background: linear-gradient(145deg, #e9eaff, #b7b9ff);
  box-shadow: 0 12px 40px rgba(107, 124, 255, 0.45);
}
.mg-hero-robot::before {
  content: ""; position: absolute; inset: 42% 46% 52% 30%; border-radius: 999px;
  background: linear-gradient(145deg, #6b7cff, #9333ea); z-index: 1;
}
@media (max-width: 900px) { .mg-hero-robot { display: none; } }

/* ---------- banner lisensi ---------- */
.mg-banner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px;
  margin-top: 22px; padding: 16px 20px; border-radius: 16px; font-size: 0.92rem;
}
.mg-banner.warn { background: rgba(245, 158, 11, 0.10); border: 1px solid rgba(245, 158, 11, 0.35); color: #fcd34d; }
.mg-banner.warn strong { color: #fbbf24; }
.mg-banner.ok { background: rgba(16, 185, 129, 0.10); border: 1px solid rgba(16, 185, 129, 0.35); color: #6ee7b7; }
.mg-banner.ok strong { color: #34d399; }
.mg-banner .btn { flex: 0 0 auto; }

/* ---------- grid konten: builder + panel kanan ---------- */
.mg-cols { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; margin-top: 22px; align-items: start; }

.mg-panel {
  background: var(--bg-card-dark); border: 1px solid var(--line-light);
  border-radius: 16px; padding: 20px;
}
.mg-panel h2 { font-size: 1.02rem; color: #fff; font-weight: 700; margin-bottom: 4px; }
.mg-panel .mg-sub { color: var(--text-muted-light); font-size: 0.83rem; margin-bottom: 14px; }

/* builder */
#builder { position: relative; }
#builder.locked .mg-lockable { filter: blur(5px); opacity: 0.55; pointer-events: none; user-select: none; }
.mg-lock-note { display: none; position: absolute; inset: 0; z-index: 2; align-items: center; justify-content: center; text-align: center; padding: 20px; }
#builder.locked .mg-lock-note { display: flex; }
.mg-lock-note span { max-width: 320px; font-size: 0.9rem; color: var(--text-muted-light); }
.mg-step { display: flex; align-items: center; gap: 10px; font-size: 0.98rem; font-weight: 700; color: #fff; margin: 18px 0 10px; }
.mg-step:first-child { margin-top: 0; }
.mg-step em { font-style: normal; display: inline-flex; width: 26px; height: 26px; align-items: center; justify-content: center; border-radius: 8px; background: linear-gradient(135deg, #6b7cff, #9333ea); font-size: 0.85rem; }
.mg-select-wrap { position: relative; }
.mg-select {
  width: 100%; appearance: none; -webkit-appearance: none;
  padding: 13px 44px 13px 46px; border-radius: 12px; font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line-light); color: #fff; cursor: pointer;
  min-height: 48px;
}
.mg-select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.mg-select-wrap svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--accent); pointer-events: none; }
.mg-select-wrap .mg-caret { left: auto; right: 14px; width: 16px; height: 16px; transform: translateY(-50%) rotate(90deg); }

/* ---------- G540: fix dropdown option putih-di-putih (order Boss RK-F4EYIN) ----------
   Native popup <option> di Windows Chrome memakai background putih;
   teks option mewarisi color:#fff dari .mg-select = tak terbaca.
   Fix: color-scheme dark + warna eksplisit per option. */
.mg-select { color-scheme: dark; }
.mg-select option, .mg-select optgroup { background-color: #10131e; color: #e8eaf2; }
.mg-select option:checked, .mg-select option:hover { background-color: #6b7cff; color: #ffffff; }

/* ---------- G540: opsi logo custom ---------- */
.mg-logo-label { font-size: 0.8rem; font-weight: 600; color: var(--text-muted-light); margin: 14px 0 0; }
.mg-logo-wrap { margin-top: 8px; }

/* ---------- G540: catatan skill terpakai ---------- */
.mg-skill-note { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 0.75rem; color: var(--text-muted-light); margin-bottom: 10px; }
.mg-skill-note svg { color: var(--accent); flex: 0 0 auto; }
.mg-skill-note code { font-size: 0.72rem; color: #c3caff; background: rgba(107, 124, 255, 0.12); border: 1px solid rgba(107, 124, 255, 0.3); border-radius: 6px; padding: 2px 8px; }
.mg-skill-note b { color: #cbd2ea; }

.mg-prompt-card { border: 1px solid var(--line-light); border-radius: 14px; background: rgba(255, 255, 255, 0.03); padding: 16px; margin-bottom: 12px; }
.mg-prompt-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.mg-prompt-head h3 { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; color: #fff; font-weight: 600; }
.mg-prompt-head h3 svg { color: var(--accent); }
.mg-prompt-text { font-size: 0.88rem; line-height: 1.65; color: #cbd2ea; white-space: pre-wrap; word-break: break-word; }
#mg-prompt-neg { color: #f3b9b9; }

.mg-opts-label { font-size: 0.85rem; font-weight: 600; color: #fff; margin: 16px 0 10px; }
.mg-opts { display: flex; flex-wrap: wrap; gap: 10px; }
.mg-opt { display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line-light); font-size: 0.8rem; color: var(--text-muted-light); }
.mg-opt svg { color: var(--accent); flex: 0 0 auto; }
.mg-opt b { display: block; font-size: 0.83rem; color: #fff; font-weight: 600; }
.mg-builder-actions { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 18px; }

/* panel kanan */
.mg-aside { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 88px; }
.mg-tips { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.mg-tips li { display: flex; gap: 10px; font-size: 0.84rem; color: #cbd2ea; line-height: 1.5; }
.mg-check { flex: 0 0 auto; display: inline-flex; width: 20px; height: 20px; align-items: center; justify-content: center; border-radius: 50%; background: rgba(16, 185, 129, 0.18); color: #34d399; margin-top: 1px; }

.mg-example { border-radius: 12px; overflow: hidden; border: 1px solid var(--line-light); }
.mg-example-visual {
  position: relative; height: 150px; display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(220px 120px at 70% 20%, rgba(147, 51, 234, 0.4), transparent 65%),
    linear-gradient(150deg, #101635, #0a0e27 60%, #1b1140);
}
.mg-example-visual span { font-size: 1.25rem; font-weight: 800; color: #fff; text-shadow: 0 2px 18px rgba(147, 51, 234, 0.8); text-align: center; padding: 0 16px; }
.mg-example-meta { padding: 12px 14px; font-size: 0.8rem; color: var(--text-muted-light); display: flex; flex-direction: column; gap: 4px; }
.mg-example-meta b { color: #fff; font-weight: 600; }
.mg-help-note { font-size: 0.85rem; color: var(--text-muted-light); margin-bottom: 12px; }

/* ---------- galeri template ---------- */
.mg-gallery { margin-top: 44px; }
.mg-gallery-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.mg-gallery-head h2 { font-size: 1.5rem; font-weight: 800; color: #fff; }
.mg-gallery-head p { color: var(--text-muted-light); font-size: 0.9rem; max-width: 560px; margin-top: 6px; }
.mg-tools { display: flex; gap: 10px; flex-wrap: wrap; }
.mg-search { position: relative; }
.mg-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted-light); pointer-events: none; }
.mg-search input {
  padding: 11px 14px 11px 38px; border-radius: 12px; min-width: 240px; font-size: 0.88rem;
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line-light); color: #fff;
  min-height: 44px;
}
.mg-search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.mg-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.mg-chip { padding: 9px 16px; border-radius: 999px; font-size: 0.83rem; font-weight: 500; cursor: pointer; color: var(--text-muted-light); background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line-light); transition: all 0.15s ease; min-height: 38px; }
.mg-chip:hover { color: #fff; border-color: rgba(107, 124, 255, 0.5); }
.mg-chip.active { color: #fff; background: linear-gradient(135deg, #6b7cff, #9333ea); border-color: transparent; }

.mg-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.mg-card { background: var(--bg-card-dark); border: 1px solid var(--line-light); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease; }
.mg-card:hover { transform: translateY(-3px); border-color: rgba(107, 124, 255, 0.5); box-shadow: 0 14px 34px rgba(7, 10, 22, 0.5); }
.mg-cover { position: relative; height: 128px; border-radius: 12px; overflow: hidden; display: flex; align-items: center; justify-content: center; color: #fff; margin-bottom: 12px; }
.mg-cover-ic { position: relative; z-index: 1; opacity: 0.95; filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.35)); }
.mg-cover-glow { position: absolute; inset: 0; background: radial-gradient(120px 70px at 75% 15%, rgba(255, 255, 255, 0.28), transparent 60%); }
.mg-card-title { font-size: 0.95rem; font-weight: 700; color: #fff; margin-bottom: 3px; }
.mg-card-meta { font-size: 0.76rem; color: var(--text-muted-light); margin-bottom: 9px; }
.mg-card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.mg-tag { padding: 3px 10px; border-radius: 999px; font-size: 0.68rem; background: rgba(107, 124, 255, 0.12); border: 1px solid rgba(107, 124, 255, 0.3); color: #c3caff; }
.mg-card .mg-copy { margin-top: auto; }

.mg-empty { grid-column: 1 / -1; text-align: center; padding: 44px 20px; color: var(--text-muted-light); border: 1px dashed var(--line-light); border-radius: 16px; font-size: 0.92rem; }
.mg-empty strong { color: #fff; }

/* ---------- modal panduan ---------- */
.mg-overlay { position: fixed; inset: 0; z-index: 90; background: rgba(3, 4, 10, 0.72); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 20px; }
/* QA-fix G538: [hidden] WAJIB menang atas display:flex (modal jangan tampil sebelum dipanggil) */
.mg-overlay[hidden] { display: none; }
.mg-modal { width: 100%; max-width: 560px; max-height: 82vh; overflow-y: auto; background: var(--bg-card-dark); border: 1px solid var(--line-light); border-radius: 18px; padding: 24px; }
.mg-modal h3 { font-size: 1.15rem; color: #fff; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mg-modal ol { padding-left: 20px; display: flex; flex-direction: column; gap: 10px; }
.mg-modal ol li { font-size: 0.9rem; color: #cbd2ea; line-height: 1.6; }
.mg-modal-close { background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line-light); color: #fff; width: 34px; height: 34px; border-radius: 10px; font-size: 1.1rem; cursor: pointer; }

/* ---------- toast ---------- */
.mg-toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(16px);
  background: #171d33; color: #fff; border: 1px solid rgba(107, 124, 255, 0.45);
  padding: 11px 20px; border-radius: 999px; font-size: 0.86rem; z-index: 99;
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 10px 30px rgba(7, 10, 22, 0.6);
}
.mg-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .mg-cols { grid-template-columns: 1fr; }
  .mg-aside { position: static; flex-direction: row; flex-wrap: wrap; }
  .mg-aside > .mg-panel { flex: 1 1 280px; }
  .mg-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .mg-layout { grid-template-columns: 1fr; }
  .mg-side { position: static; flex-direction: row; flex-wrap: wrap; }
  .mg-side a, .mg-side button.mg-nav-item { width: auto; }
  .mg-side-card { width: 100%; }
  .mg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .mg-search input { min-width: 0; width: 100%; }
  .mg-tools { width: 100%; }
  .mg-hero { padding: 22px 18px; }
}
@media (max-width: 480px) {
  .mg-grid { grid-template-columns: 1fr; }
  .mg-wrap { padding: 18px 14px 40px; }
}

/* ---------- G542: info tipe terpilih - 18 tipe (order Boss RK-JA8I6D) ---------- */
.mg-type-info { font-size: 0.78rem; line-height: 1.6; color: var(--text-muted-light); margin: 10px 2px 0; }
.mg-type-info b { color: var(--accent); font-weight: 600; }
.mg-type-info .mg-cocok { display: block; margin-top: 2px; }

/* ---------- G544: parameter custom Prompt Utama + Script video (order Boss RK-WWZ0RQ) ---------- */
.mg-step-hint { font-size: 0.72rem; font-weight: 500; color: var(--text-muted-light); margin-left: 4px; }
.mg-params { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; margin: 4px 0 2px; }
.mg-param { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.mg-param-label { font-size: 0.74rem; font-weight: 600; color: var(--text-muted-light); letter-spacing: 0.02em; }
.mg-param-ctrl { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.mg-param-select { width: 100%; padding: 9px 30px 9px 12px; font-size: 0.82rem; border-radius: 10px; }
.mg-param-input { width: 100%; padding: 9px 12px; font-size: 0.82rem; border-radius: 10px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line-light); color: #fff; }
.mg-param-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.mg-param-input::placeholder { color: rgba(255, 255, 255, 0.35); }
.mg-script { width: 100%; margin: 4px 0 6px; padding: 12px 14px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line-light); color: #fff; font: inherit; font-size: 0.88rem; line-height: 1.55; resize: vertical; min-height: 96px; }
.mg-script:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.mg-script::placeholder { color: rgba(255, 255, 255, 0.35); }
.mg-script-note { font-size: 0.74rem; line-height: 1.6; color: var(--text-muted-light); margin: 0 2px 8px; }
@media (max-width: 720px) {
  .mg-params { grid-template-columns: 1fr; }
}
