/* ============================================================
   LetsGetLaunched — Wix-style editor shell
   ============================================================ */

:root {
  --editor-bar-h:    56px;
  --editor-rail-w:   68px;
  --editor-panel-w:  360px;
  --editor-accent:   #2563eb;
  --editor-ink:      #0f172a;
  --editor-mute:     #64748b;
  --editor-border:   #e2e8f0;
  --editor-bg:       #f1f5f9;
  --editor-surface:  #ffffff;
}

.editor-body {
  overflow: hidden;
  height: 100vh;
  background: var(--editor-bg);
}

.editor-shell {
  display: grid;
  grid-template-rows: var(--editor-bar-h) 1fr;
  grid-template-columns: var(--editor-rail-w) var(--editor-panel-w) 1fr;
  height: 100vh;
  width: 100vw;
}

/* ── Top bar ─────────────────────────────────────────── */
.editor-bar {
  grid-row: 1;
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  background: var(--editor-surface);
  border-bottom: 1px solid var(--editor-border);
  box-shadow: 0 1px 0 rgba(0,0,0,.02);
  z-index: 40;
}
.editor-bar__logo {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--editor-ink);
  text-decoration: none;
  margin-right: 8px;
  white-space: nowrap;
}
.editor-bar__logo span { color: var(--editor-accent); }
.editor-bar__divider {
  width: 1px;
  height: 24px;
  background: var(--editor-border);
}
.editor-bar__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--editor-ink);
  display: flex;
  align-items: center;
  gap: 6px;
}
.editor-bar__title-muted { color: var(--editor-mute); font-weight: 500; }
.editor-bar__spacer { flex: 1; }
.editor-bar__devices { display: flex; gap: 4px; }
.editor-bar__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  color: var(--editor-ink);
  background: var(--editor-surface);
  border: 1px solid var(--editor-border);
  border-radius: 8px;
  cursor: pointer;
  transition: all .12s;
}
.editor-bar__btn:hover { border-color: var(--editor-accent); color: var(--editor-accent); }
.editor-bar__btn[disabled] { opacity: .4; cursor: not-allowed; }
.editor-bar__btn--icon {
  width: 34px;
  height: 34px;
  padding: 0;
  justify-content: center;
  font-size: 15px;
}
.editor-bar__btn--active {
  border-color: var(--editor-accent);
  color: var(--editor-accent);
  background: #eff6ff;
}
.editor-bar__btn--primary {
  background: var(--editor-accent);
  color: #fff;
  border-color: var(--editor-accent);
}
.editor-bar__btn--primary:hover {
  background: #1d4ed8;
  color: #fff;
}
.editor-bar__btn--attention {
  background: #16a34a;
  border-color: #16a34a;
  color: #fff;
  box-shadow: 0 0 0 4px rgba(22,163,74,.18);
  animation: attention-pulse 2s ease-in-out infinite;
}
.editor-bar__btn--attention:hover {
  background: #15803d;
  border-color: #15803d;
}
@keyframes attention-pulse {
  0%,100% { box-shadow: 0 0 0 4px rgba(22,163,74,.18); }
  50%     { box-shadow: 0 0 0 8px rgba(22,163,74,.10); }
}
.editor-bar__status {
  font-size: 12px;
  color: var(--editor-mute);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  white-space: nowrap;
}
.editor-bar__status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
}
.editor-bar__status--saved .editor-bar__status-dot { background: #16a34a; }
.editor-bar__status--saving .editor-bar__status-dot { background: #f59e0b; animation: pulse 1s infinite; }
.editor-bar__status--error .editor-bar__status-dot { background: #dc2626; }
.editor-bar__status--publishing .editor-bar__status-dot { background: #2563eb; animation: pulse 1s infinite; }
@keyframes pulse { 0%,100%{opacity:1;} 50%{opacity:.35;} }

/* ── Left icon rail ─────────────────────────────────── */
.editor-rail {
  grid-row: 2;
  grid-column: 1;
  background: var(--editor-surface);
  border-right: 1px solid var(--editor-border);
  display: flex;
  flex-direction: column;
  padding: 12px 0;
  gap: 2px;
  overflow-y: auto;
}
.editor-rail__btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 6px;
  background: transparent;
  border: 0;
  color: var(--editor-mute);
  font-family: inherit;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  letter-spacing: 0.02em;
  transition: color .12s;
}
.editor-rail__btn:hover { color: var(--editor-ink); }
.editor-rail__btn--active { color: var(--editor-accent); }
.editor-rail__btn--active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--editor-accent);
}
.editor-rail__icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: transparent;
  font-size: 18px;
  line-height: 1;
}
.editor-rail__btn--active .editor-rail__icon { background: #eff6ff; }

/* ── Control panel ──────────────────────────────────── */
.editor-panel {
  grid-row: 2;
  grid-column: 2;
  background: var(--editor-surface);
  border-right: 1px solid var(--editor-border);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.editor-panel__header {
  padding: 20px 20px 12px;
  border-bottom: 1px solid var(--editor-border);
  position: sticky;
  top: 0;
  background: var(--editor-surface);
  z-index: 2;
}
.editor-panel__header h2 {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
}
.editor-panel__header p {
  font-size: 13px;
  color: var(--editor-mute);
  margin: 4px 0 0;
}
.editor-panel__body {
  padding: 16px 20px 40px;
}
.editor-panel__body .card {
  margin-bottom: 16px;
  padding: 16px;
  border-radius: 10px;
  border: 1px solid var(--editor-border);
  box-shadow: none;
  background: var(--editor-surface);
}
.editor-panel__body .card h3 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--editor-ink);
}
.editor-panel__body .input-group { margin-bottom: 12px; }
.editor-panel__body .input-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--editor-ink);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.editor-panel__body .input {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  border: 1px solid var(--editor-border);
  border-radius: 8px;
  background: var(--editor-surface);
  color: var(--editor-ink);
  transition: border-color .12s, box-shadow .12s;
}
.editor-panel__body .input:focus {
  outline: none;
  border-color: var(--editor-accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

/* Small section block preview tiles */
.block-tiles { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; }
.block-tile {
  border: 1px solid var(--editor-border);
  border-radius: 10px;
  padding: 14px 12px;
  background: var(--editor-surface);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: all .12s;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 96px;
}
.block-tile:hover {
  border-color: var(--editor-accent);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37,99,235,.12);
}
.block-tile__icon { font-size: 22px; }
.block-tile__name { font-size: 13px; font-weight: 700; color: var(--editor-ink); }
.block-tile__desc { font-size: 11px; color: var(--editor-mute); line-height: 1.3; }

/* Theme tiles */
.theme-tiles { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; }
.theme-tile {
  border: 1.5px solid var(--editor-border);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  background: var(--editor-surface);
  padding: 0;
  font-family: inherit;
  transition: all .12s;
}
.theme-tile:hover { border-color: var(--editor-accent); transform: translateY(-1px); }
.theme-tile--active { border-color: var(--editor-accent); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.theme-tile__preview {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
}
.theme-tile__label {
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  color: var(--editor-ink);
  border-top: 1px solid var(--editor-border);
}

/* ── Canvas ─────────────────────────────────────────── */
.editor-canvas {
  grid-row: 2;
  grid-column: 3;
  position: relative;
  background: var(--editor-bg);
  padding: 18px 24px 24px;
  overflow: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
.editor-canvas__frame {
  width: 100%;
  max-width: 100%;
  height: calc(100vh - var(--editor-bar-h) - 42px);
  border: 0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 40px rgba(15,23,42,.12);
  transition: max-width .25s ease;
}
.editor-canvas__frame--tablet { max-width: 820px; }
.editor-canvas__frame--mobile { max-width: 412px; }
.editor-canvas__empty {
  max-width: 480px;
  margin: 80px auto;
  text-align: center;
  color: var(--editor-mute);
}

/* ── AI copilot popover ─────────────────────────────── */
.ai-pop {
  position: fixed;
  z-index: 9999;
  background: var(--editor-surface);
  border: 1px solid var(--editor-border);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(15,23,42,.18);
  width: 360px;
  padding: 16px;
}
.ai-pop h4 { font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.ai-pop textarea {
  width: 100%;
  border: 1px solid var(--editor-border);
  border-radius: 8px;
  padding: 10px;
  font-family: inherit;
  font-size: 13px;
  resize: vertical;
  min-height: 60px;
}
.ai-pop__results { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.ai-pop__result {
  padding: 8px 10px;
  border: 1px solid var(--editor-border);
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  background: var(--editor-surface);
  text-align: left;
  font-family: inherit;
}
.ai-pop__result:hover { border-color: var(--editor-accent); background: #eff6ff; }

/* ── Toast ──────────────────────────────────────────── */
.editor-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: var(--editor-ink);
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 9998;
}
.editor-toast--show { opacity: 1; transform: translateX(-50%) translateY(-4px); }

/* ── Template browser modal (Wix-style) ─────────────── */
.tmpl-modal {
  position: fixed;
  inset: 0;
  background: var(--editor-surface);
  z-index: 9998;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.tmpl-modal[hidden] { display: none; }
.tmpl-modal__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 40px 16px;
  border-bottom: 1px solid var(--editor-border);
}
.tmpl-modal__title {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--editor-ink);
  margin: 0;
}
.tmpl-modal__close {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--editor-border);
  background: var(--editor-surface);
  font-size: 18px;
  cursor: pointer;
  color: var(--editor-ink);
  transition: all .15s;
}
.tmpl-modal__close:hover {
  border-color: var(--editor-ink);
  transform: rotate(90deg);
}
.tmpl-modal__searchbar {
  padding: 20px 40px 16px;
  display: flex;
  justify-content: center;
}
.tmpl-search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border: 1px solid var(--editor-border);
  border-radius: 999px;
  max-width: 640px;
  width: 100%;
  background: var(--editor-surface);
  transition: border-color .15s, box-shadow .15s;
}
.tmpl-search:focus-within {
  border-color: var(--editor-accent);
  box-shadow: 0 0 0 4px rgba(37,99,235,.1);
}
.tmpl-search__icon { font-size: 16px; opacity: .55; }
.tmpl-search input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 16px;
  font-family: inherit;
  color: var(--editor-ink);
}
.tmpl-search button {
  background: var(--editor-border);
  border: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 11px;
  cursor: pointer;
  color: var(--editor-ink);
}

.tmpl-modal__filters {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 10px 40px 14px;
  border-bottom: 1px solid var(--editor-border);
  position: relative;
}
.tmpl-filter-group { position: relative; }
.tmpl-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  background: transparent;
  border: 0;
  color: var(--editor-ink);
  cursor: pointer;
}
.tmpl-filter-btn__label { color: var(--editor-accent); }
.tmpl-filter-btn__caret { font-size: 10px; color: var(--editor-accent); }
.tmpl-filter-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 8px;
  background: var(--editor-surface);
  border: 1px solid var(--editor-border);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(15,23,42,.18);
  padding: 16px;
  min-width: 440px;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 24px;
}
.tmpl-filter-dropdown[hidden] { display: none; }
.tmpl-filter-option {
  background: transparent;
  border: 0;
  padding: 8px 4px;
  font-size: 14px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  color: var(--editor-ink);
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 6px;
  transition: background .1s;
}
.tmpl-filter-option:hover { background: var(--editor-bg); color: var(--editor-accent); }
.tmpl-filter-option__icon { font-size: 14px; }
.tmpl-modal__filters-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}
.tmpl-sort {
  background: transparent;
  border: 0;
  font-family: inherit;
  font-size: 14px;
  color: var(--editor-mute);
  cursor: pointer;
}
.tmpl-sort:hover { color: var(--editor-ink); }
.tmpl-result-count {
  font-size: 13px;
  color: var(--editor-mute);
}

.tmpl-modal__active-filters {
  display: flex;
  gap: 8px;
  padding: 10px 40px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--editor-border);
}
.tmpl-modal__active-filters[hidden] { display: none; }
.tmpl-active-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #eff6ff;
  color: var(--editor-accent);
  border: 1px solid rgba(37,99,235,.2);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.tmpl-active-chip:hover { background: #dbeafe; }

.tmpl-modal__grid {
  flex: 1;
  overflow-y: auto;
  padding: 28px 40px 60px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 28px;
  align-content: start;
}

.tmpl-card {
  background: var(--editor-surface);
  border: 1px solid var(--editor-border);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  position: relative;
  display: flex;
  flex-direction: column;
  font-family: inherit;
  padding: 0;
  text-align: left;
}
.tmpl-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 48px rgba(15,23,42,.15);
  border-color: var(--editor-accent);
}
.tmpl-card__preview {
  aspect-ratio: 4/3;
  overflow: hidden;
  position: relative;
  background: var(--editor-bg);
}
.tmpl-card__hover {
  position: absolute;
  inset: 0;
  background: rgba(15,23,42,.82);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  opacity: 0;
  transition: opacity .2s;
}
.tmpl-card:hover .tmpl-card__hover { opacity: 1; }
.tmpl-card__hover-btn {
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  background: #fff;
  color: var(--editor-ink);
  transition: transform .15s;
}
.tmpl-card__hover-btn--primary { background: var(--editor-accent); color: #fff; }
.tmpl-card__hover-btn:hover { transform: scale(1.05); }
.tmpl-card__meta {
  padding: 16px 18px 18px;
  border-top: 1px solid var(--editor-border);
}
.tmpl-card__name {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--editor-ink);
  margin: 0 0 4px;
}
.tmpl-card__tags {
  display: flex;
  gap: 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--editor-mute);
  font-weight: 600;
}
.tmpl-card--active {
  border-color: var(--editor-accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,.18);
}
.tmpl-card__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--editor-accent);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 4px 10px;
  border-radius: 999px;
  z-index: 2;
}

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 960px) {
  .editor-shell {
    grid-template-columns: var(--editor-rail-w) 1fr;
  }
  .editor-panel {
    position: fixed;
    left: var(--editor-rail-w);
    top: var(--editor-bar-h);
    bottom: 0;
    width: var(--editor-panel-w);
    max-width: 85vw;
    z-index: 20;
    transform: translateX(-100%);
    transition: transform .2s;
  }
  .editor-panel--open { transform: translateX(0); }
  .editor-canvas { grid-column: 2; padding: 10px; }
}
