/* ==========================================================================
   L2 SITE STUDIO — COMMERCIAL-GRADE WEBSITE BUILDER (Nov 2026)
   Aesthetic: Linear / Framer / Webflow Dark Minimalist Standard
   ========================================================================== */

:root {
  --st-bg: #07090D;
  --st-panel: #0E1219;
  --st-surface: #141923;
  --st-surface-hover: #1C2331;
  --st-surface-active: #242D3F;
  --st-border: rgba(255, 255, 255, 0.08);
  --st-border-strong: rgba(255, 255, 255, 0.16);
  --st-text: #F4F3EF;
  --st-muted: #959EAE;
  --st-subtle: #5E6778;
  --st-accent: #FF5520;
  --st-accent-hover: #FF6E3D;
  --st-accent-soft: rgba(255, 85, 32, 0.12);
  --st-accent-border: rgba(255, 85, 32, 0.35);
  --st-emerald: #10B981;
  --st-emerald-soft: rgba(16, 185, 129, 0.12);
  --st-radius-sm: 8px;
  --st-radius: 12px;
  --st-radius-lg: 16px;
  --st-font-sans: "Golos Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --st-font-display: "Geologica", sans-serif;
  --st-font-mono: "JetBrains Mono", monospace;
}

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

html, body {
  width: 100%;
  height: 100%;
  background: var(--st-bg);
  color: var(--st-text);
  font-family: var(--st-font-sans);
  font-size: 13.5px;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* 1. Sleek Top Bar */
.st-topbar {
  height: 54px;
  background: var(--st-panel);
  border-bottom: 1px solid var(--st-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  gap: 16px;
  z-index: 50;
}

.st-brand-cluster {
  display: flex;
  align-items: center;
  gap: 12px;
}

.st-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--st-text);
  font-family: var(--st-font-display);
  font-weight: 800;
  font-size: 14.5px;
  letter-spacing: -0.02em;
}

.st-logo-badge {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--st-accent);
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--st-font-mono);
  font-weight: 800;
  font-size: 12px;
  box-shadow: 0 4px 12px var(--st-accent-soft);
}

.st-site-picker-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.st-site-select {
  height: 32px;
  padding: 0 28px 0 12px;
  border-radius: var(--st-radius-sm);
  background: var(--st-surface);
  border: 1px solid var(--st-border);
  color: var(--st-text);
  font-family: var(--st-font-mono);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  appearance: none;
}

.st-site-select:focus {
  outline: 2px solid var(--st-accent);
  border-color: var(--st-accent);
}

.st-site-select-arrow {
  position: absolute;
  right: 10px;
  pointer-events: none;
  font-size: 9px;
  color: var(--st-muted);
}

.st-rev-pill {
  font-family: var(--st-font-mono);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--st-emerald-soft);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Center Controls: Viewport & Zoom */
.st-center-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.st-segmented-bar {
  display: flex;
  align-items: center;
  background: var(--st-surface);
  padding: 3px;
  border-radius: var(--st-radius-sm);
  border: 1px solid var(--st-border);
}

.st-seg-btn {
  height: 28px;
  padding: 0 11px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--st-muted);
  font-family: var(--st-font-sans);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.st-seg-btn:hover {
  color: var(--st-text);
}

.st-seg-btn.is-active {
  background: var(--st-accent);
  color: #FFFFFF;
}

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

.st-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--st-radius-sm);
  border: 1px solid var(--st-border-strong);
  background: var(--st-surface);
  color: var(--st-text);
  font-family: var(--st-font-sans);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.st-btn:hover {
  background: var(--st-surface-hover);
  border-color: var(--st-accent-border);
}

.st-btn-primary {
  background: var(--st-accent);
  border-color: var(--st-accent);
  color: #FFFFFF;
  box-shadow: 0 4px 14px var(--st-accent-soft);
}

.st-btn-primary:hover {
  background: var(--st-accent-hover);
  border-color: var(--st-accent-hover);
}

/* 2. 3-Column Main Workspace */
.st-workspace {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr) 360px;
  height: calc(100vh - 54px);
  height: calc(100dvh - 54px);
}

/* Left Sidebar (Navigator & Design System) */
.st-sidebar-left {
  background: var(--st-panel);
  border-right: 1px solid var(--st-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.st-sidebar-tabs {
  display: flex;
  border-bottom: 1px solid var(--st-border);
  background: var(--st-panel);
}

.st-tab-trigger {
  flex: 1;
  height: 40px;
  border: none;
  background: transparent;
  color: var(--st-muted);
  font-family: var(--st-font-sans);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s ease;
}

.st-tab-trigger.is-active {
  color: var(--st-text);
  border-bottom-color: var(--st-accent);
  background: rgba(255, 255, 255, 0.02);
}

.st-sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Layer Block Tree */
.st-tree-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.st-tree-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: var(--st-radius-sm);
  background: var(--st-surface);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.st-tree-item:hover {
  background: var(--st-surface-hover);
  border-color: var(--st-border);
}

.st-tree-item.is-selected {
  background: var(--st-accent-soft);
  border-color: var(--st-accent);
}

.st-tree-main {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.st-tree-icon {
  font-size: 14px;
  flex-shrink: 0;
}

.st-tree-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--st-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.st-tree-type {
  font-family: var(--st-font-mono);
  font-size: 10px;
  color: var(--st-muted);
}

.st-tree-actions {
  display: flex;
  align-items: center;
  gap: 3px;
  opacity: 0.45;
  transition: opacity 0.15s ease;
}

.st-tree-item:hover .st-tree-actions,
.st-tree-item.is-selected .st-tree-actions {
  opacity: 1;
}

.st-icon-btn {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: var(--st-text);
  font-size: 11px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.st-icon-btn:hover {
  background: var(--st-accent);
  color: #FFFFFF;
}

/* 3. Center Live Canvas */
.st-canvas-stage {
  background: #05070A;
  background-image:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 24px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 16px 20px 84px 20px;
  position: relative;
  overflow: auto;
}

.st-canvas-frame-shell {
  width: 100%;
  height: 100%;
  max-width: 1440px;
  background: #0B0D12;
  border-radius: var(--st-radius-lg);
  border: 1px solid var(--st-border-strong);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: max-width 0.22s cubic-bezier(0.16, 1, 0.3, 1), transform 0.22s ease;
}

.st-canvas-frame-header {
  height: 28px;
  background: #11141C;
  border-bottom: 1px solid var(--st-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  font-family: var(--st-font-mono);
  font-size: 10.5px;
  color: var(--st-muted);
}

.st-canvas-frame-shell iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #0B0D12;
}

/* Floating AI Co-Pilot Command Bar at bottom of canvas */
.st-ai-command-bar {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 640px;
  background: color-mix(in srgb, var(--st-panel) 92%, transparent);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid var(--st-border-strong);
  border-radius: 999px;
  padding: 6px 8px 6px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  z-index: 60;
}

.st-ai-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--st-text);
  font-family: var(--st-font-sans);
  font-size: 13px;
}

.st-ai-input:focus {
  outline: none;
}

.st-ai-input::placeholder {
  color: var(--st-muted);
}

/* 4. Right Sidebar (Visual Property Inspector) */
.st-sidebar-right {
  background: var(--st-panel);
  border-left: 1px solid var(--st-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.st-inspector-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--st-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--st-panel);
}

.st-inspector-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--st-font-display);
  font-weight: 700;
  font-size: 13px;
}

.st-inspector-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Visual Form Controls */
.st-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.st-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--st-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.st-input, .st-select, .st-textarea {
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--st-radius-sm);
  background: var(--st-surface);
  border: 1px solid var(--st-border);
  color: var(--st-text);
  font-family: var(--st-font-sans);
  font-size: 12.5px;
  line-height: 1.4;
  transition: border-color 0.15s ease;
}

.st-input:focus, .st-select:focus, .st-textarea:focus {
  outline: none;
  border-color: var(--st-accent);
}

.st-textarea {
  resize: vertical;
}

.st-card-field-box {
  background: var(--st-surface);
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-sm);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.st-card-field-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--st-muted);
}

/* Model Ladder Segmented Banner */
.st-ladder-card {
  background: linear-gradient(135deg, rgba(255, 85, 32, 0.08) 0%, rgba(16, 185, 129, 0.04) 100%);
  border: 1px solid var(--st-accent-border);
  border-radius: var(--st-radius);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.st-ladder-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--st-text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.st-ladder-desc {
  font-size: 11px;
  color: var(--st-muted);
  line-height: 1.4;
}

/* Modals & Drawers */
.st-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(4, 6, 9, 0.82);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.st-modal-backdrop.is-open {
  display: flex;
}

.st-modal {
  width: 100%;
  max-width: 720px;
  background: var(--st-panel);
  border: 1px solid var(--st-border-strong);
  border-radius: var(--st-radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8);
}

.st-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.st-catalog-card {
  background: var(--st-surface);
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius);
  padding: 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.15s ease;
}

.st-catalog-card:hover {
  background: var(--st-surface-hover);
  border-color: var(--st-accent);
  transform: translateY(-2px);
}

.st-catalog-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.st-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  background: var(--st-panel);
  border: 1px solid var(--st-accent);
  color: var(--st-text);
  padding: 12px 18px;
  border-radius: var(--st-radius-sm);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  display: none;
  font-weight: 600;
  font-size: 13px;
}

.st-toast.show {
  display: block;
}

/* Responsive adjustments */
@media (max-width: 1100px) {
  html, body {
    overflow: auto;
  }
  .st-workspace {
    grid-template-columns: 1fr;
    height: auto;
  }
  .st-canvas-stage {
    height: 600px;
    padding-bottom: 20px;
  }
}
