/* ==========================================================================
   SchemaExpertify Studio — Enterprise AI Manifest Creator
   https://schemaexpertify.com/
   Dark cyber theme · Inter + JetBrains Mono
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* --- Design tokens --- */
:root {
  --color-base: #090d16;
  --color-panel: #111827;
  --color-panel-hover: #151f33;
  --color-border: #1f2937;
  --color-border-focus: #10b981;
  --color-accent: #10b981;
  --color-accent-glow: rgba(16, 185, 129, 0.35);
  --color-cyan: #06b6d4;
  --color-cyan-glow: rgba(6, 182, 212, 0.3);
  --color-text: #e2e8f0;
  --color-muted: #64748b;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
  --radius: 0.75rem;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reset & base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-base);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(16, 185, 129, 0.08), transparent),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(6, 182, 212, 0.05), transparent);
}

code,
pre,
.ide-filename,
.toolbar-badge {
  font-family: var(--font-mono);
}

/* --- Dashboard grid --- */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (min-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: minmax(320px, 420px) 1fr;
    gap: 2rem;
  }
}

@media (min-width: 1280px) {
  .dashboard-grid {
    grid-template-columns: minmax(380px, 440px) 1fr;
  }
}

/* --- Panel cards --- */
.panel-card {
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.panel-card:hover {
  border-color: #243044;
}

.panel-heading {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: 1rem;
}

/* --- Form fields --- */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.field-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: #94a3b8;
}

.field-input {
  width: 100%;
  background: #0c1220;
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  color: var(--color-text);
  font-family: var(--font-sans);
  transition:
    border-color var(--transition),
    box-shadow var(--transition),
    background-color var(--transition);
  outline: none;
}

.field-input::placeholder {
  color: #475569;
}

.field-input-sm {
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
}

.field-textarea {
  resize: vertical;
  min-height: 5rem;
  line-height: 1.5;
}

/* Emerald / cyan glowing focus */
.field-input:focus,
.field-input:focus-visible {
  border-color: var(--color-border-focus);
  box-shadow:
    0 0 0 1px var(--color-border-focus),
    0 0 0 4px var(--color-accent-glow),
    0 0 20px -4px var(--color-accent-glow);
  background: #0a101c;
}

.field-input:focus:not(:focus-visible) {
  box-shadow: 0 0 0 1px var(--color-border-focus);
}

/* URL mapping rows */
.url-map-row {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.875rem;
  background: rgba(9, 13, 22, 0.6);
  border: 1px dashed #1e293b;
  border-radius: 0.5rem;
}

@media (min-width: 640px) {
  .url-map-row {
    flex-direction: row;
    align-items: flex-end;
  }
}

/* --- Format toggle (llms vs llms-full) --- */
.format-toggle-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.format-option {
  cursor: pointer;
  position: relative;
}

.format-radio {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.format-label {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  padding: 0.75rem 1rem;
  background: #0c1220;
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  transition: all var(--transition);
}

.format-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #cbd5e1;
}

.format-desc {
  font-size: 0.65rem;
  color: var(--color-muted);
}

.format-radio:checked + .format-label {
  border-color: var(--color-accent);
  background: rgba(16, 185, 129, 0.08);
  box-shadow:
    0 0 0 1px var(--color-accent),
    0 0 16px -4px var(--color-accent-glow);
}

.format-radio:focus-visible + .format-label {
  outline: 2px solid var(--color-cyan);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--color-cyan-glow);
}

/* --- Custom toggle switches --- */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0.5rem;
  border-radius: 0.5rem;
  transition: background-color var(--transition);
}

.toggle-row:hover {
  background: rgba(255, 255, 255, 0.02);
}

.toggle-info {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0;
}

.toggle-title {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #cbd5e1;
}

.toggle-desc {
  font-size: 0.65rem;
  color: var(--color-muted);
}

.toggle-divider {
  height: 1px;
  background: var(--color-border);
  margin: 0.5rem 0;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: #1e293b;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  transition: all var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background: #64748b;
  border-radius: 50%;
  transition: all var(--transition);
}

.toggle-switch input:checked + .toggle-slider {
  background: rgba(16, 185, 129, 0.25);
  border-color: var(--color-accent);
  box-shadow: 0 0 12px -2px var(--color-accent-glow);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
  background: var(--color-accent);
  box-shadow: 0 0 8px var(--color-accent-glow);
}

.toggle-switch input:focus-visible + .toggle-slider {
  box-shadow:
    0 0 0 2px var(--color-base),
    0 0 0 4px var(--color-cyan),
    0 0 20px var(--color-cyan-glow);
}

.toggle-switch input:checked:focus-visible + .toggle-slider {
  box-shadow:
    0 0 0 2px var(--color-base),
    0 0 0 4px var(--color-accent),
    0 0 20px var(--color-accent-glow);
}

/* --- IDE preview window --- */
.sticky-preview {
  position: sticky;
  top: 5.5rem;
}

.ide-window {
  background: #0a0e17;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.4),
    0 20px 50px -12px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.ide-titlebar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(180deg, #151b28 0%, #111827 100%);
  border-bottom: 1px solid var(--color-border);
}

.window-dots {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dot-red {
  background: #ef4444;
  box-shadow: inset 0 -1px 2px rgba(0, 0, 0, 0.2);
}

.dot-yellow {
  background: #eab308;
  box-shadow: inset 0 -1px 2px rgba(0, 0, 0, 0.2);
}

.dot-green {
  background: #22c55e;
  box-shadow: inset 0 -1px 2px rgba(0, 0, 0, 0.2);
}

.ide-filename {
  flex: 1;
  font-size: 0.75rem;
  color: #94a3b8;
  text-align: center;
  user-select: none;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4375rem 0.875rem;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-sans);
  color: #0f172a;
  background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.copy-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.copy-btn:active {
  transform: translateY(0);
}

.copy-btn:focus-visible {
  outline: 2px solid var(--color-cyan);
  outline-offset: 2px;
}

.copy-btn.copied {
  background: linear-gradient(135deg, #22c55e 0%, #10b981 100%);
  color: #fff;
}

.copy-btn.error {
  background: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
  color: #fff;
}

.ide-toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.375rem 1rem;
  background: #0c1019;
  border-bottom: 1px solid rgba(31, 41, 55, 0.6);
  font-size: 0.65rem;
}

.toolbar-badge {
  padding: 0.125rem 0.5rem;
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-accent);
  border-radius: 0.25rem;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.toolbar-meta {
  color: var(--color-muted);
}

.ide-editor {
  max-height: min(70vh, 640px);
  overflow: auto;
  padding: 1rem 1.25rem;
  background: #060910;
}

.code-pre {
  margin: 0;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.65;
  tab-size: 2;
  white-space: pre-wrap;
  word-break: break-word;
}

#manifest-output {
  display: block;
  color: #a5f3d0;
  font-family: var(--font-mono);
}

/* Syntax-ish highlights via spans injected by JS optional — base colors */
#manifest-output .md-heading {
  color: #67e8f9;
}

#manifest-output .md-quote {
  color: #94a3b8;
}

#manifest-output .md-link {
  color: #6ee7b7;
}

.ide-statusbar {
  display: flex;
  gap: 1.25rem;
  padding: 0.375rem 1rem;
  font-size: 0.65rem;
  color: #475569;
  background: #0a0e17;
  border-top: 1px solid var(--color-border);
  font-family: var(--font-mono);
}

/* Extended details visibility */
#full-details-group {
  transition: opacity var(--transition), max-height var(--transition);
}

#full-details-group.collapsed {
  opacity: 0.45;
  pointer-events: none;
}

/* --- SchemaExpertify brand links --- */
.brand-link {
  font-weight: 500;
  text-underline-offset: 3px;
  text-decoration-color: transparent;
  transition:
    color var(--transition),
    text-decoration-color var(--transition),
    text-shadow var(--transition);
}

.brand-link:hover {
  text-decoration: underline;
  text-decoration-color: rgba(16, 185, 129, 0.6);
}

.brand-link:focus-visible {
  outline: 2px solid var(--color-cyan);
  outline-offset: 2px;
  border-radius: 2px;
  text-decoration: underline;
}

/* --- Footer --- */
.site-footer {
  background: linear-gradient(180deg, transparent 0%, rgba(17, 24, 39, 0.35) 100%);
}

.footer-deploy,
.footer-credit {
  line-height: 1.6;
  margin: 0;
}

.footer-credit {
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
}

.site-footer code {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.125rem 0.375rem;
  background: var(--color-panel);
  border-radius: 0.25rem;
  border: 1px solid var(--color-border);
  color: #94a3b8;
}

/* --- Custom scrollbars --- */
.custom-scrollbar {
  scrollbar-width: thin;
  scrollbar-color: #334155 #0a0e17;
}

.custom-scrollbar::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: #0a0e17;
  border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #334155 0%, #1e293b 100%);
  border-radius: 4px;
  border: 2px solid #0a0e17;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #475569 0%, #334155 100%);
}

.custom-scrollbar::-webkit-scrollbar-corner {
  background: #0a0e17;
}

/* Global scrollbar (subtle) */
html {
  scrollbar-width: thin;
  scrollbar-color: #1e293b var(--color-base);
}

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--color-base);
}

::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 5px;
  border: 2px solid var(--color-base);
}

::-webkit-scrollbar-thumb:hover {
  background: #334155;
}

/* Input panel scroll on small screens */
@media (max-width: 1023px) {
  .sticky-preview {
    position: relative;
    top: 0;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
