/* AI Media Studio demo — AdaptiveLearn */

:root {
  --accent: #f38020;
  --accent-soft: #ff9f4a;
  --ink: #0f172a;
  --ink-soft: #334155;
  --muted: #64748b;
  --line: rgba(15, 23, 42, 0.1);
  --paper: #f7f4ef;
  --ok: #0d9488;
  --err: #dc2626;
  --font-display: "Sora", system-ui, sans-serif;
  --font-body: "Manrope", system-ui, sans-serif;
  --max: 720px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  min-height: 100vh;
  background:
    radial-gradient(900px 480px at 8% -8%, rgba(243, 128, 32, 0.2), transparent 55%),
    radial-gradient(700px 420px at 100% 0%, rgba(13, 148, 136, 0.1), transparent 50%),
    linear-gradient(180deg, var(--paper), #efe8dc 60%, var(--paper));
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

.shell {
  width: min(var(--max), calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.25rem 0 3rem;
  display: grid;
  gap: 1.1rem;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.03em;
}
.logo span { color: var(--accent); }
.topbar-links {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  font-size: 0.85rem;
  color: var(--muted);
}
.topbar-links a:hover { color: var(--accent); }

.brand {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 5vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
  animation: rise 0.6s var(--ease) both;
}
.brand em { font-style: normal; color: var(--accent); }

.lead {
  color: var(--muted);
  font-size: 0.98rem;
  max-width: 40rem;
  animation: rise 0.6s var(--ease) 0.06s both;
}

.modes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.15rem;
  animation: rise 0.6s var(--ease) 0.1s both;
}
.modes button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.55rem 0.75rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}
.modes button[aria-selected="true"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

form {
  display: grid;
  gap: 0.85rem;
  animation: rise 0.6s var(--ease) 0.14s both;
}
.field { display: grid; gap: 0.35rem; }
.field label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
input[type="url"], select {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255, 253, 249, 0.85);
  color: var(--ink);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  font: inherit;
  outline: none;
}
input:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(243, 128, 32, 0.18);
}
.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
@media (max-width: 560px) { .row { grid-template-columns: 1fr; } }

.panel[hidden] { display: none !important; }

.go {
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 0.95rem 1.15rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
  color: #fff;
}
.go:hover:not(:disabled) { filter: brightness(1.05); }
.go:disabled { opacity: 0.55; cursor: wait; }
.go.mode-sum {
  background: linear-gradient(135deg, #0d9488, #2dd4bf);
  color: #042f2e;
}
.go.mode-debate {
  background: linear-gradient(135deg, #1e3a5f, #334155);
}

.status {
  min-height: 1.3rem;
  font-size: 0.9rem;
  color: var(--muted);
}
.status.ok { color: var(--ok); }
.status.err { color: var(--err); }

.result {
  display: none;
  gap: 0.75rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}
.result.show { display: grid; }
.result h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}
.meta { color: var(--muted); font-size: 0.88rem; }
.md {
  white-space: pre-wrap;
  font-size: 0.92rem;
  line-height: 1.55;
  max-height: 42vh;
  overflow: auto;
  padding: 0.5rem 0;
}
.stream {
  display: grid;
  gap: 0.65rem;
  max-height: 48vh;
  overflow: auto;
}
.msg {
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  background: rgba(255, 253, 249, 0.9);
  border: 1px solid var(--line);
  font-size: 0.9rem;
}
.msg .who {
  font-weight: 800;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.25rem;
}
audio { width: 100%; }
.link {
  color: var(--accent);
  font-weight: 700;
  text-underline-offset: 3px;
  text-decoration: underline;
}

.note {
  font-size: 0.8rem;
  color: var(--muted);
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  border: 1px dashed var(--line);
  background: rgba(255, 255, 255, 0.45);
  text-align: center;
  margin-inline: auto;
  max-width: 40rem;
}
.note strong { color: var(--ink-soft); }

.embed-panel {
  display: grid;
  min-height: min(82vh, 900px);
  width: 100%;
}
.debateroom-embed {
  width: 100%;
  min-height: min(82vh, 900px);
  height: min(82vh, 900px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
/* DebateRoom embed: usar casi todo el ancho de pantalla */
body.mode-embed .shell {
  width: 100%;
  max-width: none;
  padding-inline: clamp(0.5rem, 1.5vw, 1rem);
  box-sizing: border-box;
}
body.mode-embed .embed-panel,
body.mode-embed .debateroom-embed {
  width: 100%;
  min-height: calc(100vh - 11.5rem);
  height: calc(100vh - 11.5rem);
  border-radius: 10px;
}
body.mode-embed .note,
body.mode-embed .status {
  display: none;
}

.tab-featured {
  color: var(--accent) !important;
}
.modes button.tab-featured[aria-selected="true"] {
  border-bottom-color: var(--accent);
}

.demo-badge {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  background: var(--accent-dim, rgba(243, 128, 32, 0.14));
  color: #c2410c;
}
.demo-badge.warn { background: rgba(220, 38, 38, 0.12); color: var(--err); }

.scorm-panel {
  display: grid;
  gap: 0.85rem;
  padding: 0.25rem 0 0.5rem;
}
.scorm-panel h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}
.scorm-panel p { color: var(--ink-soft); font-size: 0.95rem; }
.scorm-eyebrow {
  font-size: 0.72rem !important;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent) !important;
}
.scorm-vs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
@media (max-width: 640px) { .scorm-vs { grid-template-columns: 1fr; } }
.scorm-vs > div {
  padding: 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 249, 0.7);
}
.scorm-ours {
  border-color: rgba(243, 128, 32, 0.35) !important;
  background: rgba(243, 128, 32, 0.08) !important;
}
.scorm-vs h3 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  margin-bottom: 0.45rem;
}
.scorm-vs ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: 0.88rem;
  display: grid;
  gap: 0.25rem;
}
.scorm-cta-line {
  font-weight: 600 !important;
  color: var(--ink) !important;
}

.gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(11, 18, 32, 0.55);
  display: grid;
  place-items: center;
  padding: 1rem;
  backdrop-filter: blur(4px);
}
.gate-overlay[hidden] { display: none !important; }
.gate-card {
  width: min(420px, 100%);
  background: #fffdf9;
  border-radius: 16px;
  padding: 1.35rem 1.25rem 1.1rem;
  border: 1px solid var(--line);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
  display: grid;
  gap: 0.75rem;
}
.gate-card h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}
.gate-lead { color: var(--muted); font-size: 0.92rem; }
.gate-form { display: grid; gap: 0.4rem; }
.gate-form label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.gate-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  font: inherit;
  background: #fff;
}
.gate-hint { font-size: 0.8rem; color: var(--muted); }
.gate-or {
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 0.75rem;
}
.gate-msg { font-size: 0.88rem; min-height: 1.2rem; color: var(--muted); }
.gate-msg.ok { color: var(--ok); }
.gate-msg.err { color: var(--err); }
.gate-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  justify-self: center;
  padding: 0.35rem;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
