/* Rediseño visual para Creador Multifuente de Micrositios IA */
:root {
  --brand-1: #2563eb;
  --brand-2: #7c3aed;
  --brand-3: #06b6d4;
  --soft-shadow: 0 22px 50px rgba(15, 23, 42, 0.12);
  --soft-shadow-lg: 0 30px 80px rgba(15, 23, 42, 0.16);
}

body {
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 30%),
    radial-gradient(circle at top right, rgba(124, 58, 237, 0.12), transparent 28%),
    linear-gradient(180deg, #eef4ff 0%, #f8fbff 40%, #f4f7fc 100%);
}

.wrap {
  max-width: 1440px;
  padding: 22px 18px 56px;
}

.panel,
.setup,
.hero,
.content-section,
.filter-strip,
.footer,
.app-toolbar {
  border-radius: 28px;
}

.panel {
  box-shadow: var(--soft-shadow);
}

.setup {
  overflow: hidden;
  padding: 30px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.96)),
    radial-gradient(circle at 100% 0%, rgba(124, 58, 237, 0.12), transparent 24%),
    radial-gradient(circle at 0% 100%, rgba(6, 182, 212, 0.10), transparent 30%);
  border: 1px solid rgba(148, 163, 184, 0.18);
  position: relative;
}

.setup::before {
  content: '';
  position: absolute;
  inset: auto -5% -35% auto;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.18), transparent 70%);
  pointer-events: none;
}

.setup-head {
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.setup-titles {
  max-width: 860px;
}

.setup-pill {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(124, 58, 237, 0.12));
  color: #1d4ed8;
  border-color: rgba(37, 99, 235, 0.18);
  letter-spacing: 0.08em;
}

#setup-desc {
  font-size: 1.05rem;
  line-height: 1.75;
  max-width: 96ch;
  color: #475569;
}

.source-switch {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 18px 0 18px;
}

.source-tab {
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(255, 255, 255, 0.78);
  color: #0f172a;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}

.source-tab.active {
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.22);
}

.source-layout {
  grid-template-columns: 1.15fr 1fr;
  align-items: start;
}

.source-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

#url-field {
  background: rgba(248, 250, 252, 0.9);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

#source-url {
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: #fff;
  font-family: var(--font-body);
  font-size: 0.95rem;
}

.url-hint {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.file-dropzone {
  min-height: 230px;
  background:
    linear-gradient(180deg, rgba(37, 99, 235, 0.03), rgba(124, 58, 237, 0.03)),
    var(--surface2);
  border: 1px dashed rgba(37, 99, 235, 0.35);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.5), var(--shadow-sm);
}

.file-dropzone:hover,
.file-dropzone.dragover {
  background:
    linear-gradient(180deg, rgba(37, 99, 235, 0.07), rgba(124, 58, 237, 0.08)),
    var(--surface2);
  border-color: var(--brand-1);
}

.dropzone-text {
  font-size: 1.03rem;
}

.dropzone-sub {
  max-width: 42ch;
  line-height: 1.45;
}

.setup-preview {
  padding: 20px;
  margin-bottom: 16px;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.98)),
    linear-gradient(135deg, rgba(37, 99, 235, 0.25), rgba(124, 58, 237, 0.18)) !important;
  color: #fff !important;
  border: none !important;
  box-shadow: var(--soft-shadow-lg) !important;
}

.setup-preview h2,
.setup-preview p,
.setup-preview .preview-badge,
.setup-preview .preview-card,
.setup-preview strong,
.setup-preview span {
  color: inherit;
}

.setup-preview h2 {
  font-size: clamp(1.55rem, 2.7vw, 2.15rem);
  margin: 8px 0 10px;
}

.setup-preview p {
  color: rgba(255, 255, 255, 0.82);
  margin-bottom: 18px;
}

.setup-preview .preview-card {
  background: rgba(255, 255, 255, 0.08) !important;
}

/* Presentation mode fixes */
.slide-deck {
  display: grid !important;
  grid-template-rows: auto auto 1fr auto;
  align-content: stretch;
  gap: 16px;
  padding: clamp(20px, 4vw, 56px) !important;
  overflow: hidden;
  box-sizing: border-box;
}

.slide-deck.hidden {
  display: none !important;
}

.slide-deck h1 {
  max-width: min(100%, 1100px);
  margin: 0;
  font-size: clamp(2rem, 5vw, 4.4rem);
  line-height: 1.05;
  letter-spacing: -.04em;
  overflow-wrap: anywhere;
}

.slide-count {
  align-self: start;
}

.slide-body {
  max-width: min(100%, 1100px);
  width: 100%;
  max-height: none;
  min-height: 0;
  overflow: auto;
  padding-right: 8px;
  white-space: pre-wrap;
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  line-height: 1.7;
  box-sizing: border-box;
}

.slide-body p {
  margin: 0 0 1em;
}

.slide-close {
  justify-self: end;
}

.preview-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.18);
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.preview-card {
  border-radius: 18px;
  padding: 14px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
}

.preview-card strong {
  display: block;
  font-size: 0.92rem;
  margin-bottom: 4px;
}

.preview-card span {
  color: rgba(255,255,255,0.74);
  font-size: 0.8rem;
}

.selector-card {
  padding: 14px 16px;
  border-radius: 20px;
  background: rgba(255,255,255,0.74);
  border: 1px solid rgba(148,163,184,.18);
  box-shadow: var(--shadow-sm);
}

.selector-card label {
  color: #0f172a;
  margin-bottom: 8px;
}

.grid-sub .field,
.field.field-full {
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(148,163,184,.16);
  border-radius: 20px;
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}

.field input,
.field select {
  border-radius: 14px;
  background: #fff;
}

.action-btns {
  margin-top: 8px;
}

.primary,
.btn-large {
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.24);
}

.secondary {
  background: rgba(255, 255, 255, 0.76);
}

.ghost {
  background: rgba(255,255,255,0.48);
}

.app-toolbar {
  top: 10px;
  backdrop-filter: blur(22px);
  box-shadow: var(--soft-shadow);
  border: 1px solid rgba(148,163,184,0.16);
}

.toolbar-pill,
.chip,
.chip-sm {
  border-radius: 999px;
}

.hero {
  padding: 40px;
  border: 1px solid rgba(148,163,184,0.16);
  background:
    radial-gradient(circle at 100% 0%, rgba(34, 197, 94, 0.16), transparent 18%),
    radial-gradient(circle at 0% 100%, rgba(6, 182, 212, 0.18), transparent 18%),
    linear-gradient(135deg, #0f172a 0%, #1e293b 52%, #1d4ed8 100%);
  box-shadow: var(--soft-shadow-lg);
}

.hero-top {
  gap: 28px;
}

.hero-copy,
.stats-panel {
  min-height: 100%;
}

.hero-summary-card,
.stats-panel,
.filter-strip,
.content-section,
.footer {
  border: 1px solid rgba(148,163,184,0.14);
}

.stats-panel {
  background: rgba(255,255,255,0.12);
}

.mini-grid {
  gap: 14px;
}

.mini {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.12);
}

.filter-strip {
  padding: 16px 20px;
  background: rgba(255,255,255,0.76);
  backdrop-filter: blur(16px);
}

.chip.active {
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.18);
}

.content-section {
  padding: 28px;
  background: rgba(255,255,255,0.84);
  backdrop-filter: blur(14px);
}

.section-head {
  padding-bottom: 16px;
}

.highlight-card,
.chapter-card,
.quiz-card,
.glossary-card .flashcard-face,
.chart-card,
.matrix-card,
.faq-item,
.img-card,
.lightbox-content {
  box-shadow: var(--soft-shadow);
}

.highlight-card:hover,
.chapter-card:hover,
.glossary-card:hover,
.img-card:hover {
  transform: translateY(-4px);
}

.highlight-card,
.chapter-card,
.quiz-card,
.chart-card,
.matrix-card,
.faq-item,
.img-card,
.lightbox-content {
  border-radius: 22px;
}

.highlight-card {
  background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(248,250,252,.96));
}

.chapter-summary {
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.98));
}

.chapter-callout {
  background: linear-gradient(135deg, rgba(37,99,235,.08), rgba(124,58,237,.08));
}

.quiz-option-btn {
  background: rgba(255,255,255,0.95);
}

.quiz-option-btn.correct {
  box-shadow: 0 0 0 1px rgba(16,185,129,0.16);
}

.quiz-option-btn.incorrect {
  box-shadow: 0 0 0 1px rgba(239,68,68,0.16);
}

.glossary-card {
  min-height: 220px;
}

.flashcard-face {
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(248,250,252,.98));
}

.floating-toc {
  border-radius: 20px;
  box-shadow: var(--soft-shadow-lg);
}

.reading-progress {
  height: 4px;
}

.reading-progress span {
  background: linear-gradient(90deg, var(--brand-3), var(--brand-1), var(--brand-2));
}

.footer {
  padding: 24px 28px;
  background: rgba(255,255,255,0.88);
}

.lightbox-content {
  background: rgba(255,255,255,0.98);
}

.toast {
  border-radius: 16px;
}

@media (max-width: 1100px) {
  .source-layout {
    grid-template-columns: 1fr;
  }

  .preview-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 960px) {
  .hero,
  .setup,
  .content-section,
  .footer {
    padding: 20px 16px;
    border-radius: 24px;
  }

  .hero-top {
    gap: 20px;
  }

  .app-toolbar {
    border-radius: 22px;
  }
}

@media (max-width: 640px) {
  .source-tab,
  .preview-card,
  .setup-preview,
  .selector-card {
    border-radius: 18px;
  }

  .file-dropzone {
    min-height: 200px;
  }
}
