/* ============================================================
   Website Content — live visual editor
   Three-part workspace: admin sidebar (shared) + editor panel + live preview.
   Theme-aware (dark/light) via shared tokens; copper accent throughout.
   ============================================================ */

/* Full-bleed takeover of the content area (below the preserved global header) */
.content.content-editor {
  padding: 0;
  height: calc(100vh - var(--header-h));
  overflow: hidden;
}

.wc {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: var(--bg);
}

/* ---------------- Toolbar ---------------- */
.wc-toolbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-header);
}

.wc-toolbar-lead { display: flex; flex-direction: column; min-width: 0; }
.wc-toolbar-lead h1 {
  font-size: 16px; font-weight: 800; display: flex; align-items: center; gap: 8px;
}
.wc-toolbar-lead h1 svg { color: var(--accent); }
.wc-toolbar-lead p { margin: 2px 0 0 26px; font-size: 12px; color: var(--text-muted); }

.wc-devices {
  display: flex; gap: 2px; margin: 0 auto;
  background: var(--bg-card-alt); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 3px;
}
.wc-device {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px; border: none; background: none; border-radius: 6px;
  font-family: var(--font-heading); font-weight: 700; font-size: 12.5px;
  color: var(--text-secondary); transition: background-color .15s ease, color .15s ease;
}
.wc-device:hover { color: var(--text-primary); }
.wc-device.is-active { background: var(--bg-card); color: var(--text-primary); box-shadow: var(--shadow-card); }
.wc-device svg { opacity: .85; }

.wc-toolbar-actions { display: flex; align-items: center; gap: var(--space-3); }

/* ---------------- Body ---------------- */
.wc-body { flex: 1 1 auto; display: flex; min-height: 0; }

/* Editor panel */
.wc-panel {
  flex: 0 0 320px;
  display: flex; flex-direction: column; min-height: 0;
  border-right: 1px solid var(--border);
  background: var(--bg-sidebar);
}

.wc-panel-head { flex: 0 0 auto; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.wc-page-select {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--bg-card); color: var(--text-primary);
  font-family: var(--font-heading); font-weight: 700; font-size: 13.5px;
}
.wc-page-select > span { display: inline-flex; align-items: center; gap: 8px; }
.wc-page-select svg:first-child { color: var(--accent); }
.wc-page-select:hover { border-color: var(--border-strong); }

.wc-nav-wrap { flex: 0 0 auto; padding: 12px 12px 8px; border-bottom: 1px solid var(--border); max-height: 42%; overflow-y: auto; }
.wc-nav-label {
  font-family: var(--font-heading); font-size: 10px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; color: var(--accent-soft-text);
  padding: 2px 8px 8px;
}
.wc-nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.wc-nav-item {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border: none; background: none; border-radius: var(--radius-md);
  color: var(--text-secondary); text-align: left;
  border-left: 2px solid transparent;
  transition: background-color .12s ease, color .12s ease;
}
.wc-nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.wc-nav-item.is-active {
  background: var(--accent-soft-bg); color: var(--accent-soft-text);
  border-left-color: var(--accent);
}
.wc-nav-grip { color: var(--text-muted); opacity: 0; cursor: grab; display: inline-flex; transition: opacity .12s ease; }
.wc-nav-item:hover .wc-nav-grip { opacity: .6; }
.wc-nav-ico { display: inline-flex; color: currentColor; flex: none; }
.wc-nav-item.is-active .wc-nav-ico { color: var(--accent); }
.wc-nav-name { flex: 1; min-width: 0; font-family: var(--font-heading); font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wc-nav-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.wc-nav-dot.is-on { background: var(--tone-green); }
.wc-nav-dot.is-off { background: var(--text-muted); opacity: .5; }

/* Fields scroll region */
.wc-panel-scroll { flex: 1 1 auto; overflow-y: auto; padding: 14px 16px 40px; }

.wc-fields { display: none; }
.wc-fields.is-active { display: block; animation: wcFade .25s ease; }
@keyframes wcFade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.wc-group { margin-bottom: 20px; }
.wc-group-title {
  font-family: var(--font-heading); font-size: 10px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; color: var(--accent-soft-text);
  margin-bottom: 12px;
}
.wc-group-hint { margin: -6px 0 12px; font-size: 11.5px; line-height: 1.5; color: var(--text-muted); }

.wc-field { margin-bottom: 14px; }
.wc-field > label {
  display: block; font-size: 11.5px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px;
}
.wc-input-wrap { position: relative; }
.wc-input {
  width: 100%; padding: 9px 11px; border-radius: var(--radius-md);
  border: 1px solid var(--border); background: var(--bg-input);
  color: var(--text-primary); font-size: 13px; font-family: var(--font-body);
}
.wc-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft-bg); }
.wc-textarea { resize: vertical; line-height: 1.5; min-height: 60px; }
.wc-select { appearance: none; }
.wc-count {
  position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
  font-family: var(--font-mono); font-size: 10.5px; color: var(--text-muted); pointer-events: none;
}
.wc-count-ta { top: auto; bottom: 8px; transform: none; }
.wc-input[data-count] { padding-right: 48px; }

/* Inline row (visibility, toggle) */
.wc-field-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.wc-field-row > label { margin: 0; flex: 1; }
.wc-eye-state { color: var(--text-muted); display: inline-flex; }

/* Switch */
.wc-switch {
  position: relative; width: 40px; height: 22px; border-radius: 999px; flex: none;
  border: none; background: var(--border-strong); transition: background-color .18s ease;
}
.wc-switch.is-on { background: var(--accent); }
.wc-switch-knob {
  position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; transition: transform .18s ease; box-shadow: 0 1px 2px rgba(0,0,0,.3);
}
.wc-switch.is-on .wc-switch-knob { transform: translateX(18px); }

/* Image field */
.wc-image { display: flex; gap: 12px; align-items: center; }
.wc-image-thumb {
  width: 76px; height: 54px; border-radius: var(--radius-md); flex: none;
  background: var(--bg-card-alt) center/cover no-repeat; border: 1px solid var(--border);
}
.wc-image-meta { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.wc-image-btn {
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
  padding: 7px 11px; border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--bg-card); color: var(--text-primary); font-size: 12px; font-weight: 600;
}
.wc-image-btn:hover { border-color: var(--accent); color: var(--accent-soft-text); }
.wc-image-name { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Card / product / review rows */
.wc-cards, .wc-products, .wc-reviews, .wc-links { display: flex; flex-direction: column; gap: 8px; }
.wc-card-row, .wc-product-row, .wc-review-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--bg-card);
}
.wc-card-row:hover, .wc-product-row:hover, .wc-review-row:hover { border-color: var(--border-strong); }
.wc-card-grip { color: var(--text-muted); opacity: .5; cursor: grab; display: inline-flex; flex: none; }
.wc-card-thumb {
  width: 38px; height: 38px; border-radius: 6px; flex: none;
  background: var(--bg-card-alt) center/cover no-repeat; border: 1px solid var(--border);
}
.wc-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wc-card-title { font-family: var(--font-heading); font-weight: 700; font-size: 12.5px; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wc-card-price { font-style: normal; color: var(--accent-soft-text); margin-left: 4px; }
.wc-card-desc { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wc-card-eye { border: none; background: none; color: var(--text-muted); padding: 4px; border-radius: 6px; flex: none; }
.wc-card-eye:hover { background: var(--bg-hover); color: var(--text-primary); }
.wc-product-num {
  width: 20px; height: 20px; flex: none; border-radius: 5px; display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 11px; font-weight: 600; color: var(--accent-soft-text); background: var(--accent-soft-bg);
}
.wc-linkbtn { border: none; background: none; color: var(--accent-soft-text); font-size: 12px; font-weight: 700; padding: 4px 6px; flex: none; }
.wc-linkbtn:hover { text-decoration: underline; }
.wc-review-meta { font-style: normal; font-weight: 500; color: var(--text-muted); font-size: 11px; }
.wc-review-quote { white-space: normal; line-height: 1.45; }
.wc-review-row { align-items: flex-start; }

/* Links */
.wc-link-row { display: flex; align-items: center; gap: 6px; }
.wc-link-label { flex: 0 0 92px; }
.wc-link-url { flex: 1; min-width: 0; }
.wc-add-link {
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; margin-top: 2px;
  border: 1px dashed var(--border-strong); background: none; color: var(--text-secondary);
  padding: 7px 11px; border-radius: var(--radius-md); font-size: 12px; font-weight: 600;
}
.wc-add-link:hover { border-color: var(--accent); color: var(--accent-soft-text); }

/* ---------------- Live preview ---------------- */
.wc-preview {
  flex: 1 1 auto; min-width: 0; position: relative;
  background:
    radial-gradient(circle at 1px 1px, rgba(128,128,128,.14) 1px, transparent 0) 0 0 / 22px 22px,
    var(--bg);
  overflow: auto;
  display: flex; align-items: stretch; justify-content: center;
}
.wc-stage {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  width: 100%; padding: 0;
}
.wc-frame {
  width: 100%; height: 100%; background: #090A0B; overflow: hidden;
  transition: width .32s cubic-bezier(.22,.61,.36,1), max-width .32s cubic-bezier(.22,.61,.36,1);
}
.wc-frame iframe { width: 100%; height: 100%; border: 0; display: block; background: #090A0B; }

/* Framed (tablet/mobile) modes */
.wc-preview[data-device="tablet"] .wc-stage,
.wc-preview[data-device="mobile"] .wc-stage { padding: 26px 0 40px; }
.wc-preview[data-device="tablet"] .wc-frame {
  width: 768px; max-width: calc(100% - 40px); height: calc(100% - 66px); min-height: 620px;
  border-radius: 16px; border: 10px solid #16181d; box-shadow: 0 30px 70px rgba(0,0,0,.45);
}
.wc-preview[data-device="mobile"] .wc-frame {
  width: 390px; max-width: calc(100% - 40px); height: calc(100% - 66px); min-height: 680px;
  border-radius: 26px; border: 11px solid #16181d; box-shadow: 0 30px 70px rgba(0,0,0,.45);
}
.wc-device-caption {
  margin-top: 12px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em;
  color: var(--text-muted);
}

/* ---------------- Status bar ---------------- */
.wc-statusbar {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  padding: 10px 20px; border-top: 1px solid var(--border); background: var(--bg-header);
}
.wc-status-left, .wc-status-right { display: flex; align-items: center; gap: var(--space-3); }
.wc-status-editing { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-secondary); }
.wc-status-editing strong { color: var(--text-primary); font-weight: 700; }
.wc-status-editing svg { color: var(--text-muted); }
.wc-live {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700;
  color: var(--tone-green); text-transform: uppercase; letter-spacing: .06em;
  padding: 3px 9px; border-radius: 999px; background: var(--tone-green-bg);
}
.wc-live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--tone-green); animation: wcPulse 1.8s ease-in-out infinite; }
@keyframes wcPulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.wc-live.is-dirty { color: var(--tone-amber); background: var(--tone-amber-bg); }
.wc-live.is-dirty .wc-live-dot { background: var(--tone-amber); }
.wc-saved { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
.wc-saved svg { color: var(--tone-green); }

.btn:disabled { opacity: .45; pointer-events: none; }

/* ---------------- Responsive ---------------- */
@media (max-width: 1180px) {
  .wc-panel { flex-basis: 280px; }
}
@media (max-width: 980px) {
  .content.content-editor { height: auto; overflow: visible; }
  .wc { height: auto; }
  .wc-toolbar { flex-wrap: wrap; }
  .wc-devices { order: 3; width: 100%; justify-content: center; margin: 4px 0 0; }
  .wc-body { flex-direction: column; }
  .wc-panel { flex-basis: auto; border-right: none; border-bottom: 1px solid var(--border); }
  .wc-nav-wrap { max-height: none; }
  .wc-preview { min-height: 70vh; }
  .wc-statusbar { flex-wrap: wrap; gap: var(--space-2); }
}
