/**
 * Admin Overlay Styles (INT-364)
 *
 * Floating editor panel for in-page landing page editing.
 * Uses a dark theme that contrasts with any landing page preset.
 * All selectors prefixed with admin-overlay- to avoid conflicts.
 */

/* ─── Panel Container ─────────────────────────────────────────────── */

#admin-overlay-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 320px;
  height: 100vh;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  background: #1a1a2e;
  color: #e0e0e0;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 13px;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

/* ─── Header ──────────────────────────────────────────────────────── */

.admin-overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #16213e;
  border-bottom: 1px solid #2a2a4a;
  flex-shrink: 0;
}

.admin-overlay-title {
  font-weight: 600;
  font-size: 14px;
  color: #fff;
}

.admin-overlay-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-overlay-link {
  color: #8b9cc7;
  font-size: 12px;
  text-decoration: none;
}

.admin-overlay-link:hover {
  color: #a5b4fc;
  text-decoration: underline;
}

.admin-overlay-close {
  background: none;
  border: none;
  color: #8b9cc7;
  font-size: 20px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.admin-overlay-close:hover {
  color: #fff;
}

/* ─── Badge (INT-381) ────────────────────────────────────────────── */

.admin-overlay-badge {
  display: inline-block;
  background: #eab308;
  color: #1a1a2e;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 6px;
  white-space: nowrap;
}

/* ─── Home Link (INT-381) ────────────────────────────────────────── */

.admin-overlay-home-link {
  font-size: 11px;
  color: #a5b4fc;
}

/* ─── Tab Bar (INT-390) ──────────────────────────────────────────── */

.ao-tab-bar {
  display: flex;
  background: #16213e;
  border-bottom: 1px solid #2a2a4a;
  flex-shrink: 0;
}

.ao-tab-btn {
  flex: 1;
  padding: 8px 4px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: #8b9cc7;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.15s, border-color 0.15s;
}

.ao-tab-btn:hover {
  color: #c5c5e0;
}

.ao-tab-btn[aria-selected="true"] {
  color: #fff;
  border-bottom-color: #6366f1;
}

/* ─── Tab Panels ─────────────────────────────────────────────────── */

.ao-tab-panels {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}

.ao-tab-panel {
  padding: 0;
}

.ao-tab-placeholder {
  color: #666;
  font-size: 12px;
  text-align: center;
  padding: 32px 16px;
  line-height: 1.6;
}

/* ─── Body (scrollable) ───────────────────────────────────────────── */

.admin-overlay-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

/* ─── Sections (collapsible) ──────────────────────────────────────── */

.admin-overlay-section {
  border-bottom: 1px solid #2a2a4a;
}

.admin-overlay-section summary {
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  color: #c5c5e0;
  user-select: none;
}

.admin-overlay-section summary:hover {
  color: #fff;
  background: #1e1e3a;
}

.admin-overlay-section[open] summary {
  color: #fff;
}

/* ─── Fields ──────────────────────────────────────────────────────── */

.admin-overlay-field {
  padding: 6px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-overlay-field label {
  flex: 0 0 90px;
  font-size: 12px;
  color: #8b9cc7;
}

.admin-overlay-field input[type="text"],
.admin-overlay-field select {
  flex: 1;
  background: #0f0f23;
  border: 1px solid #2a2a4a;
  color: #e0e0e0;
  padding: 6px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-family: inherit;
}

.admin-overlay-field input[type="text"]:focus,
.admin-overlay-field select:focus {
  outline: none;
  border-color: #6366f1;
}

/* Stacked variant for textareas (INT-390) */
.admin-overlay-field.ao-field-stacked {
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
}

.admin-overlay-field.ao-field-stacked label {
  flex: none;
}

.admin-overlay-field textarea {
  width: 100%;
  background: #0f0f23;
  border: 1px solid #2a2a4a;
  color: #e0e0e0;
  padding: 6px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-family: inherit;
  resize: vertical;
  box-sizing: border-box;
}

.admin-overlay-field textarea:focus {
  outline: none;
  border-color: #6366f1;
}

.admin-overlay-field input[type="color"] {
  flex: 0 0 32px;
  height: 28px;
  padding: 2px;
  border: 1px solid #2a2a4a;
  border-radius: 4px;
  background: #0f0f23;
  cursor: pointer;
}

/* ─── Footer ──────────────────────────────────────────────────────── */

.admin-overlay-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 16px;
  background: #16213e;
  border-top: 1px solid #2a2a4a;
  flex-shrink: 0;
}

.admin-overlay-footer-buttons {
  display: flex;
  gap: 8px;
}

/* ─── Publish Progress (INT-382) ─────────────────────────────────── */

.admin-overlay-progress {
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  padding: 4px 0;
  animation: ao-pulse 1.5s ease-in-out infinite;
}

@keyframes ao-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.admin-overlay-btn {
  flex: 1;
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}

.admin-overlay-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.admin-overlay-btn-primary {
  background: #6366f1;
  color: #fff;
}

.admin-overlay-btn-primary:hover:not(:disabled) {
  background: #4f46e5;
}

.admin-overlay-btn-secondary {
  background: #2a2a4a;
  color: #c5c5e0;
}

.admin-overlay-btn-secondary:hover:not(:disabled) {
  background: #3a3a5a;
}

/* ─── Status Toast ────────────────────────────────────────────────── */

.admin-overlay-status {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  font-family: system-ui, -apple-system, sans-serif;
  z-index: 100000;
  animation: admin-overlay-fade-in 0.2s ease-out;
}

.admin-overlay-status-success {
  background: #065f46;
  color: #a7f3d0;
}

.admin-overlay-status-error {
  background: #7f1d1d;
  color: #fca5a5;
}

.admin-overlay-status-info {
  background: #1e3a5f;
  color: #93c5fd;
}

@keyframes admin-overlay-fade-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* ─── Inline Editor (INT-370) ──────────────────────────────────────── */

/* Base state: pencil cursor on editable elements */
.ao-editable {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%233b82f6' stroke-width='2'%3E%3Cpath d='M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z'/%3E%3C/svg%3E") 0 16, text;
}

/* Hover: blue outline (uses outline to avoid layout shift) */
.ao-editable-hover {
  outline: 2px solid rgba(59, 130, 246, 0.5);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Active editing state */
.ao-editable-active {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
  border-radius: 2px;
  cursor: text;
}

/* Pending (unsaved) change indicator */
.ao-editable-pending {
  outline: 2px dashed #eab308;
  outline-offset: 2px;
  border-radius: 2px;
}

/* Flash: saved successfully (green) */
.ao-editable-saved {
  animation: ao-flash-green 0.6s ease-out;
}

/* Flash: unchanged (subtle) */
.ao-editable-unchanged {
  animation: ao-flash-neutral 0.4s ease-out;
}

@keyframes ao-flash-green {
  0% { background-color: rgba(34, 197, 94, 0.3); }
  100% { background-color: transparent; }
}

@keyframes ao-flash-neutral {
  0% { background-color: rgba(148, 163, 184, 0.2); }
  100% { background-color: transparent; }
}

/* ─── Section Toolbar (INT-371) ────────────────────────────────────── */

/* Section hover highlight */
.ao-section-hover {
  outline: 2px dashed rgba(99, 102, 241, 0.4);
  outline-offset: -2px;
}

/* Floating toolbar */
#ao-section-toolbar {
  position: absolute;
  right: 8px;
  z-index: 99998;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(26, 26, 46, 0.92);
  border-radius: 6px;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 12px;
  color: #e0e0e0;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

#ao-section-toolbar.ao-section-toolbar-visible {
  opacity: 1;
  pointer-events: auto;
}

.ao-section-label {
  font-weight: 600;
  color: #a5b4fc;
  margin-right: 6px;
}

.ao-section-actions {
  display: flex;
  gap: 2px;
}

.ao-section-btn {
  background: none;
  border: 1px solid transparent;
  color: #c5c5e0;
  font-size: 13px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
  transition: background 0.1s, color 0.1s;
}

.ao-section-btn:hover:not(:disabled) {
  background: rgba(99, 102, 241, 0.2);
  color: #fff;
}

.ao-section-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Hidden section (dimmed with dashed overlay) */
.ao-section-hidden {
  opacity: 0.35;
  position: relative;
}

.ao-section-hidden::after {
  content: "HIDDEN";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 4px;
  color: rgba(234, 179, 8, 0.5);
  font-family: system-ui, -apple-system, sans-serif;
  pointer-events: none;
}

/* Flash: section just moved */
.ao-section-moved {
  animation: ao-flash-indigo 0.6s ease-out;
}

@keyframes ao-flash-indigo {
  0% { background-color: rgba(99, 102, 241, 0.15); }
  100% { background-color: transparent; }
}

/* ─── Sections Manager (INT-385) ──────────────────────────────────── */

.ao-sections-manager {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ao-sections-hint {
  font-size: 11px;
  color: #888;
  margin: 0;
  line-height: 1.4;
}

.ao-sections-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ao-section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 4px;
}

.ao-section-row-label {
  font-size: 12px;
  font-weight: 500;
}

.ao-section-toggle {
  background: none;
  border: 1px solid transparent;
  color: #c5c5e0;
  font-size: 14px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
  transition: background 0.1s, color 0.1s;
}

.ao-section-toggle:hover {
  background: rgba(99, 102, 241, 0.2);
  color: #fff;
}

.ao-section-toggle-hidden {
  color: #ef4444;
  opacity: 0.7;
}

.ao-sections-empty {
  font-size: 11px;
  color: #666;
  text-align: center;
  padding: 8px;
}

.ao-sections-add {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.ao-sections-add label {
  font-size: 11px;
  color: #888;
  display: block;
  margin-bottom: 4px;
}

.ao-sections-add select {
  width: 100%;
}

/* ─── Link Editor (INT-379) ──────────────────────────────────────── */

/* Base state: link cursor on link-editable elements */
.ao-link-editable {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%233b82f6' stroke-width='2'%3E%3Cpath d='M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71'/%3E%3Cpath d='M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71'/%3E%3C/svg%3E") 0 16, pointer;
}

/* Hover: blue outline */
.ao-link-hover {
  outline: 2px solid rgba(59, 130, 246, 0.5);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Pending (unsaved) change indicator */
.ao-link-pending {
  outline: 2px dashed #eab308;
  outline-offset: 2px;
  border-radius: 2px;
}

/* Link editor popup */
#ao-link-editor {
  position: absolute;
  z-index: 100001;
  width: 320px;
  background: #1a1a2e;
  border: 1px solid #2a2a4a;
  border-radius: 8px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 13px;
  color: #e0e0e0;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#ao-link-editor .ao-link-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#ao-link-editor .ao-link-field label {
  font-size: 11px;
  font-weight: 600;
  color: #8b9cc7;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#ao-link-editor .ao-link-field input[type="text"],
#ao-link-editor .ao-link-field input[type="url"] {
  background: #0f0f23;
  border: 1px solid #2a2a4a;
  color: #e0e0e0;
  padding: 6px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
}

#ao-link-editor .ao-link-field input:focus {
  outline: none;
  border-color: #6366f1;
}

#ao-link-editor .ao-link-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #8b9cc7;
}

#ao-link-editor .ao-link-checkbox input[type="checkbox"] {
  accent-color: #6366f1;
}

#ao-link-editor .ao-link-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  margin-top: 4px;
}

#ao-link-editor .ao-link-btn {
  padding: 5px 12px;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}

#ao-link-editor .ao-link-btn-save {
  background: #6366f1;
  color: #fff;
}

#ao-link-editor .ao-link-btn-save:hover {
  background: #4f46e5;
}

#ao-link-editor .ao-link-btn-close {
  background: #2a2a4a;
  color: #c5c5e0;
}

#ao-link-editor .ao-link-btn-close:hover {
  background: #3a3a5a;
}

/* URL validation error */
#ao-link-editor .ao-link-error {
  color: #fca5a5;
  font-size: 11px;
  display: none;
}

/* ─── Unsaved Changes Protection (INT-383) ────────────────────────── */

/* Changes count badge in header */
.admin-overlay-changes-badge {
  display: none;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: #eab308;
  color: #1a1a2e;
  font-size: 11px;
  font-weight: 600;
  border-radius: 10px;
  white-space: nowrap;
}

.admin-overlay-changes-badge.ao-badge-visible {
  display: flex;
}

/* Discard confirmation dialog */
#ao-discard-dialog {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100002;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  font-family: system-ui, -apple-system, sans-serif;
}

#ao-discard-dialog .ao-dialog-box {
  background: #1a1a2e;
  border: 1px solid #2a2a4a;
  border-radius: 10px;
  padding: 20px 24px;
  max-width: 360px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  color: #e0e0e0;
}

#ao-discard-dialog .ao-dialog-title {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 8px;
}

#ao-discard-dialog .ao-dialog-message {
  font-size: 13px;
  color: #8b9cc7;
  margin-bottom: 16px;
  line-height: 1.5;
}

#ao-discard-dialog .ao-dialog-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

#ao-discard-dialog .ao-dialog-btn {
  padding: 7px 16px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}

#ao-discard-dialog .ao-dialog-btn-cancel {
  background: #2a2a4a;
  color: #c5c5e0;
}

#ao-discard-dialog .ao-dialog-btn-cancel:hover {
  background: #3a3a5a;
}

#ao-discard-dialog .ao-dialog-btn-discard {
  background: #dc2626;
  color: #fff;
}

#ao-discard-dialog .ao-dialog-btn-discard:hover {
  background: #b91c1c;
}

/* ─── Tab Bar (INT-372) ──────────────────────────────────────────── */

.ao-tab-bar {
  display: flex;
  border-bottom: 1px solid #2a2a4a;
  background: #16213e;
  flex-shrink: 0;
}

.ao-tab-btn {
  flex: 1;
  padding: 8px 4px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: #8b9cc7;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.15s, border-color 0.15s;
}

.ao-tab-btn:hover {
  color: #c5c5e0;
}

.ao-tab-btn[aria-selected="true"] {
  color: #fff;
  border-bottom-color: #6366f1;
}

.ao-tab-panels {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.ao-tab-placeholder {
  text-align: center;
  color: #666;
  padding: 24px 16px;
  font-size: 12px;
  line-height: 1.5;
}

/* ─── Navigation Tab (INT-374) ───────────────────────────────────── */

.ao-nav-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ao-nav-item-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.ao-nav-item-row input[type="text"],
.ao-nav-item-row input[type="url"] {
  flex: 1;
  background: #0f0f23;
  border: 1px solid #2a2a4a;
  color: #e0e0e0;
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-family: inherit;
  min-width: 0;
}

.ao-nav-item-row input:focus {
  outline: none;
  border-color: #6366f1;
}

.ao-nav-actions {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

.ao-nav-btn {
  background: none;
  border: 1px solid transparent;
  color: #8b9cc7;
  font-size: 13px;
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 4px;
  line-height: 1;
  transition: background 0.1s, color 0.1s;
}

.ao-nav-btn:hover {
  background: rgba(99, 102, 241, 0.2);
  color: #fff;
}

.ao-nav-btn-remove:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

.ao-nav-add-btn {
  display: block;
  width: calc(100% - 32px);
  margin: 6px 16px;
  padding: 6px;
  background: none;
  border: 1px dashed #2a2a4a;
  border-radius: 4px;
  color: #8b9cc7;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, color 0.15s;
}

.ao-nav-add-btn:hover {
  border-color: #6366f1;
  color: #a5b4fc;
}

.ao-nav-empty {
  text-align: center;
  color: #666;
  font-size: 12px;
  font-style: italic;
  padding: 12px 16px;
}

/* Social link platform selector */
.ao-nav-item-row select {
  width: 90px;
  flex-shrink: 0;
  background: #0f0f23;
  border: 1px solid #2a2a4a;
  color: #e0e0e0;
  padding: 5px 4px;
  border-radius: 4px;
  font-size: 11px;
  font-family: inherit;
}

.ao-nav-item-row select:focus {
  outline: none;
  border-color: #6366f1;
}

/* Footer nav group nesting */
.ao-nav-group {
  margin: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  margin-bottom: 4px;
}

.ao-nav-group summary {
  padding: 6px 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: #c5c5e0;
  user-select: none;
}

.ao-nav-group summary:hover {
  color: #fff;
}

.ao-nav-group .ao-nav-item {
  padding: 6px 10px;
}

.ao-nav-group .ao-nav-add-btn {
  width: calc(100% - 20px);
  margin: 4px 10px;
}

/* Navigation textarea (footer tagline) */
.ao-nav-textarea {
  width: 100%;
  background: #0f0f23;
  border: 1px solid #2a2a4a;
  color: #e0e0e0;
  padding: 6px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-family: inherit;
  resize: vertical;
  min-height: 48px;
  box-sizing: border-box;
}

.ao-nav-textarea:focus {
  outline: none;
  border-color: #6366f1;
}

/* Pending badge in footer */
#ao-pending-badge {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: #eab308;
}

.ao-badge-hidden {
  display: none;
}

/* ─── SEO Preview (INT-384) ───────────────────────────────────────── */

.ao-seo-preview {
  padding: 8px 16px 12px;
}

.ao-seo-preview-label {
  font-size: 11px;
  font-weight: 600;
  color: #8b9cc7;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.ao-seo-google-preview {
  background: #fff;
  border-radius: 6px;
  padding: 10px 12px;
}

.ao-seo-google-title {
  font-size: 14px;
  font-weight: 400;
  color: #1a0dab;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ao-seo-google-url {
  font-size: 11px;
  color: #006621;
  margin-top: 2px;
}

.ao-seo-google-desc {
  font-size: 11px;
  color: #545454;
  margin-top: 2px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ─── List Editor (Nav tab) ──────────────────────────────────────── */

.ao-list-editor {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ao-list-item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #1e1e3a;
  border: 1px solid #2a2a4a;
  border-radius: 6px;
  padding: 6px 8px;
}

.ao-list-item-fields {
  display: flex;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.ao-list-item-fields input,
.ao-list-item-fields select {
  flex: 1;
  min-width: 0;
  padding: 4px 8px;
  border: 1px solid #2a2a4a;
  border-radius: 4px;
  background: #14142a;
  color: #e0e0ff;
  font-size: 12px;
  font-family: inherit;
}

.ao-list-item-fields input:focus,
.ao-list-item-fields select:focus {
  border-color: #6366f1;
  outline: none;
}

.ao-list-remove {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: #dc2626;
  font-size: 16px;
  cursor: pointer;
  border-radius: 4px;
  padding: 0;
  line-height: 1;
}

.ao-list-remove:hover {
  background: rgba(220, 38, 38, 0.15);
}

.ao-list-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border: 1px dashed #3a3a5a;
  border-radius: 6px;
  background: transparent;
  color: #a5a5c0;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  margin-top: 4px;
}

.ao-list-add-btn:hover {
  border-color: #6366f1;
  color: #c5c5e0;
}

/* Footer nav groups (nested lists) */

.ao-list-group {
  border: 1px solid #2a2a4a;
  border-radius: 6px;
  background: #1a1a36;
  padding: 8px;
  margin-bottom: 6px;
}

.ao-list-group-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.ao-list-group-header input {
  flex: 1;
  padding: 4px 8px;
  border: 1px solid #2a2a4a;
  border-radius: 4px;
  background: #14142a;
  color: #e0e0ff;
  font-size: 12px;
  font-family: inherit;
  font-weight: 500;
}

.ao-list-group-header input:focus {
  border-color: #6366f1;
  outline: none;
}

.ao-list-group-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-left: 12px;
}

.ao-list-group-links .ao-list-subitem {
  padding: 4px 6px;
}

.ao-list-add-subitem {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border: none;
  background: transparent;
  color: #6366f1;
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
  margin-top: 4px;
  margin-left: 12px;
}

.ao-list-add-subitem:hover {
  color: #818cf8;
}

/* ─── Array Editor (Structure tab JSONB) ─────────────────────────── */

.ao-arr-editor {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ao-arr-item {
  border: 1px solid #2a2a4a;
  border-radius: 6px;
  background: #1a1a36;
  overflow: hidden;
}

.ao-arr-item[open] {
  background: #1e1e3a;
}

.ao-arr-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  cursor: pointer;
  user-select: none;
  font-size: 12px;
  color: #c5c5e0;
  list-style: none;
}

.ao-arr-item-header::-webkit-details-marker {
  display: none;
}

.ao-arr-item-header::before {
  content: "\25B6";
  font-size: 9px;
  margin-right: 8px;
  transition: transform 0.15s;
  color: #6366f1;
}

.ao-arr-item[open] > .ao-arr-item-header::before {
  transform: rotate(90deg);
}

.ao-arr-item-preview {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ao-arr-item-remove {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: #dc2626;
  font-size: 15px;
  cursor: pointer;
  border-radius: 4px;
  padding: 0;
  line-height: 1;
}

.ao-arr-item-remove:hover {
  background: rgba(220, 38, 38, 0.15);
}

.ao-arr-item-body {
  padding: 6px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid #2a2a4a;
}

.ao-arr-field label {
  display: block;
  font-size: 11px;
  color: #a5a5c0;
  margin-bottom: 3px;
}

.ao-arr-field input,
.ao-arr-field textarea,
.ao-arr-field select {
  width: 100%;
  padding: 5px 8px;
  border: 1px solid #2a2a4a;
  border-radius: 4px;
  background: #14142a;
  color: #e0e0ff;
  font-size: 12px;
  font-family: inherit;
  box-sizing: border-box;
}

.ao-arr-field input:focus,
.ao-arr-field textarea:focus,
.ao-arr-field select:focus {
  border-color: #6366f1;
  outline: none;
}

.ao-arr-field textarea {
  resize: vertical;
  min-height: 36px;
}

.ao-arr-field-inline label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  cursor: pointer;
}

.ao-arr-field-inline input[type="checkbox"] {
  width: auto;
}

.ao-arr-count {
  font-weight: 400;
  color: #6366f1;
  font-size: 12px;
}

/* ─── Drag and Drop (PLA-704) ─────────────────────────────────── */

.ao-dragging {
  opacity: 0.4;
}

.ao-drag-placeholder {
  border: 2px dashed #6366f1;
  border-radius: 6px;
  background: rgba(99, 102, 241, 0.08);
  margin: 2px 0;
}

.ao-drag-handle {
  cursor: grab;
  color: #666;
  font-size: 14px;
  padding: 2px 4px;
  user-select: none;
  flex-shrink: 0;
}

.ao-drag-handle:active {
  cursor: grabbing;
}

/* ─── Link Picker (PLA-704) ────────────────────────────────────── */

#ao-link-picker {
  z-index: 100003;
  background: #1a1a2e;
  border: 1px solid #2a2a4a;
  border-radius: 8px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 13px;
  color: #e0e0e0;
  max-height: 400px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#ao-lp-search {
  margin: 8px;
  padding: 6px 8px;
  background: #0f0f23;
  border: 1px solid #2a2a4a;
  border-radius: 4px;
  color: #e0e0e0;
  font-size: 12px;
  font-family: inherit;
}

#ao-lp-search:focus {
  outline: none;
  border-color: #6366f1;
}

#ao-lp-options {
  overflow-y: auto;
  max-height: 340px;
  padding: 0 4px 8px;
}

.ao-lp-category-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #8b9cc7;
  padding: 8px 8px 4px;
}

.ao-lp-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 5px 8px;
  background: none;
  border: none;
  border-radius: 4px;
  color: #e0e0e0;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
}

.ao-lp-option:hover {
  background: rgba(99, 102, 241, 0.15);
}

.ao-lp-selected {
  background: #6366f1;
  color: #fff;
}

.ao-lp-url {
  font-family: monospace;
  font-size: 10px;
  color: #666;
}

.ao-lp-custom {
  border-top: 1px solid #2a2a4a;
  margin-top: 4px;
  padding-top: 4px;
}

#ao-lp-custom-input {
  display: flex;
  gap: 4px;
  padding: 4px 8px;
}

#ao-lp-custom-input input {
  flex: 1;
  padding: 4px 8px;
  background: #0f0f23;
  border: 1px solid #2a2a4a;
  border-radius: 4px;
  color: #e0e0e0;
  font-size: 12px;
  font-family: inherit;
}

.ao-lp-apply {
  padding: 4px 10px;
  background: #6366f1;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
}

/* ─── Color Palette Picker (PLA-704) ──────────────────────────── */

#ao-color-picker {
  z-index: 100003;
  background: #1a1a2e;
  border: 1px solid #2a2a4a;
  border-radius: 8px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  padding: 12px;
  font-family: system-ui, -apple-system, sans-serif;
}

.ao-cp-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}

.ao-cp-swatch {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s;
}

.ao-cp-swatch:hover {
  transform: scale(1.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.ao-cp-selected {
  border-color: #fff;
}

.ao-cp-check {
  color: #fff;
  font-size: 14px;
  font-weight: bold;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.ao-cp-label {
  text-align: center;
  font-size: 11px;
  color: #8b9cc7;
  margin-top: 8px;
}

/* ─── Star Rating (PLA-704) ────────────────────────────────────── */

.ao-star-rating {
  display: inline-flex;
  gap: 2px;
}

.ao-star {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 0 1px;
  color: #4a4a6a;
  transition: color 0.1s;
  line-height: 1;
}

.ao-star-filled {
  color: #eab308;
}

.ao-star-preview {
  color: #facc15;
}

.ao-star:hover {
  transform: scale(1.2);
}

/* ─── Brand Tab (PLA-704) ─────────────────────────────────────── */

.ao-icon-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid #2a2a4a;
  border-radius: 6px;
  cursor: pointer;
  min-height: 32px;
}

.ao-icon-trigger:hover {
  border-color: #6366f1;
}

.ao-brand-color-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  background: none;
  border: 1px solid #2a2a4a;
  border-radius: 6px;
  cursor: pointer;
  color: #e0e0e0;
  font-size: 12px;
  font-family: inherit;
}

.ao-brand-color-btn:hover {
  border-color: #6366f1;
}

.ao-brand-color-swatch {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.ao-brand-color-label {
  text-transform: capitalize;
}

.ao-field-stacked {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ─── Content Tab Section Selector (PLA-712) ──────────────────── */

.ao-content-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px 12px;
  border-bottom: 1px solid #2a2a4a;
}

.ao-content-section-btn {
  padding: 4px 10px;
  font-size: 11px;
  font-family: inherit;
  background: transparent;
  border: 1px solid #2a2a4a;
  border-radius: 4px;
  color: #aaa;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ao-content-section-btn:hover {
  border-color: #6366f1;
  color: #e0e0e0;
}

.ao-content-section-btn.ao-active {
  background: #6366f1;
  border-color: #6366f1;
  color: #fff;
}

.ao-content-panels {
  padding: 0;
}

.ao-content-panel {
  padding: 10px 12px;
}

.ao-arr-section-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 12px 0 6px;
}

.ao-manage-sections {
  margin-top: 8px;
  border-top: 1px solid #2a2a4a;
}

/* ─── Array Item Icon & Rating Widgets (PLA-712) ──────────────── */

.ao-arr-icon-target {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid #2a2a4a;
  border-radius: 6px;
  cursor: pointer;
  min-height: 28px;
  font-size: 12px;
}

.ao-arr-icon-target:hover {
  border-color: #6366f1;
}

.ao-arr-rating-target {
  min-height: 28px;
}

/* ─── Link Picker Inline Button (PLA-712) ─────────────────────── */

.ao-field-with-picker {
  display: flex;
  gap: 4px;
  align-items: center;
}

.ao-field-with-picker input {
  flex: 1;
}

.ao-link-picker-btn {
  padding: 4px 8px;
  font-size: 14px;
  background: transparent;
  border: 1px solid #2a2a4a;
  border-radius: 4px;
  cursor: pointer;
  color: #aaa;
  line-height: 1;
}

.ao-link-picker-btn:hover {
  border-color: #6366f1;
  color: #e0e0e0;
}

/* ─── Nav Drag Handle (PLA-717) ──────────────────────────────── */

.ao-drag-handle {
  cursor: grab;
  color: #666;
  font-size: 12px;
  padding: 2px 4px;
  flex-shrink: 0;
  user-select: none;
}

.ao-drag-handle:hover {
  color: #aaa;
}

/* ─── Products List (PLA-716) ────────────────────────────────── */

.ao-products-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.ao-product-item {
  background: #16213e;
  border: 1px solid #2a2a4a;
  border-radius: 6px;
  padding: 8px 10px;
}

.ao-product-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  cursor: grab;
}

.ao-product-item-label {
  font-weight: 600;
  font-size: 12px;
  color: #e0e0e0;
}

.ao-product-item-toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 14px;
  padding: 2px 4px;
  line-height: 1;
}

.ao-product-url {
  width: 100%;
  padding: 4px 8px;
  background: #0f172a;
  color: #e0e0e0;
  border: 1px solid #2a2a4a;
  border-radius: 4px;
  font-size: 12px;
}

/* ─── Panel Upload Button (PLA-715) ──────────────────────────── */

.ao-upload-btn {
  padding: 4px 8px;
  font-size: 14px;
  background: transparent;
  border: 1px solid #2a2a4a;
  border-radius: 4px;
  cursor: pointer;
  color: #aaa;
  line-height: 1;
  flex-shrink: 0;
}

.ao-upload-btn:hover {
  border-color: #6366f1;
  color: #e0e0e0;
}

.ao-upload-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ─── Section Select (PLA-715) ───────────────────────────────── */

.ao-section-select {
  width: 100%;
  padding: 4px 8px;
  background: #16213e;
  color: #e0e0e0;
  border: 1px solid #2a2a4a;
  border-radius: 4px;
  font-size: 13px;
}

/* ─── Theme Studio (PLA-713) ─────────────────────────────────── */

/* Preset Grid */
.ao-preset-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 4px 0;
}

.ao-preset-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  background: transparent;
  border: 2px solid #2a2a4a;
  border-radius: 8px;
  cursor: pointer;
  color: #aaa;
  font-size: 11px;
  transition: border-color 0.15s, background 0.15s;
}

.ao-preset-card:hover {
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.08);
}

.ao-preset-card.ao-preset-active {
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.15);
  color: #e0e0e0;
}

.ao-preset-swatch {
  width: 100%;
  height: 24px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 6px;
}

.ao-preset-swatch-primary,
.ao-preset-swatch-secondary {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.ao-preset-label {
  text-align: center;
  line-height: 1.2;
}

/* Color Inputs */
.ao-color-field {
  margin-bottom: 4px;
}

.ao-color-input-group {
  display: flex;
  gap: 6px;
  align-items: center;
}

.ao-color-picker {
  width: 32px;
  height: 28px;
  padding: 0;
  border: 1px solid #2a2a4a;
  border-radius: 4px;
  cursor: pointer;
  background: none;
  flex-shrink: 0;
}

.ao-color-picker::-webkit-color-swatch-wrapper {
  padding: 2px;
}

.ao-color-picker::-webkit-color-swatch {
  border: none;
  border-radius: 2px;
}

.ao-color-hex {
  flex: 1;
  font-family: monospace;
  font-size: 12px;
}

/* Effect Toggles */
.ao-effect-toggle {
  margin-bottom: 2px;
}

.ao-toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
}

.ao-toggle-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #6366f1;
  cursor: pointer;
}

.ao-theme-select {
  width: 100%;
  padding: 4px 8px;
  background: #16213e;
  color: #e0e0e0;
  border: 1px solid #2a2a4a;
  border-radius: 4px;
  font-size: 13px;
}

