@import "./editor/styles.css";

#root {
  margin: 0 auto;
  padding: 2rem;
  max-width: 1200px;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  color: #101828;
}

.app {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.app__header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
}

.app__intro {
  flex: 1 1 32rem;
}

.app__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.app__header h1 {
  margin: 0 0 0.25rem;
  font-size: 2rem;
}

.app__header p {
  margin: 0;
  color: #475467;
  max-width: 48rem;
}

.app__action {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  border: none;
  border-radius: 0.75rem;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.25);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.app__action:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(37, 99, 235, 0.25);
}

.app__action--ghost {
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
  box-shadow: none;
}

.app__action--ghost:hover {
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.18);
}

.app__dark-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid #e4e7ec;
  border-radius: 0.75rem;
  background: #fff;
  color: #475467;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}

.app__dark-toggle:hover {
  background: #f1f5f9;
  color: #0f172a;
}


.app__workspace {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 2rem;
}

.app__editor {
  background: #fff;
  border-radius: 1rem;
  border: 1px solid #e4e7ec;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
  padding: 1.25rem;
}

.app__preview {
  display: grid;
  gap: 1.5rem;
}

.app__panel {
  background: #0f172a;
  color: #f1f5f9;
  border-radius: 1rem;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.15);
  min-height: 180px;
}

.app__panel h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.app__panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.app__panel pre {
  margin: 0;
  flex: 1;
  background: transparent;
  color: inherit;
  font-family: "JetBrains Mono", "Fira Code", monospace;
  font-size: 0.95rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.app__action--small {
  padding: 0.4rem 0.9rem;
  font-size: 0.9rem;
}

.app__action:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.app__panel .app__action--ghost {
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.18);
}

.app__md-input {
  box-sizing: border-box;
  width: 100%;
  min-height: 200px;
  resize: vertical;
  padding: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 0.5rem;
  background: rgba(15, 23, 42, 0.6);
  color: inherit;
  font-family: "JetBrains Mono", "Fira Code", monospace;
  font-size: 0.9rem;
  line-height: 1.45;
}

.app__md-input::placeholder {
  color: rgba(148, 163, 184, 0.7);
}

.app__md-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.35);
}

.app__error {
  margin: 0;
  color: #fca5a5;
  font-weight: 500;
}

.app__copy {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.app__copy-status {
  font-size: 0.85rem;
  color: #38bdf8;
  font-weight: 600;
}

.app__copy-status--error {
  color: #f87171;
}

.app__panel--light {
  background: #ffffff;
  color: #0f172a;
}

.app__panel-text {
  margin: 0;
  color: rgba(15, 23, 42, 0.85);
  font-size: 0.9rem;
}

.app__step-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.app__step-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem;
  border-radius: 0.5rem;
  background: rgba(37, 99, 235, 0.08);
  color: inherit;
  font-size: 0.95rem;
}

.app__step-title {
  font-weight: 600;
}

.app__step-meta {
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(15, 23, 42, 0.6);
}

/* Dark mode overrides — neutral gray + indigo accent palette from Figma */
html.dark #root {
  color: #fafafa;
}

html.dark .app__header h1 {
  color: #fafafa;
}

html.dark .app__header p {
  color: #a3a3a3;
}

html.dark .app__action {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  box-shadow: 0 10px 20px rgba(99, 102, 241, 0.25);
}

html.dark .app__action:hover {
  box-shadow: 0 16px 32px rgba(99, 102, 241, 0.3);
}

html.dark .app__action--ghost {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
}

html.dark .app__action--ghost:hover {
  box-shadow: 0 12px 24px rgba(99, 102, 241, 0.18);
}

html.dark .app__dark-toggle {
  background: #262626;
  border-color: #404040;
  color: #d4d4d4;
}

html.dark .app__dark-toggle:hover {
  background: #404040;
  color: #fafafa;
}

html.dark .app__editor {
  background: #171717;
  border-color: #404040;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
}

html.dark .app__panel {
  background: #171717;
  box-shadow: inset 0 0 0 1px rgba(64, 64, 64, 0.5);
}

html.dark .app__md-input {
  background: #0a0a0a;
  border-color: #404040;
}

html.dark .app__md-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.35);
}

html.dark .app__panel .app__action--ghost {
  color: #818cf8;
  background: rgba(99, 102, 241, 0.15);
}

html.dark .app__panel--light {
  background: #262626;
  color: #fafafa;
}

html.dark .app__panel-text {
  color: #a3a3a3;
}

html.dark .app__step-list li {
  background: rgba(99, 102, 241, 0.12);
}

html.dark .app__step-meta {
  color: #737373;
}

html.dark .app__copy-status {
  color: #818cf8;
}

@media (max-width: 960px) {
  #root {
    padding: 1.5rem;
  }

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

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

/* A sample host theme: the editor restyled only through --tme-* tokens. */
.app__editor--custom-theme {
  --tme-font-sans: Georgia, serif;
  --tme-fg: #1e1b4b;
  --tme-muted-fg: #6d28d9;
  --tme-primary: #7c3aed;
  --tme-link: #7c3aed;
  --tme-meta-bg: #f5f3ff;
  --tme-meta-border: #ddd6fe;
  --tme-radius: 12px;
  --tme-h1: 28px;
  --tme-h2: 24px;
}
