/* ══════════════════════════════════════
   MARKETING MODULE — marketing.css
   Uses design tokens from style.css
══════════════════════════════════════ */

/* ── Dashboard Stats ── */
.mkt-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.mkt-stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}
.mkt-stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.mkt-stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.mkt-stat-val { font-size: 26px; font-weight: 800; color: var(--text-main); line-height: 1; }
.mkt-stat-label { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 4px; }

/* ── LP Grid ── */
.mkt-lp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.mkt-lp-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.mkt-lp-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--brand-primary); }
.mkt-lp-card-thumb {
  height: 140px; display: flex; align-items: center; justify-content: center;
  position: relative; border-bottom: 1px solid var(--border-light);
}
.mkt-lp-status-badge {
  position: absolute; top: 12px; right: 12px;
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 20px;
}
.mkt-lp-status-dot { width: 6px; height: 6px; border-radius: 50%; }
.mkt-lp-card-body { padding: 16px; }
.mkt-lp-card-title { font-size: 15px; font-weight: 800; color: var(--text-main); margin-bottom: 4px; }
.mkt-lp-card-slug { font-size: 12px; color: var(--text-light); font-family: monospace; margin-bottom: 12px; }
.mkt-lp-card-stats { display: flex; gap: 12px; font-size: 12px; color: var(--text-muted); font-weight: 600; }
.mkt-lp-card-stats span { display: flex; align-items: center; gap: 4px; }
.mkt-lp-card-actions {
  display: flex; gap: 4px;
  padding: 10px 16px;
  border-top: 1px solid var(--border-light);
  background: var(--bg-subtle);
}
.mkt-card-btn {
  flex: 1; height: 32px;
  border: 1px solid var(--border-light);
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  color: var(--text-muted); font-size: 14px; cursor: pointer;
  transition: all 0.2s;
  display: flex; align-items: center; justify-content: center;
}
.mkt-card-btn:hover { background: var(--brand-primary); color: #fff; border-color: var(--brand-primary); }
.mkt-card-btn.danger:hover { background: var(--status-error); border-color: var(--status-error); color: #fff; }

/* ── Empty State ── */
.mkt-empty-state { text-align: center; padding: 80px 24px; color: var(--text-muted); }
.mkt-empty-icon {
  width: 80px; height: 80px; border-radius: 50%;
  background: var(--bg-subtle);
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; color: var(--text-light); margin: 0 auto 20px;
}
.mkt-empty-state h3 { font-size: 18px; font-weight: 800; color: var(--text-main); margin-bottom: 8px; }
.mkt-empty-state p { font-size: 14px; margin-bottom: 24px; }

/* ══════════════════════════════════════
   LP BUILDER
══════════════════════════════════════ */

/* Full-height override for builder page */
.lp-builder-page { padding: 0 !important; display: none; flex-direction: column; overflow: hidden; }
.lp-builder-page.active { display: flex; }

/* ── Top Bar ── */
.lp-builder-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
  gap: 12px; flex-shrink: 0;
  box-shadow: var(--shadow-sm); z-index: 10;
}
.lp-builder-topbar-left { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.lp-builder-back {
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-base); background: var(--bg-subtle);
  color: var(--text-muted); font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; flex-shrink: 0;
}
.lp-builder-back:hover { background: var(--brand-primary); color: #fff; border-color: var(--brand-primary); }
.lp-builder-meta { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.lp-builder-title-input {
  font-size: 14px; font-weight: 800; color: var(--text-main);
  background: transparent; border: none; outline: none;
  font-family: var(--font-sans); width: 280px; padding: 2px 4px;
  border-radius: 4px;
}
.lp-builder-title-input:focus { background: var(--bg-subtle); }
.lp-builder-slug-row { display: flex; align-items: center; }
.lp-builder-slug-prefix { font-size: 11px; color: var(--text-light); font-family: monospace; }
.lp-builder-slug-input {
  font-size: 11px; color: var(--brand-primary); background: transparent;
  border: none; outline: none; font-family: monospace; font-weight: 600;
  padding: 0; min-width: 60px; width: 200px;
}
.lp-builder-slug-input:focus { border-bottom: 1px solid var(--brand-primary); }
.lp-builder-topbar-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.lp-device-toggle { display: flex; border: 1px solid var(--border-base); border-radius: var(--radius-sm); overflow: hidden; }
.lp-device-btn {
  width: 34px; height: 32px; background: var(--bg-subtle);
  border: none; color: var(--text-muted); font-size: 15px; cursor: pointer;
  transition: all 0.2s; display: flex; align-items: center; justify-content: center;
}
.lp-device-btn.active { background: var(--brand-primary); color: #fff; }

/* ── Builder Layout ── */
.lp-builder-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  flex: 1; min-height: 0; overflow: hidden;
}

/* ── Builder Sidebar ── */
.lp-builder-sidebar {
  background: var(--bg-surface);
  border-inline-end: 1px solid var(--border-light);
  display: flex; flex-direction: column; overflow: hidden;
}

/* ── Builder Tabs ── */
.lp-builder-tabs {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--border-light); flex-shrink: 0;
}
.lp-tab-btn {
  padding: 10px 4px 8px;
  border: none; border-bottom: 2px solid transparent;
  background: transparent; color: var(--text-muted);
  font-size: 10px; font-weight: 700; font-family: var(--font-sans);
  cursor: pointer; transition: all 0.2s;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  text-transform: uppercase; letter-spacing: 0.3px;
}
.lp-tab-btn i { font-size: 17px; }
.lp-tab-btn.active { color: var(--brand-primary); border-bottom-color: var(--brand-primary); background: rgba(79,70,229,0.04); }
.lp-tab-btn:hover:not(.active) { color: var(--text-main); background: var(--bg-subtle); }

/* ── Tab Panels ── */
.lp-tab-panel { flex: 1; overflow-y: auto; padding: 14px; }
.lp-tab-panel::-webkit-scrollbar { width: 4px; }
.lp-tab-panel::-webkit-scrollbar-thumb { background: var(--border-base); border-radius: 4px; }

/* ── Add Section Grid ── */
.lp-add-sections-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 7px; margin-bottom: 18px;
}
.lp-add-section-btn {
  display: flex; flex-direction: column; align-items: center;
  gap: 5px; padding: 10px 4px;
  border: 1px dashed var(--border-base); border-radius: var(--radius-md);
  background: var(--bg-subtle); color: var(--text-muted);
  font-size: 10px; font-weight: 700; font-family: var(--font-sans);
  cursor: pointer; transition: all 0.2s; text-align: center; text-transform: uppercase; letter-spacing: 0.3px;
}
.lp-add-section-btn i { font-size: 19px; }
.lp-add-section-btn:hover {
  border-color: var(--brand-primary); color: var(--brand-primary);
  background: rgba(79,70,229,0.04); border-style: solid;
}

/* ── Section List ── */
.lp-sections-label {
  font-size: 10px; font-weight: 800; text-transform: uppercase;
  color: var(--text-light); letter-spacing: 0.5px; margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
}
.lp-sections-count {
  background: var(--brand-primary); color: #fff;
  font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 10px;
}
.lp-section-card {
  display: flex; align-items: center; gap: 6px; padding: 9px 10px;
  border: 1px solid var(--border-light); border-radius: var(--radius-md);
  background: var(--bg-surface); margin-bottom: 6px; transition: all 0.2s;
}
.lp-section-card:hover { border-color: var(--brand-primary); box-shadow: var(--shadow-sm); }
.lp-section-card-drag { color: var(--text-light); font-size: 15px; cursor: grab; flex-shrink: 0; }
.lp-section-card-info {
  flex: 1; display: flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 600; color: var(--text-main); min-width: 0;
}
.lp-section-card-actions { display: flex; gap: 3px; flex-shrink: 0; }
.lp-sec-action-btn {
  width: 26px; height: 26px; border: 1px solid var(--border-light);
  border-radius: 6px; background: var(--bg-subtle); color: var(--text-muted);
  font-size: 12px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all 0.2s;
}
.lp-sec-action-btn:hover { background: var(--brand-primary); color: #fff; border-color: var(--brand-primary); }
.lp-sec-action-btn.danger:hover { background: var(--status-error); border-color: var(--status-error); }
.lp-no-sections { text-align: center; color: var(--text-light); font-size: 13px; padding: 20px; }

/* ── Section Editor ── */
.lp-editor-back-row {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--border-light);
}
.lp-editor-back-btn {
  display: flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 700; color: var(--text-muted);
  background: var(--bg-subtle); border: 1px solid var(--border-base);
  border-radius: var(--radius-sm); padding: 5px 10px; cursor: pointer;
  font-family: var(--font-sans); transition: all 0.2s;
}
.lp-editor-back-btn:hover { color: var(--text-main); }
.lp-editor-title { font-size: 14px; font-weight: 800; color: var(--text-main); }
.lp-editor-field { margin-bottom: 12px; }
.lp-editor-label {
  display: block; font-size: 10px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 5px;
}
.lp-editor-input {
  width: 100%; padding: 8px 10px;
  border: 1px solid var(--border-base); border-radius: var(--radius-sm);
  background: var(--bg-subtle); color: var(--text-main);
  font-size: 13px; font-family: var(--font-sans); outline: none;
  transition: all 0.2s; box-sizing: border-box; margin-bottom: 5px;
}
.lp-editor-input:focus { border-color: var(--brand-primary); background: var(--bg-surface); box-shadow: 0 0 0 3px rgba(79,70,229,0.1); }
.lp-editor-textarea { resize: vertical; min-height: 68px; line-height: 1.5; }
.lp-field-hint { font-size: 11px; color: var(--text-light); line-height: 1.4; margin-top: 2px; }

/* ── Image Upload ── */
.lp-img-upload-row { display: flex; align-items: flex-start; gap: 10px; }
.lp-img-thumb { width: 60px; height: 60px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border-light); flex-shrink: 0; }
.lp-img-placeholder {
  width: 60px; height: 60px; border-radius: var(--radius-sm);
  border: 1px dashed var(--border-base); background: var(--bg-subtle);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-light); font-size: 20px; flex-shrink: 0;
}
.lp-img-upload-actions { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.lp-upload-btn {
  display: flex; align-items: center; gap: 5px; padding: 7px 10px;
  border: 1px solid var(--border-base); border-radius: var(--radius-sm);
  background: var(--bg-surface); color: var(--text-muted);
  font-size: 12px; font-weight: 600; font-family: var(--font-sans);
  cursor: pointer; transition: all 0.2s;
}
.lp-upload-btn:hover { background: var(--brand-primary); color: #fff; border-color: var(--brand-primary); }

/* ── Items Editor ── */
.lp-items-editor { margin-top: 2px; }
.lp-items-label {
  font-size: 10px; font-weight: 800; text-transform: uppercase;
  color: var(--text-light); letter-spacing: 0.4px; margin-bottom: 8px;
  display: flex; align-items: center; gap: 7px;
}
.lp-item-card {
  background: var(--bg-subtle); border: 1px solid var(--border-light);
  border-radius: var(--radius-md); padding: 10px; margin-bottom: 7px;
}
.lp-item-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.lp-item-num { font-size: 10px; font-weight: 800; color: var(--text-muted); text-transform: uppercase; }
.lp-item-remove-btn {
  width: 22px; height: 22px; border: none; border-radius: 4px;
  background: transparent; color: var(--text-light); font-size: 12px;
  cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s;
}
.lp-item-remove-btn:hover { background: var(--status-error); color: #fff; }
.lp-add-item-btn {
  width: 100%; padding: 7px;
  border: 1px dashed var(--border-base); border-radius: var(--radius-sm);
  background: transparent; color: var(--text-muted);
  font-size: 12px; font-weight: 600; font-family: var(--font-sans);
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 5px; transition: all 0.2s;
}
.lp-add-item-btn:hover { border-color: var(--brand-primary); color: var(--brand-primary); background: rgba(79,70,229,0.04); }
.lp-items-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }

/* ── Settings Panel ── */
.lp-settings-section { margin-bottom: 20px; padding-bottom: 18px; border-bottom: 1px solid var(--border-light); }
.lp-settings-section:last-child { border-bottom: none; }
.lp-settings-section-title { font-size: 10px; font-weight: 800; text-transform: uppercase; color: var(--text-light); letter-spacing: 0.5px; margin-bottom: 12px; }
.lp-toggle-label { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-size: 13px; font-weight: 600; color: var(--text-main); }

/* ── Pixel Cards ── */
.lp-pixel-card { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid var(--border-light); border-radius: var(--radius-md); background: var(--bg-subtle); margin-bottom: 8px; }
.lp-pixel-icon { width: 38px; height: 38px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.lp-pixel-body { flex: 1; }
.lp-pixel-label { font-size: 12px; font-weight: 700; color: var(--text-main); margin-bottom: 6px; }

/* ── Payment Options ── */
.lp-payment-option { border: 1px solid var(--border-light); border-radius: var(--radius-md); padding: 14px; margin-bottom: 10px; transition: all 0.2s; }
.lp-payment-option.active { border-color: var(--brand-primary); background: rgba(79,70,229,0.03); }
.lp-payment-option-header { display: flex; align-items: center; justify-content: space-between; }
.lp-payment-name { font-size: 13px; font-weight: 700; color: var(--text-main); margin-bottom: 2px; }
.lp-payment-desc { font-size: 11px; color: var(--text-muted); }
.lp-stripe-key-row { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border-light); }

/* ── Preview Area ── */
.lp-preview-area { display: flex; flex-direction: column; background: #e8edf5; overflow: hidden; }
[data-theme="dark"] .lp-preview-area { background: #0d0d14; }
.lp-preview-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px; background: var(--bg-surface); border-bottom: 1px solid var(--border-light); flex-shrink: 0;
}
.lp-slug-display { font-size: 11px; color: var(--text-light); font-family: monospace; }
.lp-preview-label { font-size: 10px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.lp-preview-wrapper {
  flex: 1; min-height: 0;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 24px; overflow: auto;
  transition: all 0.3s ease;
}
.lp-preview-device-frame {
  background: #fff; border-radius: 20px;
  box-shadow: 0 0 0 8px #1e1e2e, 0 24px 48px rgba(0,0,0,0.35);
  overflow: hidden; flex-shrink: 0;
  transition: width 0.3s cubic-bezier(0.25,0.8,0.25,1), height 0.3s cubic-bezier(0.25,0.8,0.25,1), border-radius 0.3s;
}
.lp-preview-wrapper[data-device="mobile"] .lp-preview-device-frame { width: 390px; height: 844px; }
.lp-preview-wrapper[data-device="desktop"] .lp-preview-device-frame { width: 100%; max-width: 1200px; height: 700px; border-radius: 8px; box-shadow: var(--shadow-lg); }
#lp-preview-iframe { width: 100%; height: 100%; border: none; display: block; }

/* ── Responsive ── */
@media (max-width: 1200px) {
  .mkt-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .lp-builder-layout { grid-template-columns: 300px 1fr; }
}
@media (max-width: 900px) {
  .lp-builder-layout { grid-template-columns: 1fr; }
  .lp-preview-area { display: none; }
}
