/* Media AI — shared theme (all tools) */
:root {
  --ma-bg: #0b0a12;
  --ma-surface: #15131f;
  --ma-surface-2: #1c1930;
  --ma-border: #2a2640;
  --ma-text: #f5f3ff;
  --ma-muted: #a5a1b8;
  --ma-primary: #7c3aed;
  --ma-primary-2: #a78bfa;
  --ma-accent: #f59e0b;
  --ma-ok: #34d399;
  --ma-danger: #f87171;
  --ma-radius: 18px;
  --ma-font: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--ma-bg);
  color: var(--ma-text);
  font-family: var(--ma-font);
  min-height: 100%;
}
a { color: var(--ma-primary-2); text-decoration: none; }
a:hover { text-decoration: underline; }

.ma-shell { max-width: 1120px; margin: 0 auto; padding: 20px 18px 80px; }

.ma-nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 28px; flex-wrap: wrap;
}
.ma-brand {
  display: flex; align-items: center; gap: 12px; font-weight: 800; letter-spacing: -0.02em;
}
.ma-logo {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(135deg, var(--ma-primary), #db2777);
  display: grid; place-items: center; font-size: 13px; font-weight: 900; color: white;
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.35);
}
.ma-brand small { display: block; font-weight: 500; color: var(--ma-muted); font-size: 12px; margin-top: 2px; }

.ma-nav-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ma-pill {
  background: var(--ma-surface); border: 1px solid var(--ma-border);
  border-radius: 999px; padding: 8px 12px; font-size: 13px; color: var(--ma-muted);
}
.ma-pill strong { color: var(--ma-accent); }

.ma-btn {
  appearance: none; border: 0; cursor: pointer;
  border-radius: 12px; padding: 11px 16px; font-weight: 700; font-size: 14px;
  transition: transform .15s ease, opacity .15s ease, background .15s ease;
}
.ma-btn:active { transform: scale(0.98); }
.ma-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.ma-btn-primary {
  background: linear-gradient(135deg, var(--ma-primary), #9333ea);
  color: white; box-shadow: 0 10px 28px rgba(124, 58, 237, 0.35);
}
.ma-btn-ghost {
  background: transparent; color: var(--ma-text);
  border: 1px solid var(--ma-border);
}
.ma-btn-accent {
  background: var(--ma-accent); color: #1a1205;
}

.ma-hero { margin: 12px 0 32px; }
.ma-hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.1;
  margin: 0 0 12px; letter-spacing: -0.03em;
}
.ma-hero p { color: var(--ma-muted); font-size: 1.05rem; max-width: 560px; margin: 0 0 18px; }
.ma-hero-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.ma-tag {
  font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--ma-primary-2); background: rgba(124,58,237,.12);
  border: 1px solid rgba(124,58,237,.25); border-radius: 999px; padding: 6px 10px;
}

.ma-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

.ma-card {
  background: var(--ma-surface);
  border: 1px solid var(--ma-border);
  border-radius: var(--ma-radius);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: border-color .15s ease, transform .15s ease;
}
.ma-card:hover { border-color: rgba(167,139,250,.45); transform: translateY(-2px); }
.ma-card img, .ma-card .thumb {
  width: 100%; aspect-ratio: 16/10; object-fit: cover; background: var(--ma-surface-2); display: block;
}
.ma-card-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.ma-card-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ma-badge {
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
  padding: 4px 8px; border-radius: 999px;
  background: rgba(245,158,11,.12); color: var(--ma-accent);
}
.ma-badge.soon { background: rgba(165,161,184,.12); color: var(--ma-muted); }
.ma-cat { font-size: 12px; color: var(--ma-muted); font-weight: 600; }
.ma-card h3 { margin: 0; font-size: 1.15rem; letter-spacing: -0.02em; }
.ma-card p { margin: 0; color: var(--ma-muted); font-size: 0.92rem; line-height: 1.45; flex: 1; }
.ma-card .ma-btn { margin-top: 8px; width: 100%; text-align: center; }

/* Tool workspace */
.ma-work {
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 22px;
}
@media (max-width: 900px) {
  .ma-work { grid-template-columns: 1fr; }
}

.ma-panel {
  background: var(--ma-surface);
  border: 1px solid var(--ma-border);
  border-radius: var(--ma-radius);
  padding: 18px;
}
.ma-panel h2 { margin: 0 0 6px; font-size: 1.15rem; }
.ma-panel .hint { color: var(--ma-muted); font-size: 0.9rem; margin-bottom: 14px; }

.ma-drop {
  border: 1.5px dashed var(--ma-border);
  border-radius: 14px;
  padding: 28px 16px;
  text-align: center;
  background: var(--ma-surface-2);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.ma-drop:hover, .ma-drop.drag { border-color: var(--ma-primary-2); background: rgba(124,58,237,.08); }
.ma-drop input { display: none; }
.ma-preview {
  margin-top: 12px; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--ma-border); max-height: 280px;
  display: none; background: #000;
}
.ma-preview img, .ma-preview video { width: 100%; display: block; max-height: 280px; object-fit: contain; }

.ma-styles {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0;
}
.ma-style {
  border: 1px solid var(--ma-border); border-radius: 12px;
  padding: 12px; background: var(--ma-surface-2); cursor: pointer;
  font-weight: 700; font-size: 13px; color: var(--ma-text); text-align: left;
}
.ma-style.active {
  border-color: var(--ma-primary-2);
  background: rgba(124,58,237,.15);
  box-shadow: inset 0 0 0 1px rgba(167,139,250,.35);
}

.ma-result {
  min-height: 280px; border-radius: 14px; border: 1px solid var(--ma-border);
  background: #000; display: grid; place-items: center; overflow: hidden;
  color: var(--ma-muted); font-size: 14px;
}
.ma-result img, .ma-result video { width: 100%; max-height: 420px; object-fit: contain; display: block; }

.ma-examples { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.ma-chip {
  font-size: 12px; color: var(--ma-muted); border: 1px solid var(--ma-border);
  border-radius: 999px; padding: 5px 10px; background: transparent;
}

/* Modal auth */
.ma-modal-backdrop {
  position: fixed; inset: 0; background: rgba(5,4,10,.72);
  display: none; align-items: center; justify-content: center; z-index: 50; padding: 16px;
}
.ma-modal-backdrop.open { display: flex; }
.ma-modal {
  width: min(420px, 100%);
  background: var(--ma-surface);
  border: 1px solid var(--ma-border);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 30px 80px rgba(0,0,0,.5);
}
.ma-modal h3 { margin: 0 0 6px; }
.ma-modal p { color: var(--ma-muted); font-size: 0.92rem; margin: 0 0 14px; }
.ma-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.ma-field label { font-size: 12px; font-weight: 700; color: var(--ma-muted); text-transform: uppercase; letter-spacing: .04em; }
.ma-field input {
  border-radius: 12px; border: 1px solid var(--ma-border); background: var(--ma-surface-2);
  color: var(--ma-text); padding: 12px 14px; font-size: 15px; outline: none;
}
.ma-field input:focus { border-color: var(--ma-primary-2); }
.ma-modal-actions { display: flex; flex-direction: column; gap: 8px; }
.ma-divider {
  display: flex; align-items: center; gap: 10px; color: var(--ma-muted); font-size: 12px; margin: 8px 0;
}
.ma-divider::before, .ma-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--ma-border);
}
.ma-msg { font-size: 13px; margin-top: 8px; min-height: 1.2em; }
.ma-msg.err { color: var(--ma-danger); }
.ma-msg.ok { color: var(--ma-ok); }

.ma-footer {
  margin-top: 48px; padding-top: 18px; border-top: 1px solid var(--ma-border);
  color: var(--ma-muted); font-size: 13px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}
