@import url("styleDashboards.css");

/* ===== Shell ===== */
.lf-shell {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.10);
  padding: 24px 26px 18px;
}

.lf-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

/* ===== Primary / preview buttons ===== */
.dash-btn-primary {
  background: var(--dash-primary);
  color: #fff;
}
.dash-btn-primary:hover { background: var(--dash-primary-soft); color: #fff; }
.dash-btn-primary svg { stroke: #fff; }

/* light-blue "generate preview" button */
.lf-btn-preview {
  background: #e8f1ff;
  color: var(--dash-primary);
  border: 1px solid #bcd5fb;
}
.lf-btn-preview:hover { background: #d6e6ff; }

/* ===== Step icon in header, left of title ===== */
.lf-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.lf-step-icon {
  width: 42px;
  height: 42px;
  object-fit: contain;
  flex-shrink: 0;
}

/* ===== Panels ===== */
.lf-panel { display: none; }
.lf-panel.is-active { display: block; animation: lfFade 0.2s ease; }
@keyframes lfFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.lf-section-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--dash-text);
  margin: 0;
}

/* ===== Select option text fix ===== */
.lf-field select,
.lf-field select option { color: #1e1e1e !important; background: #fff !important; }

/* main.js converts every <select> into a nice-select widget; style it to match
   the other inputs and override the global `span { color:#fff }` rule. */
.lf-field .nice-select {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 30px 9px 12px;
  height: auto;
  line-height: 1.4;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  background: #f8faff;
  font-family: inherit;
  font-size: 0.88rem;
  float: none;
}
.lf-field .nice-select .current { color: #1e1e1e !important; font-weight: 500; }
.lf-field .nice-select .list { width: 100%; }
.lf-field .nice-select .option { color: #1e1e1e !important; }
.lf-field .nice-select .option:hover,
.lf-field .nice-select .option.focus,
.lf-field .nice-select .option.selected.focus { background: #eef2ff; }
.lf-field .nice-select.open { border-color: var(--dash-primary); box-shadow: 0 0 0 3px rgba(0, 59, 143, 0.1); }

/* ===== Form grid ===== */
.lf-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
}
.lf-field { display: flex; flex-direction: column; gap: 6px; }
.lf-field.lf-full { grid-column: 1 / -1; }
.lf-field label {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--dash-muted);
}
.lf-field input[type="text"],
.lf-field input[type="email"],
.lf-field input[type="url"],
.lf-field select,
.lf-field textarea {
  padding: 9px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  font-size: 0.88rem;
  font-family: inherit;
  color: #1e1e1e;
  background: #f8faff;
  transition: border-color 0.18s ease;
}
.lf-field input:focus,
.lf-field select:focus,
.lf-field textarea:focus {
  outline: none;
  border-color: var(--dash-primary);
  box-shadow: 0 0 0 3px rgba(0, 59, 143, 0.1);
}
.lf-req { color: #dc2626; }
.lf-check {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  text-transform: none !important;
  letter-spacing: normal !important;
  font-weight: 500 !important;
  color: #1e1e1e !important;
  font-size: 0.85rem !important;
}
.lf-color { display: flex; align-items: center; gap: 8px; }
.lf-color input[type="color"] {
  width: 42px; height: 38px; padding: 0; border: 1px solid #e2e8f0;
  border-radius: 9px; background: #fff; cursor: pointer;
}
.lf-color input[type="text"] { flex: 1; }

/* ===== EIN row (input + random button) ===== */
.lf-ein-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 6px;
}
.lf-ein-field { flex: 1; margin-bottom: 0 !important; }
.lf-btn-random-ein {
  white-space: nowrap;
  margin-bottom: 2px; /* align with input bottom */
  flex-shrink: 0;
}

/* ===== EIN hint ===== */
.lf-ein-hint {
  margin: 0 0 12px;
  font-size: 0.82rem;
  font-weight: 600;
  min-height: 1em;
}
.lf-ein-hint.is-existing { color: #16a34a; }
.lf-ein-hint.is-new { color: var(--dash-primary); }
.lf-ein-hint.is-blocked { color: #dc2626; }

/* ===== Validation errors ===== */
.lf-err {
  display: none;
  font-size: 0.74rem;
  color: #dc2626;
  font-weight: 600;
  margin-top: 3px;
}
.lf-err.is-visible { display: block; }
.lf-field.has-error input,
.lf-field.has-error select,
.lf-field.has-error textarea {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.10) !important;
}
.lf-hint-inline {
  text-transform: none;
  letter-spacing: normal;
  font-weight: 400;
  font-size: 0.72rem;
  color: var(--dash-muted);
}
.lf-char-count {
  font-size: 0.7rem;
  color: var(--dash-muted);
  text-align: right;
  display: block;
}

/* ===== Step 3 — live editor ===== */
.lf-toolbar-row { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }

.lf-live-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 18px;
  align-items: start;
  margin-top: 14px;
}
.lf-live-controls {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.lf-img-guide {
  margin: 0;
  padding-left: 18px;
  font-size: 0.82rem;
  color: var(--dash-text);
  line-height: 1.7;
}
.lf-img-guide b { color: var(--dash-primary); }

/* Image thumbnails (controls panel) */
.lf-thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.lf-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 1.5px dashed #d1d9f0;
  border-radius: 9px;
  background: #f8faff;
  cursor: pointer;
  overflow: hidden;
  color: #b0bdda;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.lf-thumb:hover { border-color: var(--dash-primary); box-shadow: 0 0 0 3px rgba(0,59,143,.12); }
.lf-thumb-badge {
  position: absolute;
  top: 3px; left: 4px;
  background: var(--dash-primary);
  color: #fff;
  font-size: 0.56rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 999px;
  z-index: 2;
}
.lf-thumb-ph { font-size: 0.62rem; color: #9aa8c7; }
.lf-thumb-img { display: none; width: 100%; height: 100%; object-fit: cover; }
.lf-thumb.has-image { border-style: solid; border-color: #c8d6f5; }
.lf-thumb.has-image .lf-thumb-img { display: block; }
.lf-thumb.has-image .lf-thumb-ph { display: none; }

/* "X" to remove an inserted image (only shown when the thumb has an image) */
.lf-thumb-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  z-index: 3;
}
.lf-thumb-remove:hover { background: #dc2626; }
.lf-thumb.has-image .lf-thumb-remove { display: flex; }
.lf-live-group {
  background: #f8faff;
  border: 1px solid #eef1f7;
  border-radius: 10px;
  padding: 14px;
}
.lf-live-group-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--dash-muted);
  margin: 0 0 10px;
}
.lf-live-frame-wrap {
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow-x: hidden;
  overflow-y: auto;
  height: 374px; /* ~2/3 of the previous 560px; scroll to see the rest */
  position: sticky;
  top: 16px;
  align-self: start;
  background: #fff;
}
/* Holds the scaled iframe; JS sets its height to the scaled (visual) page height
   so the scroll range matches the visible content (no white space below). */
.lf-live-frame-inner {
  position: relative;
  width: 100%;
  height: 2200px;
  overflow: hidden;
}
.lf-live-frame {
  width: 1280px;
  height: 2200px;
  border: none;
  display: block;
  transform-origin: top left;
}
.lf-note {
  background: #f1f5ff;
  border: 1px solid #dbe6fb;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 0.85rem;
  color: var(--dash-text);
  margin: 16px 0 12px;
}
.lf-products-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
.lf-product-card {
  border: 1px solid #eef1f7;
  border-radius: 12px;
  padding: 10px;
  text-align: center;
  background: #fff;
}
.lf-product-img {
  width: 100%;
  height: 90px;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  background-color: #f1f5ff;
  margin-bottom: 8px;
}
.lf-product-name { font-size: 0.8rem; font-weight: 700; color: var(--dash-text); }
.lf-product-price { font-size: 0.8rem; color: var(--dash-primary); margin: 2px 0 8px; }

/* ===== Review ===== */
.lf-review {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 18px;
}
.lf-color-swatch {
  display: inline-block;
  width: 14px; height: 14px;
  border-radius: 3px;
  border: 1px solid #e2e8f0;
  vertical-align: middle;
  margin-right: 6px;
}

/* ===== Footer ===== */
.lf-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid #eef1f7;
}
.lf-footer-right { display: flex; gap: 10px; }

/* ===== Preview action bar ===== */
.lp-actionbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 18px 20px;
  background: #fff;
  border: 1px solid #eef1f7;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(15,23,42,0.07);
}
.lp-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.lp-status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: #f1f5ff;
  color: var(--dash-primary);
  font-size: 0.74rem;
  font-weight: 700;
}
.lp-status-badge.status-AWAITING_APPROVAL { background: #fef9c3; color: #a16207; }
.lp-status-badge.status-APPROVED          { background: #dcfce7; color: #16a34a; }
.lp-status-badge.status-REJECTED          { background: #fee2e2; color: #dc2626; }

.lp-btn-delete { background: #fee2e2; color: #dc2626; border: 1px solid #fecaca; }
.lp-btn-delete:hover { background: #dc2626; color: #fff; }

/* ===== Rendered landing wrapper ===== */
.lp-render {
  width: 100%;
  box-sizing: border-box;
  border: none;
  border-radius: 0;
  overflow: visible;
  /* marketplace uses dark background */
  background-color: #1e1e1e;
  background: url('/img_mktplace/background/homeLandPages-bg.webp') no-repeat center center/cover;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* ===== Preview: allow full-page scroll ===== */
#previewRoot,
#previewRoot ~ *,
body:has(#previewRoot),
html:has(#previewRoot) {
  height: auto !important;
  min-height: 100vh;
  overflow: visible !important;
  overflow-x: hidden !important;
}
/* Remove the page wrapper padding so the nav sits flush at the top and the
   footer flush at the bottom (no gap above the header / below the footer). */
#previewRoot { padding: 0 !important; margin: 0 !important; }
#lpRender {
  min-height: 100vh;
  overflow: visible;
  display: flex;
  flex-direction: column;
}
/* Sections are flex items: give them full width so their inner grids
   (e.g. categories) lay out across columns instead of collapsing to content. */
#lpRender > section,
#lpRender > header { flex-shrink: 0; width: 100%; box-sizing: border-box; }
#lpRender > section:last-of-type { flex: 1; }
#lpRender > footer { margin-top: auto; }

/* Square image-icon placeholder for unselected images (matches step-3 slots,
   gray fill, no number badge, no text). */
.lp-img-ph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e5e7eb;
  border: 2px dashed #9ca3af;
  border-radius: 10px;
  color: #9ca3af;
  flex-shrink: 0;
}
.lp-img-ph svg { width: 45%; height: 45%; }
.lp-img-ph-logo { width: 40px; height: 40px; }
.lp-img-ph-prod {
  width: 100%;
  height: 100%;
  min-height: 180px;
  border-radius: 0;
}
.lp-img-ph-prod svg { width: 56px; height: 56px; }

/* ===== Floating action popup (preview screen) ===== */
.lp-fab {
  position: fixed;
  bottom: 72px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 23, 42, 0.40);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 8px 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
}
.lp-fab-status { display: none; }
.lp-fab-actions { display: flex; gap: 8px; }
.lp-fab-btn {
  background: transparent;
  border: 1.5px solid rgba(255, 255, 255, 0.70);
  border-radius: 999px;
  padding: 7px 18px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.14s ease;
  font-family: inherit;
}
.lp-fab-btn:hover  { background: rgba(255,255,255,0.12); transform: translateY(-1px); }
.lp-fab-btn:active { transform: scale(0.97); }

/* ===== Preview footer — full viewport width, bottom of page ===== */
.lp-footer-section {
  width: 100vw;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  box-sizing: border-box;
  background: #0f172a;
  color: #cbd5e1;
  padding: 20px 40px;
  margin: 0;
}
.lp-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 24px;
  align-items: center;
}
/* Left — socials + contact */
.lp-footer-social {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lp-footer-social-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.82rem;
  transition: color 0.18s ease;
}
.lp-footer-social-link:hover { color: #fff; }
.lp-footer-social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.lp-footer-social-icon svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
}
/* Center — business name + description */
.lp-footer-brand {
  text-align: center;
}
.lp-footer-name {
  display: block;
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 4px;
  letter-spacing: 0.02em;
}
.lp-footer-desc {
  font-size: 0.78rem;
  line-height: 1.5;
  color: #94a3b8;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* Right — copyright */
.lp-footer-copy {
  text-align: right;
}
.lp-footer-copy p {
  margin: 0;
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.5;
}
.lp-footer-copy small {
  font-size: 0.72rem;
  color: #475569;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .lf-grid, .lf-review { grid-template-columns: 1fr; }
  .lf-products-grid { grid-template-columns: repeat(2, 1fr); }
  .lf-header { flex-direction: column; }
  .lf-live-layout { grid-template-columns: 1fr; }
  .lf-live-controls { max-height: none; }
  .lf-product-slots, .lf-product-inputs { grid-template-columns: repeat(3, 1fr); }
  .lp-fab { flex-direction: column; border-radius: 18px; gap: 10px; }
  .lp-fab-status { border-right: none; border-bottom: 1px solid rgba(255,255,255,0.18); padding: 0 0 8px; }
  .lp-fab-actions { flex-wrap: wrap; justify-content: center; }
  .lp-footer-inner { grid-template-columns: 1fr; gap: 24px; }
  .lp-footer-copy { text-align: left; }
}

/* Product CSV import preview table (step 4) */
.lf-import-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: .85rem; }
.lf-import-table th, .lf-import-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid #e2e8f0; }
.lf-import-table th { color: #475569; font-weight: 700; }

/* Product spreadsheet import (step 4) */
.pi-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.pi-row input[type="file"] { flex: 1; min-width: 200px; }
.pi-table-wrap { overflow-x: auto; border: 1px solid #e2e8f0; border-radius: 10px; margin-top: 10px; }
.pi-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.pi-table th, .pi-table td { padding: 6px 8px; border-bottom: 1px solid #eef2f7; text-align: left; white-space: nowrap; }
.pi-table th { background: #f8faff; color: #475569; font-weight: 700; }
.pi-input { width: 100%; min-width: 90px; padding: 5px 7px; border: 1px solid #e2e8f0; border-radius: 6px; font: inherit; background: #fff; }
.pi-input.is-invalid { border-color: #dc2626; box-shadow: 0 0 0 2px rgba(220,38,38,.12); }
