/* ═══════════════════════════════════════════
   LyraMaker — evrensel model goruntuleyici (.mvx-*)
   main.css degiskenlerinin ustune kurulur.
═══════════════════════════════════════════ */

.mvx {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 1.1rem;
  align-items: start;
  margin: 0 0 1.5rem;
}

/* ── Sahne ── */
.mvx-stage {
  position: relative;
  aspect-ratio: 4 / 3;
  min-height: 340px;
  background:
    radial-gradient(ellipse at 50% 15%, rgba(130, 46, 245, .10), transparent 65%),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.mvx.is-dragging .mvx-stage {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(130, 46, 245, .18);
}
.mvx-canvas { position: absolute; inset: 0; }
.mvx-canvas canvas { display: block; width: 100%; height: 100%; }

/* ── Durum katmanlari ── */
.mvx-drop, .mvx-busy, .mvx-error {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem;
  background: var(--surface);
}
.mvx[data-state="empty"] .mvx-drop,
.mvx[data-state="busy"] .mvx-busy,
.mvx[data-state="error"] .mvx-error { display: flex; }
.mvx[data-state="ready"] .mvx-tools { display: flex; }
.mvx-tools { display: none; }

.mvx-drop-inner { max-width: 340px; }
.mvx-drop svg { color: var(--accent); opacity: .85; margin-bottom: .9rem; }
:is(.mvx, .cvx) .mvx-drop-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: .5rem;
}
:is(.mvx, .cvx) .mvx-drop-sub {
  font-size: .8rem;
  color: var(--muted2);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: .7rem;
}
:is(.mvx, .cvx) .mvx-drop-note {
  font-size: .8rem;
  color: var(--muted);
  margin-top: .9rem;
  line-height: 1.5;
}
:is(.mvx, .cvx) .mvx-drop-formats {
  font-size: .74rem;
  color: var(--muted2);
  margin-top: .5rem;
  line-height: 1.6;
}

.mvx-busy { flex-direction: column; gap: .9rem; }
.mvx-busy-text { font-size: .9rem; color: var(--muted); }
.mvx-spin {
  width: 30px; height: 30px;
  border: 2.5px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: mvx-rot .8s linear infinite;
}
@keyframes mvx-rot { to { transform: rotate(360deg); } }

.mvx-error { flex-direction: column; gap: 1rem; }
:is(.mvx, .cvx) .mvx-error-text {
  font-size: .92rem;
  line-height: 1.6;
  color: var(--muted);
  max-width: 380px;
}

/* ── Arac butonlari ── */
.mvx-tools {
  position: absolute;
  top: .75rem; right: .75rem;
  flex-direction: column;
  gap: .4rem;
  z-index: 3;
}
.mvx-tool {
  font-family: inherit;
  font-size: .64rem;
  font-weight: 700;
  letter-spacing: .07em;
  color: var(--muted);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 9px;
  padding: .45rem .55rem;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: color .15s ease, border-color .15s ease;
}
.mvx-tool:hover { color: var(--text); border-color: var(--accent); }
.mvx-tool.is-on { color: #fff; background: var(--accent); border-color: var(--accent); }

/* ── Sag panel ── */
.mvx-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.mvx-info {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  min-height: 60px;
}
.mvx-info:empty::after {
  content: "Open a file to see its triangle count, dimensions and structure.";
  font-size: .85rem;
  line-height: 1.6;
  color: var(--muted2);
}
.mvx-dl {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .38rem .7rem;
  margin: 0;
  font-size: .84rem;
}
.mvx-dl dt {
  color: var(--muted2);
  white-space: nowrap;
}
.mvx-dl dd {
  margin: 0;
  color: var(--text);
  font-weight: 500;
  overflow-wrap: anywhere;
}
:is(.mvx, .cvx) .mvx-hint {
  margin-top: .8rem;
  padding-top: .7rem;
  border-top: 1px solid var(--border);
  font-size: .78rem;
  line-height: 1.55;
  color: var(--muted);
}

.mvx-actions {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}
.mvx-target {
  flex: 1 1 auto;
  min-width: 0;
  font-family: inherit;
  font-size: .85rem;
  color: var(--text);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: .55rem .6rem;
  cursor: pointer;
}
.mvx-target:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.mvx-btn {
  font-family: inherit;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: .55rem .9rem;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, opacity .15s ease;
}
.mvx-btn:hover { border-color: var(--accent); }
.mvx-btn-primary {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}
.mvx-btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.mvx-btn:disabled { opacity: .45; cursor: not-allowed; }
.mvx-btn:disabled:hover { border-color: var(--border); background: var(--surface2); }
.mvx-btn-primary:disabled:hover { background: var(--accent); }
.mvx-open { width: 100%; }
.mvx-actions { display: flex; flex-direction: column; gap: .55rem; }
.mvx-actions .mvx-btn { width: 100%; text-align: center; }
/* .gd-article a (link rengi) butonu ezmesin */
:is(.mvx, .cvx) a.mvx-btn { display: block; text-decoration: none; box-sizing: border-box; color: var(--text); }
:is(.mvx, .cvx) a.mvx-btn-primary,
:is(.mvx, .cvx) a.mvx-btn-primary:hover { color: #fff; }

/* ── Donusturucu ayarlari (data-mode="convert") ── */
.mvx-opts {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: .8rem;
}
.mvx-field label,
.cvx-field label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: .5rem;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted2);
  margin-bottom: .4rem;
}
.mvx-val { color: var(--accent); letter-spacing: 0; text-transform: none; font-weight: 700; }
.mvx-field select,
.mvx-field input[type="number"],
.cvx-field select,
.cvx-field input[type="number"],
.cvx-field input[type="text"],
.cvx-field textarea {
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
  font-size: .86rem;
  color: var(--text);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: .52rem .6rem;
}
.mvx-field select:focus-visible,
.mvx-field input:focus-visible,
.cvx-field select:focus-visible,
.cvx-field input:focus-visible,
.cvx-field textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.mvx-check,
.cvx-check {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  font-size: .83rem;
  line-height: 1.45;
  color: var(--text);
  cursor: pointer;
}
.mvx-check input,
.cvx-check input { margin-top: .2rem; accent-color: var(--accent); flex: none; }
:is(.mvx, .cvx) .mvx-out {
  margin: 0;
  font-size: .8rem;
  line-height: 1.5;
  color: var(--muted);
}
:is(.mvx, .cvx) .mvx-out:empty { display: none; }
.mvx-only-stl, .mvx-only-cad { display: none; }
.mvx.is-stl .mvx-only-stl, .mvx.is-cad .mvx-only-cad { display: block; }

/* ── Ornek dosya satiri ── */
.mvx-samples {
  font-size: .85rem;
  color: var(--muted);
  margin: -.6rem 0 1.8rem;
}
.mvx-samples a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  cursor: pointer;
}
.mvx-samples a:hover { border-bottom-color: var(--accent); }

/* ── Format rozetleri ── */
.mvx-badges {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin: 1.2rem 0 1.8rem;
}
.mvx-badge {
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .35rem .75rem;
  text-decoration: none;
  transition: color .15s ease, border-color .15s ease;
}
.mvx-badge:hover { color: var(--text); border-color: var(--accent); }
.mvx-badge.is-current {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

@media (max-width: 860px) {
  .mvx { grid-template-columns: minmax(0, 1fr); }
  .mvx-stage { aspect-ratio: 1 / 1; min-height: 300px; }
}
@media (max-width: 480px) {
  .mvx-stage { aspect-ratio: 4 / 5; }
  .mvx-tools { top: .5rem; right: .5rem; }
}

/* Makale sayfalarinda (.gd-article p) paragraf boslugu arac icine sizmasin */
:is(.mvx, .cvx) p { margin-bottom: 0; }

/* ── 2B DXF goruntuleyici (js/dxf-viewer.js) ── */
.dxv .mvx-canvas canvas { cursor: grab; }
.dxv .mvx-canvas canvas:active { cursor: grabbing; }
.dxv-tools .mvx-tool { text-transform: uppercase; min-width: 2.6rem; }
.dxv-cursor {
  position: absolute;
  left: .75rem; top: .75rem;
  z-index: 3;
  font-size: .72rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  pointer-events: none;
}
.dxv[data-state="ready"] .mvx-actions a.mvx-btn { text-align: center; text-decoration: none; }
