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

/* Core Theme & Page Canvas */
body, body.dark-theme {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--skin-canvas, #0D1424);
  background-image: 
    radial-gradient(1000px circle at 50% -50px, rgba(14, 165, 233, 0.10), transparent 70%),
    radial-gradient(800px circle at 80% 30%, rgba(99, 102, 241, 0.05), transparent 60%);
  color: var(--skin-text, #f8fafc);
  font-family: var(--font-body, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", sans-serif);
  -webkit-font-smoothing: antialiased;
  overflow-y: auto;
}

/* Global site header integration */
.site-header {
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--skin-header-bg, rgba(255, 255, 255, 0.82)) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--skin-border) !important;
}

/* Active Nav Tool Pill */
.site-navigation > a.site-nav-tool[aria-current] {
  text-decoration: none !important;
  color: #38bdf8 !important;
}
.site-navigation > a.site-nav-tool[aria-current] .pill-cyan {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.5), inset 0 0 4px rgba(56, 189, 248, 0.3) !important;
}

/* ==========================================================================
   1. Studio Hero Section (Compact & Luxurious)
   ========================================================================== */
.studio-hero {
  max-width: 1360px;
  margin: 0 auto;
  padding: 32px 24px 20px;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
}

.studio-hero-left {
  max-width: 780px;
}

.hero-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--skin-surface, #141F36);
  border: 1px solid var(--skin-border, #223254);
  border-radius: 9999px;
  padding: 4px 12px;
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--skin-text-dim, #94a3b8);
  margin-bottom: 12px;
}

.hero-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #22d3ee;
  box-shadow: 0 0 8px #22d3ee;
  animation: pulse-glow 2s infinite ease-in-out;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.studio-title {
  font-size: 2.15rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: #ffffff;
  margin: 0 0 10px 0;
  font-family: var(--font-heading, -apple-system, sans-serif);
}

.studio-title span {
  background: linear-gradient(135deg, #22d3ee 0%, #38bdf8 50%, #818cf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.studio-subtitle {
  font-size: 1.02rem;
  line-height: 1.55;
  color: #94a3b8;
  margin: 0;
  max-width: 680px;
}

.studio-hero-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

/* Glowing Cyan Primary CTA */
.btn-cyan-download {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #0284c7 0%, #0ea5e9 100%);
  color: #ffffff !important;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 11px 22px;
  border-radius: 9px;
  border: 1px solid #38bdf8;
  text-decoration: none !important;
  box-shadow: 0 4px 20px rgba(14, 165, 233, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.3);
  transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.btn-cyan-download:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #0ea5e9 0%, #38bdf8 100%);
  box-shadow: 0 6px 26px rgba(56, 189, 248, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.5);
  color: #071321 !important;
}

.badge-free {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.04em;
}

.install-stepper-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--skin-surface, #141F36);
  border: 1px solid var(--skin-border, #223254);
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 11.5px;
  color: var(--skin-text-dim, #94a3b8);
  font-family: var(--font-mono, monospace);
  white-space: nowrap;
}

.step-num {
  color: #38bdf8;
  font-weight: 700;
}

.step-arr {
  color: #475569;
}

.install-stepper-chip code {
  color: var(--skin-text, #e2e8f0);
  background: var(--skin-code, #090E1A);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--skin-border, #223254);
}

/* ==========================================================================
   2. The Master Studio Console (The Luxury Enclosed IDE)
   ========================================================================== */
.studio-container {
  max-width: 1360px;
  margin: 0 auto 40px;
  padding: 0 24px;
  width: 100%;
  box-sizing: border-box;
}

.studio-card {
  background: var(--skin-surface, #141F36);
  border: 1px solid var(--skin-border, #223254);
  border-radius: 14px;
  box-shadow: 
    0 24px 60px -12px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(0, 235, 255, 0.08),
    inset 0 1px 1px rgba(255, 255, 255, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Window Titlebar & Controls */
.studio-titlebar {
  height: 48px;
  background: var(--skin-hardware-chrome, #182642);
  border-bottom: 1px solid var(--skin-border, #223254);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  gap: 16px;
  flex-wrap: nowrap;
}

.window-controls {
  display: flex;
  align-items: center;
  gap: 7px;
}

.w-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}
.w-dot.red { background: #ef4444; opacity: 0.85; }
.w-dot.yellow { background: #f59e0b; opacity: 0.85; }
.w-dot.green { background: #10b981; opacity: 0.85; }

.titlebar-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: #cbd5e1;
  font-family: var(--font-mono, monospace);
}

.pill-local-shield {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.3);
  color: #38bdf8;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.titlebar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-ghost-action {
  background: var(--skin-elevated, #1C2B4A);
  border: 1px solid var(--skin-border, #223254);
  color: var(--skin-text, #cbd5e1);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 11px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 120ms ease;
}

.btn-ghost-action:hover {
  background: #23355b;
  border-color: rgba(56, 189, 248, 0.45);
  color: #ffffff;
}

.btn-studio-copy {
  background: #0ea5e9;
  border: 1px solid #38bdf8;
  color: #071321;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 10px rgba(14, 165, 233, 0.3);
  transition: all 120ms ease;
}

.btn-studio-copy:hover:not(:disabled) {
  background: #38bdf8;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.5);
}

.btn-studio-copy:disabled {
  background: rgba(30, 41, 59, 0.4);
  border-color: rgba(148, 163, 184, 0.15);
  color: #64748b;
  cursor: not-allowed;
  box-shadow: none;
}

/* ==========================================================================
   3. Quick-Scenario Ribbon (The 1-Click Interactive Row)
   ========================================================================== */
.scenario-ribbon {
  background: rgba(13, 20, 36, 0.55);
  border-bottom: 1px solid var(--skin-border, #223254);
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.ribbon-label {
  font-size: 11px;
  font-weight: 700;
  color: #38bdf8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: var(--font-mono, monospace);
  white-space: nowrap;
}

.ribbon-buttons {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.btn-scenario-chip {
  background: var(--skin-elevated, #1C2B4A);
  border: 1px solid var(--skin-border, #223254);
  color: var(--skin-text-dim, #94a3b8);
  font-size: 11.5px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 120ms ease;
  white-space: nowrap;
}

.btn-scenario-chip:hover {
  background: rgba(56, 189, 248, 0.14);
  border-color: rgba(56, 189, 248, 0.45);
  color: var(--skin-text, #f8fafc);
  transform: translateY(-1px);
}

.btn-scenario-chip.active {
  background: rgba(14, 165, 233, 0.22);
  border-color: #38bdf8;
  color: #38bdf8;
  font-weight: 700;
}

/* ==========================================================================
   4. Inline Context Strip (What are you trying to fix?)
   ========================================================================== */
.context-strip {
  background: rgba(13, 20, 36, 0.35);
  border-bottom: 1px solid var(--skin-border, #223254);
  padding: 10px 18px;
}

.context-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.context-badge {
  font-size: 11.5px;
  font-weight: 700;
  color: #94a3b8;
  font-family: var(--font-mono, monospace);
  white-space: nowrap;
}

.context-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #f1f5f9;
  font-size: 13px;
  outline: none;
  font-family: var(--font-body, sans-serif);
}

.context-input::placeholder {
  color: #475569;
}

.btn-subtle-toggle {
  background: none;
  border: none;
  color: #38bdf8;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}

.btn-subtle-toggle:hover {
  background: rgba(56, 189, 248, 0.1);
}

.context-extra-fields {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px dashed rgba(255, 255, 255, 0.07);
}

.context-extra-input {
  background: var(--skin-code, #090E1A);
  border: 1px solid var(--skin-border, #223254);
  border-radius: 6px;
  color: var(--skin-text, #e2e8f0);
  font-size: 12px;
  padding: 6px 10px;
  outline: none;
}

.context-extra-input:focus {
  border-color: #38bdf8;
}

/* ==========================================================================
   5. Two-Pane Split Editor (The IDE Workspace)
   ========================================================================== */
.studio-panes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 420px;
  background: var(--skin-code, #090E1A);
}

.pane-editor {
  display: flex;
  flex-direction: column;
  position: relative;
}

.pane-editor.left-pane {
  border-right: 1px solid var(--skin-border, #223254);
}

.pane-head {
  height: 38px;
  background: var(--skin-hardware-chrome, #182642);
  border-bottom: 1px solid var(--skin-border, #223254);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

.pane-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--skin-text, #cbd5e1);
  font-family: var(--font-mono, monospace);
}

.pane-counter {
  font-size: 11px;
  color: var(--skin-text-dim, #64748b);
  font-family: var(--font-mono, monospace);
}

/* Tab Toggle */
.pane-tab-group {
  display: inline-flex;
  background: var(--skin-code, #090E1A);
  padding: 2px;
  border-radius: 6px;
  border: 1px solid var(--skin-border, #223254);
}

.pane-tab-btn {
  background: transparent;
  border: none;
  color: var(--skin-text-dim, #94a3b8);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 120ms ease;
  font-family: var(--font-mono, monospace);
}

.pane-tab-btn.active {
  background: rgba(56, 189, 248, 0.18);
  color: #38bdf8;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* Editor Input & Output Displays */
.textarea-raw {
  flex: 1;
  width: 100%;
  background: transparent;
  border: none;
  color: var(--skin-text, #e2e8f0);
  font-family: var(--font-mono, "JetBrains Mono", Consolas, monospace);
  font-size: 12.5px;
  line-height: 1.6;
  padding: 16px;
  box-sizing: border-box;
  resize: none;
  outline: none;
  tab-size: 2;
  white-space: pre-wrap;
  word-break: break-word;
}

.textarea-raw::placeholder {
  color: var(--skin-text-dim, #475569);
}

.display-folded {
  flex: 1;
  width: 100%;
  background: transparent;
  color: var(--skin-text, #cbd5e1);
  font-family: var(--font-mono, "JetBrains Mono", Consolas, monospace);
  font-size: 12.5px;
  line-height: 1.6;
  padding: 16px;
  box-sizing: border-box;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  outline: none;
}

/* ==========================================================================
   6. Console Status Footer
   ========================================================================== */
.studio-footer {
  height: 40px;
  background: var(--skin-hardware-chrome, #182642);
  border-top: 1px solid var(--skin-border, #223254);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
}

.status-cluster {
  display: flex;
  align-items: center;
  gap: 8px;
}

.orb-status {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}
.orb-status.running {
  background-color: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.6);
}
.orb-status.error {
  background-color: #ef4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}

.status-label {
  font-size: 11.5px;
  color: #94a3b8;
  font-family: var(--font-mono, monospace);
}

.footer-metrics-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pill-savings {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  font-family: var(--font-mono, monospace);
}

.pill-guarantee {
  font-size: 11px;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* ==========================================================================
   Responsive Overrides
   ========================================================================== */
@media (max-width: 960px) {
  .studio-hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    padding: 24px 16px 16px;
  }
  .studio-hero-right {
    align-items: flex-start;
    width: 100%;
  }
  .btn-cyan-download {
    width: 100%;
    justify-content: center;
  }
  .install-stepper-chip {
    width: 100%;
    justify-content: center;
  }
  .studio-panes {
    grid-template-columns: 1fr;
  }
  .pane-editor.left-pane {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    min-height: 240px;
  }
  .pane-editor {
    min-height: 240px;
  }
  .studio-titlebar {
    height: auto;
    padding: 10px 14px;
    flex-wrap: wrap;
    gap: 10px;
  }
  .titlebar-actions {
    width: 100%;
    justify-content: flex-end;
  }
}
