/*
 * Landing Page Editor — Chrome & Overlay Styles
 *
 * Extracted from design/edit.html. Contains only the editor shell styles
 * (edit toggle buttons, move controls, publish button, confirm bar).
 * Public landing page section appearance belongs in the public layout CSS.
 */

/* ─── Preview Scope Reset ─── */
/* Ensures site.css body-level styles apply to the editor preview area,
   overriding any admin dashboard defaults that bleed through. The root
   font-size reset (html { font-size: 16px }) lives in the editor layout
   inline style so rem units in site.css compute correctly. */
.landing-page-preview {
    font-size: 16px;
    line-height: 1.6;
    font-weight: 400;
    color: var(--dark-color);
}

/* ─── Admin Style Bleed Fixes ─── */
/* app/style.css sets h1-h3 { color: var(--primary-color) } for the admin
   dashboard. This overrides inherited colors in landing page sections
   (e.g., hero h1 should inherit white from .hero { color: white }).
   Resetting to inherit lets site.css section colors win. */
.landing-page-preview h1,
.landing-page-preview h2,
.landing-page-preview h3,
.landing-page-preview h4,
.landing-page-preview h5,
.landing-page-preview h6 {
    color: inherit;
    font-family: var(--heading-font);
    font-weight: 600;
    letter-spacing: normal;
}

/* site.css section-title sets its own color; this lets it through */
.landing-page-preview .section-title {
    color: var(--primary-color);
}

/* site.css card styles; admin Bootstrap overrides them */
.landing-page-preview .card-title {
    color: var(--primary-color);
    font-weight: 700;
    letter-spacing: 0.3px;
}

/* site.css btn-primary uses theme colors; admin Bootstrap overrides them */
.landing-page-preview .btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    padding: 10px 25px;
    font-weight: 600;
    font-family: var(--heading-font);
}

.landing-page-preview .btn-primary:hover {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.landing-page-preview .btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
    padding: 10px 25px;
    font-weight: 600;
    font-family: var(--heading-font);
}

.landing-page-preview .btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Footer: admin Bootstrap overrides site.css footer styles */
.landing-page-preview footer {
    background-color: var(--dark-color);
    color: white;
    padding: 50px 0;
}

/* ─── Shared Styles (no Bootstrap CDN) ───────────────────────────────────
   The Inertia editor layout no longer loads the Bootstrap CDN.
   Tailwind's Preflight reset strips heading sizes and list styles.
   These definitions restore Bootstrap-equivalent heading sizes, form
   controls, buttons, and .lead for section view-modes and modals.
   ─────────────────────────────────────────────────────────────────────── */

/* Heading sizes (Bootstrap defaults: h1=2.5rem, h2=2rem, h3=1.75rem, etc.) */
.landing-page-preview h1 { font-size: 2.5rem; }
.landing-page-preview h2 { font-size: 2rem; }
.landing-page-preview h3 { font-size: 1.75rem; }
.landing-page-preview h4 { font-size: 1.5rem; }
.landing-page-preview h5 { font-size: 1.25rem; }
.landing-page-preview h6 { font-size: 1rem; }

/* Lead paragraph */
.landing-page-preview .lead { font-size: 1.25rem; font-weight: 300; }

/* Button base (used by site.css .btn-primary / .btn-outline-primary) */
.landing-page-preview .btn { display: inline-block; font-weight: 400; text-align: center; vertical-align: middle; cursor: pointer; user-select: none; border: 1px solid transparent; padding: 0.375rem 0.75rem; font-size: 1rem; line-height: 1.5; border-radius: 0.375rem; text-decoration: none; transition: color .15s, background-color .15s, border-color .15s; }
.landing-page-preview .btn-lg { padding: 0.5rem 1rem; font-size: 1.25rem; }
.landing-page-preview .btn-primary { color: #fff; }
.landing-page-preview .btn-primary:hover { color: #fff; }

/* Form controls (contact section view-mode + CardDialog modals via Radix Portal) */
.landing-page-preview .form-control,
.offering-edit-modal .form-control { display: block; width: 100%; padding: 0.375rem 0.75rem; font-size: 1rem; font-weight: 400; line-height: 1.5; color: #212529; background-color: #fff; border: 1px solid #ced4da; border-radius: 0.375rem; appearance: none; transition: border-color .15s, box-shadow .15s; }
.landing-page-preview .form-control:focus,
.offering-edit-modal .form-control:focus { border-color: #86b7fe; outline: 0; box-shadow: 0 0 0 0.25rem rgba(13,110,253,.25); }
.landing-page-preview .form-select,
.offering-edit-modal .form-select { display: block; width: 100%; padding: 0.375rem 2.25rem 0.375rem 0.75rem; font-size: 1rem; font-weight: 400; line-height: 1.5; color: #212529; background-color: #fff; border: 1px solid #ced4da; border-radius: 0.375rem; appearance: none; background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: right 0.75rem center; background-size: 16px 12px; }
.landing-page-preview .form-label,
.offering-edit-modal .form-label { display: inline-block; margin-bottom: 0.5rem; font-weight: 500; }

/* ─── Editable Section Base ─── */
.editable-section {
    position: relative;
}

/* ─── Edit Toggle Button (pencil icon per section) ─── */
.edit-toggle-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    background: white;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.edit-toggle-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 14px rgba(125, 157, 156, 0.4);
}

.edit-toggle-btn.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

/* ─── Section Move Controls (up/down arrows) ─── */
.section-move-controls {
    position: absolute;
    top: 20px;
    right: 74px;
    z-index: 10;
    display: flex;
    gap: 4px;
}

.section-move-btn {
    width: 36px;
    height: 44px;
    border-radius: 8px;
    border: 2px solid var(--primary-color);
    background: white;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.section-move-btn:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 14px rgba(125, 157, 156, 0.4);
}

.section-move-btn:disabled {
    opacity: 0.25;
    cursor: not-allowed;
}

/* ─── View / Edit Mode Visibility ─── */
.editable-section .view-mode {
    display: block;
}

.editable-section .edit-mode {
    display: none;
}

.editable-section.editing .view-mode {
    display: none;
}

.editable-section.editing .edit-mode {
    display: block;
}

/* ─── Hero Section Edit Button Override (white variant over dark background) ─── */
.hero.editable-section .edit-toggle-btn {
    top: 80px;
    border-color: white;
    background: rgba(255,255,255,0.15);
    color: white;
    backdrop-filter: blur(6px);
}

.hero.editable-section .edit-toggle-btn:hover {
    background: white;
    color: var(--primary-color);
}

.hero.editable-section .edit-toggle-btn.active {
    background: rgba(255,255,255,0.9);
    color: var(--accent-color);
    border-color: white;
}

/* ─── Navbar: site.css overrides for admin Bootstrap bleed ─── */
/* The editor navbar lives outside .landing-page-preview, so site.css
   navbar rules (.navbar-brand, .nav-link, etc.) get overridden by admin
   Bootstrap. These scoped rules restore the public page appearance. */
.editor-layout .navbar {
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.editor-layout .navbar-brand {
    font-family: var(--heading-font);
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: 0.5px;
}

.editor-layout .nav-link {
    color: var(--dark-color);
    font-weight: 500;
    margin: 0 10px;
    transition: color 0.3s;
}

.editor-layout .nav-link:hover {
    color: var(--primary-color);
}

.editor-layout .navbar-divider {
    height: 24px;
    width: 1px;
    background-color: rgba(0, 0, 0, 0.1);
    margin: 0 10px;
}

.editor-layout .navbar-social {
    display: flex;
    align-items: center;
    margin-left: 15px;
}

.editor-layout .navbar-social a {
    color: var(--dark-color);
    font-size: 1.1rem;
    margin: 0 8px;
    transition: color 0.3s;
}

.editor-layout .navbar-social a:hover {
    color: var(--primary-color);
}

/* ─── Editor navbar action buttons (social-edit, theme-picker) ─── */
/* Match the existing nav-edit-btn / settings-btn pattern */
.social-edit-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1.5px solid var(--primary-color);
    background: white;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.7rem;
    transition: all 0.2s;
    flex-shrink: 0;
    margin-left: 8px;
}

.social-edit-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.theme-picker-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1.5px solid var(--primary-color);
    background: white;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s;
    flex-shrink: 0;
    margin-left: 6px;
}

.theme-picker-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.navbar-social-wrapper {
    display: flex;
    align-items: center;
}

/* ─── Publish Button (editor navbar) ─── */
.publish-site-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 6px 16px;
    border-radius: 20px;
    border: none;
    font-family: 'Roboto Slab', serif;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    margin-left: 8px;
}

.publish-site-btn.unpublished {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 2px 10px rgba(125,157,156,0.4);
}

.publish-site-btn.unpublished:hover {
    background: var(--accent-color);
    box-shadow: 0 4px 14px rgba(125,157,156,0.5);
    transform: translateY(-1px);
}

.publish-site-btn.published {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1.5px solid #a5d6a7;
}

.publish-site-btn.published:hover {
    background: #ffebee;
    color: #c62828;
    border-color: #ef9a9a;
}

.publish-site-btn .status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

/* ─── Publish Confirmation Bar (fixed bottom toast) ─── */
.publish-confirm-bar {
    display: none;
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--dark-color);
    color: white;
    border-radius: 12px;
    padding: 14px 20px;
    z-index: 2000;
    align-items: center;
    gap: 16px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.25);
    font-size: 0.88rem;
    white-space: nowrap;
}

.publish-confirm-bar.active {
    display: flex;
}

.publish-confirm-bar .confirm-yes {
    background: #c62828;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 6px 16px;
    font-family: 'Roboto Slab', serif;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
}

.publish-confirm-bar .confirm-yes:hover {
    background: #b71c1c;
}

.publish-confirm-bar .confirm-no {
    background: rgba(255,255,255,0.15);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    padding: 6px 16px;
    font-family: 'Roboto Slab', serif;
    font-size: 0.82rem;
    cursor: pointer;
}

.publish-confirm-bar .confirm-no:hover {
    background: rgba(255,255,255,0.25);
}

/* ─── Shared Edit Form Styles (Phase 2) ─── */

.edit-mode-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(125, 157, 156, 0.1);
  border: 1px solid rgba(125, 157, 156, 0.3);
  color: var(--primary-color, #7d9d9c);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.btn-save {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  background: var(--primary-color, #7d9d9c);
  color: white;
  border: 2px solid var(--primary-color, #7d9d9c);
  border-radius: 8px;
  font-family: "Roboto Slab", serif;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-save:hover {
  background: var(--accent-color, #5a7e7d);
  border-color: var(--accent-color, #5a7e7d);
}

.btn-cancel {
  display: inline-flex;
  align-items: center;
  padding: 10px 22px;
  background: transparent;
  color: var(--text-color, #333);
  border: 2px solid #dee2e6;
  border-radius: 8px;
  font-family: "Roboto Slab", serif;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-cancel:hover {
  border-color: #adb5bd;
  background: #f8f9fa;
}

.about-img {
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  width: 100%;
  object-fit: cover;
}
.about-img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 300px;
  background: #f8f9fa;
  border-radius: 10px;
  color: #adb5bd;
  font-size: 4rem;
}
.about-image-upload {
  border-radius: 10px;
}
.about-upload-actions {
  margin-top: 12px;
  text-align: center;
}

.image-upload-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  cursor: pointer;
}
.image-upload-wrapper:hover .image-upload-overlay {
  opacity: 1;
}
.image-upload-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  opacity: 0;
  transition: opacity 0.3s;
  gap: 8px;
}
.image-upload-overlay i {
  font-size: 2rem;
}
.upload-hint {
  font-size: 0.8rem;
  opacity: 0.8;
}
.image-upload-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.edit-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
  align-items: center;
}

/* ─── Hero Edit Panel Styles ─── */

/* Override shared edit-mode-label for hero (glassmorphism on dark background) */
.hero .edit-mode-label {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(6px);
  border-color: rgba(255, 255, 255, 0.3);
  color: white;
}

.hero-edit-input {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  color: white;
  font-family: "Roboto Slab", serif;
  font-size: 1rem;
  transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
  backdrop-filter: blur(6px);
  margin-bottom: 14px;
  box-sizing: border-box;
}
.hero-edit-input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1);
}
.hero-edit-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}
.hero-edit-input.title-input {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 16px;
}
.hero-edit-input.subtitle-input {
  font-size: 1.1rem;
  font-weight: 300;
}
textarea.hero-edit-input {
  resize: vertical;
  min-height: 60px;
}

.hero-cta-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  align-items: center;
}
.hero-cta-label-text {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.7);
  white-space: nowrap;
}
.hero-cta-show-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.85rem;
  white-space: nowrap;
}

.hero-image-preview-wrap {
  margin-bottom: 12px;
}
.hero-image-preview-thumb {
  max-width: 200px;
  max-height: 120px;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  object-fit: cover;
}

.hero-image-change {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.12);
  color: white;
  font-family: "Roboto Slab", serif;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: all 0.25s ease;
}
.hero-image-change:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.7);
}

.hero-edit-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
  align-items: center;
}

/* Override shared btn-save and btn-cancel for hero (glassmorphism on dark background) */
.hero .btn-save {
  background: white;
  color: var(--accent-color, #5a7e7d);
  border-color: white;
}
.hero .btn-save:hover {
  background: #f0f4f4;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}
.hero .btn-cancel {
  border-color: rgba(255, 255, 255, 0.4);
  color: white;
  background: transparent;
}
.hero .btn-cancel:hover {
  border-color: white;
  background: rgba(255, 255, 255, 0.1);
}

@media (max-width: 767px) {
  .hero-edit-input.title-input {
    font-size: 1.4rem;
  }
}

/* ─── Editable Section Title ─── */
.section-title-editable {
  display: none;
  width: 100%;
  max-width: 500px;
  padding: 8px 16px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-family: "Roboto Slab", serif;
  font-weight: 700;
  font-size: inherit;
  color: var(--primary-color);
  background: white;
  margin-bottom: 50px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.section-title-editable:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(125, 157, 156, 0.15);
}

.editable-section.editing .section-title-view { display: none; }
.editable-section.editing .section-title-editable { display: block; }

.section-edit-controls {
  display: flex; align-items: center; gap: 12px; margin-bottom: 24px; flex-wrap: wrap;
}
.section-edit-controls .section-title-editable {
  display: block; margin-bottom: 0; flex: 1; min-width: 200px;
}

.btn-done-editing {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 20px; border: 2px solid var(--primary-color, #7c3aed);
  border-radius: 8px; background: white; color: var(--primary-color, #7c3aed);
  font-weight: 600; font-size: 0.9rem; cursor: pointer;
  transition: all 0.2s ease; white-space: nowrap;
}
.btn-done-editing:hover {
  background: var(--primary-color, #7c3aed); color: white;
}

/* ─── Classes Section ─── */

.class-card-wrapper { position: relative; transition: transform 0.25s ease, opacity 0.25s ease; }
.class-card-wrapper.dragging { opacity: 0.5; transform: scale(0.95); }
.class-card-wrapper.drag-over { transform: scale(1.02); }

.card-edit-controls {
  position: absolute; top: 0; left: 0; right: 0; z-index: 5;
  display: none; justify-content: space-between; align-items: flex-start;
  padding: 10px; pointer-events: none;
}
.editable-section.editing .card-edit-controls { display: flex; }
.card-edit-controls > * { pointer-events: auto; }

.drag-handle {
  width: 36px; height: 36px; border-radius: 8px; background: white;
  border: none; color: var(--dark-color, #333); display: flex;
  align-items: center; justify-content: center; cursor: grab;
  font-size: 1rem; box-shadow: 0 2px 8px rgba(0,0,0,0.15); transition: all 0.2s ease;
}
.drag-handle:hover { background: var(--primary-color, #7c3aed); color: white; transform: scale(1.1); }
.drag-handle:active { cursor: grabbing; }

.card-action-btns { display: flex; gap: 6px; }
.card-action-btn {
  width: 36px; height: 36px; border-radius: 8px; border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 0.9rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15); transition: all 0.2s ease;
}
.card-action-btn:hover { transform: scale(1.1); }
.card-action-btn.edit-btn { background: white; color: var(--primary-color, #7c3aed); }
.card-action-btn.edit-btn:hover { background: var(--primary-color, #7c3aed); color: white; }
.card-action-btn.delete-btn { background: white; color: #dc3545; }
.card-action-btn.delete-btn:hover { background: #dc3545; color: white; }
.card-action-btn.publish-btn { background: white; color: #28a745; }
.card-action-btn.publish-btn.unpublished { color: #6c757d; }
.card-action-btn.publish-btn:hover { background: #28a745; color: white; }

.class-draft-badge {
  position: absolute; top: 10px; left: 10px; z-index: 4;
  background: #ffc107; color: #333; padding: 2px 10px;
  border-radius: 20px; font-size: 0.7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  display: none;
}

.editable-section.editing .class-card-wrapper.unpublished .class-draft-badge {
  display: block;
}

.day-pills { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }

/* Dim the day-pills in edit mode so they don't clash with controls */
.editable-section.editing .day-pills {
  opacity: 0;
  pointer-events: none;
}
.day-pill {
  background: var(--primary-color, #7c3aed); color: white;
  padding: 2px 8px; border-radius: 12px; font-size: 0.7rem; font-weight: 600;
}

/* Days checkbox pill grid — used in class edit modal */
.days-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.day-checkbox { display: none; }
.day-checkbox-label {
  display: inline-flex; align-items: center; justify-content: center;
  width: 52px; height: 36px; border-radius: 18px;
  border: 2px solid #ddd; font-size: 0.8rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s ease;
  color: var(--dark-color, #333); user-select: none;
}
.day-checkbox:checked + .day-checkbox-label {
  background: var(--primary-color, #7c3aed);
  border-color: var(--primary-color, #7c3aed);
  color: white;
}
.day-checkbox-label:hover { border-color: var(--primary-color, #7c3aed); }

.add-class-card,
.add-event-card,
.add-testimonial-card {
  display: none; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; min-height: 200px; border: 2px dashed var(--primary-color, #7c3aed);
  border-radius: 10px; cursor: pointer; color: var(--primary-color, #7c3aed);
  transition: all 0.2s ease; gap: 10px; padding: 20px;
  background: transparent;
}
.editable-section.editing .add-class-card,
.editable-section.editing .add-event-card,
.editable-section.editing .add-testimonial-card { display: flex; }
.add-class-card:hover,
.add-event-card:hover,
.add-testimonial-card:hover { background: rgba(124,58,237,0.05); transform: scale(1.02); }
.add-class-card i,
.add-event-card i,
.add-testimonial-card i { font-size: 2rem; }
.add-class-card span,
.add-event-card span,
.add-testimonial-card span { font-size: 0.9rem; font-weight: 600; }

/* Modal overlay — per-entity backdrop classes avoid Bootstrap class collisions */
.class-edit-modal-backdrop,
.testimonial-modal-backdrop,
.offering-edit-modal-backdrop {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 1050;
  background: rgba(0,0,0,0.5); display: flex;
  align-items: center; justify-content: center;
}
.class-edit-modal,
.testimonial-modal,
.offering-edit-modal {
  background: white;
  border-radius: 14px;
  padding: 36px;
  width: 90%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  position: fixed;
  inset: 0;
  margin: auto;
  height: fit-content;
  z-index: 1051;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  animation: modalSlideIn 0.25s ease;
}
.offering-edit-modal { max-width: 520px; }
.testimonial-modal  { max-width: 520px; }
@keyframes modalSlideIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}
.class-edit-modal h3,
.testimonial-modal h3,
.offering-edit-modal h3 {
  font-family: "Roboto Slab", serif;
  font-weight: 700;
  color: var(--primary-color, #7d9d9c);
  margin-bottom: 24px;
  font-size: 1.4rem;
}
.class-edit-modal .form-label,
.testimonial-modal .form-label,
.offering-edit-modal .form-label {
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--accent-color, #5a7e7d);
  margin-bottom: 6px;
}
.class-edit-modal .form-control,
.class-edit-modal .form-select,
.testimonial-modal .form-control,
.testimonial-modal .form-select,
.offering-edit-modal .form-control,
.offering-edit-modal .form-select {
  font-family: "Roboto Slab", serif;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  padding: 10px 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.class-edit-modal .form-control:focus,
.class-edit-modal .form-select:focus,
.testimonial-modal .form-control:focus,
.testimonial-modal .form-select:focus,
.offering-edit-modal .form-control:focus,
.offering-edit-modal .form-select:focus {
  border-color: var(--primary-color, #7d9d9c);
  box-shadow: 0 0 0 3px rgba(125,157,156,0.15);
}
.class-edit-modal textarea.form-control,
.testimonial-modal textarea.form-control,
.offering-edit-modal textarea.form-control {
  min-height: 90px;
  resize: vertical;
}
.modal-close-btn {
  position: absolute; top: 16px; right: 16px; background: var(--light-color, #f5f5f5); border: none;
  font-size: 0.9rem; cursor: pointer; color: var(--dark-color, #333); width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center; border-radius: 50%;
  transition: background 0.2s;
}
.modal-close-btn:hover { background: #ddd; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 28px; }
body.modal-open { overflow: hidden; }

/* ─── Events Section ─── */
.event-type-badge {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  padding: 3px 10px; border-radius: 20px; letter-spacing: 0.05em;
}
.event-type-workshop { background: #6f42c1; color: white; }
.event-type-retreat   { background: #20c997; color: white; }
.event-type-training  { background: #fd7e14; color: white; }
.event-type-event     { background: #0d6efd; color: white; }

/* Event type selector in modal */
.event-type-selector {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.event-type-option {
    display: none;
}

.event-type-option-label {
    padding: 6px 16px;
    border: 2px solid #ddd;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
    color: var(--dark-color, #333);
}

.event-type-option:checked + .event-type-option-label {
    background: var(--primary-color, #7c3aed);
    border-color: var(--primary-color, #7c3aed);
    color: white;
}

.event-type-option-label:hover {
    border-color: var(--primary-color, #7c3aed);
}

/* ============================================================
   OFFERINGS SECTION
   ============================================================ */

.offerings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 1100px;
  margin: 0 auto;
}

@media (max-width: 991px) {
  .offerings-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 575px) {
  .offerings-grid {
    grid-template-columns: 1fr;
  }
}

.offering-card-wrapper {
  position: relative;
}

.offering-card {
  background: white;
  border-radius: 14px;
  padding: 32px 28px 28px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  position: relative;
  border: 1px solid rgba(125, 157, 156, 0.12);
  height: 100%;
}

.offering-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.offering-card.draft-card {
  opacity: 0.6;
}

.offering-draft-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: #ffc107;
  color: #333;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  display: none;
}

.editable-section.editing .offering-card.draft-card .offering-draft-badge {
  display: block;
}

/* Edit controls inside the card (absolute top-right) */
.offering-card-edit-controls {
  position: absolute;
  top: 10px;
  right: 10px;
  display: none;
  gap: 4px;
  z-index: 5;
}

.editable-section.editing .offering-card .offering-card-edit-controls {
  display: flex;
}

.offering-card-edit-controls button {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid rgba(125, 157, 156, 0.3);
  background: white;
  color: var(--bs-primary, #6366f1);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  transition: all 0.2s;
}

.offering-card-edit-controls button:hover {
  background: var(--bs-primary, #6366f1);
  color: white;
  border-color: var(--bs-primary, #6366f1);
}

.offering-card-edit-controls button.delete-btn:hover {
  background: #dc3545;
  border-color: #dc3545;
}

.offering-card-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--bs-primary, #6366f1), var(--bs-secondary, #a5b4fc));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  color: white;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.offering-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 6px;
}

.offering-card-price {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--bs-primary, #6366f1);
  margin-bottom: 10px;
}

.offering-card-desc {
  color: #666;
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 14px;
}

.offering-card-features {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
  flex: 1;
}

.offering-card-features li {
  padding: 4px 0;
  font-size: 0.875rem;
  color: #374151;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.offering-card-features li i {
  color: var(--bs-primary, #6366f1);
  font-size: 0.7rem;
  margin-top: 5px;
  flex-shrink: 0;
}

.offering-card-cta .btn {
  width: 100%;
  border-radius: 8px;
  font-size: 0.9rem;
  padding: 10px 16px;
}

.add-offering-card {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  border: 2px dashed rgba(125, 157, 156, 0.4);
  border-radius: 14px;
  cursor: pointer;
  color: var(--bs-primary, #6366f1);
  font-size: 0.9rem;
  gap: 10px;
  transition: border-color 0.2s, background 0.2s;
  background: transparent;
}

.add-offering-card:hover {
  border-color: var(--bs-primary, #6366f1);
  background: rgba(125, 157, 156, 0.05);
}

.add-offering-card i {
  font-size: 1.8rem;
}

.add-offering-card span {
  font-size: 0.9rem;
  font-weight: 500;
}

/* Show add card only in editing mode */
.editable-section.editing .add-offering-card {
  display: flex;
}

/* Icon picker grid */
.icon-picker-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.icon-picker-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.25rem;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 0.7rem;
  color: #64748b;
  gap: 0.25rem;
  transition: border-color 0.15s, background 0.15s;
}

.icon-picker-btn i {
  font-size: 1.25rem;
  color: #475569;
}

.icon-picker-btn.selected {
  border-color: var(--bs-primary, #6366f1);
  background: #ede9fe;
  color: var(--bs-primary, #6366f1);
}

.icon-picker-btn.selected i {
  color: var(--bs-primary, #6366f1);
}

/* Feature list editor */
.offering-features-editor {
  margin-bottom: 0.5rem;
}

.add-feature-btn {
  background: none;
  border: 1px dashed #94a3b8;
  border-radius: 6px;
  padding: 0.25rem 0.75rem;
  font-size: 0.825rem;
  color: #64748b;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.add-feature-btn:hover {
  border-color: var(--bs-primary, #6366f1);
  color: var(--bs-primary, #6366f1);
}

/* Offering edit modal sizing override */
.offering-edit-modal {
  max-width: 560px;
}

/* ============================================================
   TESTIMONIALS SECTION
   ============================================================ */

/* View mode: carousel — hidden when .editing */
.editable-section .testimonials-carousel-view {
  display: block;
}

.editable-section.editing .testimonials-carousel-view {
  display: none;
}

/* Also hide by ID when views use #testimonials-carousel-wrapper */
.testimonials.editing #testimonials-carousel-wrapper {
  display: none;
}

/* Edit mode: list — hidden when not .editing */
.editable-section .testimonials-edit-list {
  display: none;
}

.editable-section.editing .testimonials-edit-list {
  display: block;
}

/* site.css testimonial styles; admin Bootstrap overrides them in the editor */
.landing-page-preview .testimonial-text {
    font-style: italic;
    color: var(--dark-color);
    font-weight: 300;
}

.landing-page-preview .author-info h5 {
    color: var(--primary-color);
    font-weight: 600;
}

.landing-page-preview .avatar-initials {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.landing-page-preview .testimonial-rating {
    color: #b08fd1;
}

/* Testimonial edit card (card-based layout) */
.testimonial-edit-card {
  background: white;
  border-radius: 10px;
  padding: 24px;
  position: relative;
  margin-bottom: 16px;
  box-shadow: 0 3px 12px rgba(0,0,0,0.06);
  display: flex;
  gap: 16px;
  align-items: flex-start;
  transition: box-shadow 0.2s;
}
.testimonial-edit-card:hover {
  box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}
.testimonial-edit-card.unpublished {
  opacity: 0.55;
  border-left: 4px solid #ccc;
}
.testimonial-edit-card.dragging {
  opacity: 0.5;
}
.testimonial-edit-card.drag-over {
  border-top: 3px solid var(--primary-color, #6366f1);
}

/* Avatar in edit card */
.testimonial-edit-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  border: 2px solid var(--primary-color, #7d9d9c);
}
.testimonial-edit-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.testimonial-edit-avatar-initials {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--primary-color, #7d9d9c);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1rem;
  border: 2px solid var(--primary-color, #7d9d9c);
}

/* Body content */
.testimonial-edit-body {
  flex: 1;
  min-width: 0;
}
.testimonial-edit-body h5 {
  font-weight: 600;
  color: var(--primary-color, #7d9d9c);
  margin-bottom: 2px;
  font-size: 1rem;
}
.testimonial-edit-body .edit-meta {
  font-size: 0.82rem;
  color: var(--accent-color, #6b7280);
  margin-bottom: 6px;
}
.testimonial-edit-body .edit-quote {
  font-size: 0.9rem;
  color: var(--dark-color, #374151);
  font-style: italic;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Status badge */
.testimonial-edit-status {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 4px;
  margin-top: 6px;
  display: inline-block;
}
.testimonial-edit-status.published {
  background: rgba(25, 135, 84, 0.1);
  color: #198754;
}
.testimonial-edit-status.draft {
  background: rgba(0,0,0,0.06);
  color: #888;
}

/* Action buttons — vertical stack */
.testimonial-edit-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}
.testimonial-edit-actions button,
.testimonial-edit-actions .pub-btn,
.testimonial-edit-actions .del-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
  background: var(--light-color, #f1f5f9);
  color: var(--dark-color, #374151);
}
.testimonial-edit-actions button:hover {
  transform: scale(1.1);
}
.testimonial-edit-actions .pub-btn.published {
  background: rgba(25, 135, 84, 0.12);
  color: #198754;
}
.testimonial-edit-actions .pub-btn.unpublished {
  background: rgba(0,0,0,0.06);
  color: #aaa;
}
.testimonial-edit-actions .del-btn:hover {
  background: #fce4e4;
  color: #dc3545;
}

/* Delete confirmation overlay */
.delete-confirm {
  position: absolute;
  inset: 0;
  background: rgba(220, 53, 69, 0.92);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  color: white;
}
.delete-confirm p {
  font-weight: 600;
  margin-bottom: 12px;
  font-size: 1rem;
}
.delete-confirm-actions {
  display: flex;
  gap: 10px;
}
.delete-confirm-actions .confirm-yes-form button {
  background: white;
  color: #dc3545;
  border: none;
  padding: 6px 18px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}
.delete-confirm-actions .confirm-no {
  background: transparent;
  color: white;
  border: 2px solid white;
  padding: 6px 18px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}

/* Add testimonial row trigger */
.add-testimonial-row {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border: 2px dashed #cbd5e1;
  border-radius: 10px;
  cursor: pointer;
  color: #94a3b8;
  font-size: 0.9rem;
  transition: border-color 0.2s, color 0.2s;
}

.add-testimonial-row:hover {
  border-color: var(--bs-primary, #6366f1);
  color: var(--bs-primary, #6366f1);
}

.editable-section.editing .add-testimonial-row {
  display: flex;
}

/* Avatar upload in modal */
.avatar-upload-area {
  position: relative;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 2px dashed #cbd5e1;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
}

.testimonial-avatar-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.avatar-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  color: #94a3b8;
  font-size: 0.75rem;
}

.avatar-placeholder i {
  font-size: 1.5rem;
}

.avatar-file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

/* Avatar type toggle in testimonial modal */
.avatar-type-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.avatar-type-btn {
  padding: 6px 14px;
  border-radius: 6px;
  border: 2px solid #e0e0e0;
  background: white;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--dark-color, #374151);
  cursor: pointer;
  transition: all 0.2s;
}
.avatar-type-btn.active {
  border-color: var(--primary-color, #7d9d9c);
  background: var(--primary-color, #7d9d9c);
  color: white;
}

/* Card image upload area styles live in app/javascript/styles/image_uploader.css
   (loaded via the Vite-bundled application.css for both editor and onboarding). */

/* Delete confirmation overlay */
.delete-confirm {
  position: absolute;
  inset: 0;
  background: rgba(220, 53, 69, 0.92);
  border-radius: 10px;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: white;
  z-index: 6;
  backdrop-filter: blur(2px);
}
.delete-confirm.visible { display: flex; }
.delete-confirm p {
  font-weight: 600;
  font-size: 1rem;
  margin: 0;
}
.delete-confirm-actions { display: flex; gap: 10px; }
.delete-confirm-actions button,
.delete-confirm-actions .confirm-yes-form button {
  padding: 8px 20px;
  border-radius: 8px;
  border: 2px solid white;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  background: transparent;
  color: white;
}
.delete-confirm-actions .confirm-yes-form button {
  background: white;
  color: #dc3545;
}
.delete-confirm-actions .confirm-no:hover { background: rgba(255,255,255,0.15); }
/* Star rating picker — CSS trick: radios reversed, flex row-reverse */
.star-rating-picker {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: 0.25rem;
}

.star-rating-picker input[type="radio"] {
  display: none;
}

.star-rating-picker label {
  font-size: 1.5rem;
  color: #d1d5db;
  cursor: pointer;
  transition: color 0.1s;
}

/* Highlight: hovered star and all stars after it (lower value = further right visually) */
.star-rating-picker label:hover,
.star-rating-picker label:hover ~ label,
.star-rating-picker input:checked ~ label {
  color: #f59e0b;
}

/* Testimonial edit modal sizing */
.testimonial-edit-modal {
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

/* ============================================================
   CONTACT SECTION
   ============================================================ */

.contact-info-preview .col-md-6,
.contact-info-preview .col-12 {
  font-size: 0.95rem;
  color: #374151;
}

.contact-info-preview i {
  width: 1.25rem;
  text-align: center;
}

/* ── Contact Section ── */
.contact-settings-panel {
    background: white;
    padding: 32px 40px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    height: 100%;
}

.contact-settings-panel h5 {
    color: var(--dark-color, #333);
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--light-color, #f8f9fa);
}

.contact-settings-panel .form-label {
    font-weight: 600;
    color: var(--dark-color, #333);
    font-size: 0.85rem;
}

/* Contact info sidebar (primary-color background) */
.contact-info {
    background-color: var(--primary-color, #7c3aed);
    color: white;
    padding: 40px;
    border-radius: 10px;
    height: 100%;
}

.contact-info h3 {
    margin-bottom: 30px;
    font-weight: 700;
}

.contact-info-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 25px;
}

.contact-info-item i {
    font-size: 1.5rem;
    margin-right: 15px;
    margin-top: 5px;
}

.contact-info-item .content {
    flex: 1;
    min-width: 0;
}

.contact-info-item .content h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.contact-info-item .content p {
    font-size: 1rem;
    margin-bottom: 0;
}

/* Inline-editable inputs on the primary-color sidebar */
.contact-info-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 6px;
    padding: 6px 10px;
    color: white;
    font-size: 0.95rem;
    font-family: inherit;
    margin-bottom: 4px;
}

.contact-info-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.contact-info-input:focus {
    outline: none;
    border-color: white;
    background: rgba(255, 255, 255, 0.3);
}

/* Contact form preview (white card) */
.contact-form {
    background-color: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* ============================================================
   EDITOR NAVBAR PANELS (Social + Nav + Settings)
   CSS checkbox-hack panels: input:checked ~ .editor-panel → visible
   ============================================================ */

.editor-panel-toggle-input {
  display: none;
}

.editor-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease-out;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.editor-panel-toggle-input:checked ~ .editor-panel {
  max-height: 400px;
  transition: max-height 0.3s ease-in;
}

.editor-panel-inner {
  border-top: 1px solid #e2e8f0;
}

.editor-panel-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
}

.social-input-icon {
  min-width: 2rem;
  justify-content: center;
  background: #fff;
  color: #64748b;
}

/* Stack the toggle inputs and panels in source order so :checked sibling selector works.
   The navbar div (publish-confirm wrapper) comes first in the DOM, then the inputs,
   then the panels. We position inputs AFTER the navbar div so the ~ combinator
   from input:checked can reach .editor-panel siblings. */

/* ============================================================
   THEME SWATCHES BAR
   ============================================================ */

.theme-swatches {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.theme-swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

.theme-swatch-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, transform 0.2s;
  position: relative;
  overflow: hidden;
}

.theme-swatch-circle .swatch-inner {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

.theme-swatch-circle .swatch-check {
  position: relative;
  z-index: 1;
  color: white;
  font-size: 1rem;
  display: none;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
}

.theme-swatch.active .theme-swatch-circle {
  border-color: var(--dark-color);
  transform: scale(1.1);
}

.theme-swatch.active .swatch-check {
  display: block;
}

.theme-swatch:hover .theme-swatch-circle {
  transform: scale(1.08);
}

.theme-swatch-name {
  font-size: 0.72rem;
  color: #666;
}

.theme-swatch.active .theme-swatch-name {
  color: var(--dark-color);
  font-weight: 700;
}

/* button_to generates <form> wrappers — make them transparent to the grid layout */
.theme-swatches form {
  display: contents;
}

.theme-swatches form button.theme-swatch {
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
}

/* Extend prototype's .settings-field input rule to cover textarea */
.settings-field textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  font-family: 'Roboto Slab', serif;
  font-size: 0.9rem;
  color: var(--dark-color, #2c3e50);
  resize: vertical;
  box-sizing: border-box;
}

.settings-field textarea:focus {
  outline: none;
  border-color: var(--primary-color, #7d9d9c);
  box-shadow: 0 0 0 3px rgba(125, 157, 156, 0.12);
}

/* ─── Nav Edit Panel ─── */
.nav-edit-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.nav-edit-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--primary-color);
  background: white;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.7rem;
  transition: all 0.2s;
  flex-shrink: 0;
  margin-left: 8px;
}

.nav-edit-btn:hover {
  background: var(--primary-color);
  color: white;
  transform: scale(1.1);
}

.nav-edit-btn.active {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: white;
}

.nav-edit-panel {
  position: absolute;
  top: calc(100% + 14px);
  right: 0;
  width: 400px;
  max-height: 70vh;
  overflow-y: auto;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.18);
  padding: 24px;
  z-index: 10001;
  display: none;
  animation: modalSlideIn 0.25s ease;
}

.nav-edit-panel.visible {
  display: block;
}

.nav-edit-panel h4 {
  font-family: "Roboto Slab", serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary-color);
  margin-bottom: 18px;
}

.nav-edit-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.nav-edit-row:last-child {
  border-bottom: none;
}

.nav-edit-label {
  width: 110px;
  flex-shrink: 0;
  padding: 7px 10px;
  border: 1.5px solid #e0e0e0;
  border-radius: 6px;
  font-family: "Roboto Slab", serif;
  font-size: 0.82rem;
  color: var(--dark-color);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.nav-edit-url {
  flex: 1;
  min-width: 0;
  padding: 7px 10px;
  border: 1.5px solid #e0e0e0;
  border-radius: 6px;
  font-family: "Roboto Slab", serif;
  font-size: 0.82rem;
  color: var(--dark-color);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.nav-edit-label:focus,
.nav-edit-url:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(125, 157, 156, 0.12);
}

@media (max-width: 991px) {
  .nav-edit-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    right: auto;
    transform: translate(-50%, -50%);
    width: 90vw;
    max-width: 400px;
  }
}

/* ─── Settings Panel ─── */
.settings-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--primary-color);
  background: white;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.75rem;
  transition: all 0.2s;
  flex-shrink: 0;
  margin-left: 6px;
}

.settings-btn:hover {
  background: var(--primary-color);
  color: white;
  transform: scale(1.1);
}

.settings-group {
  margin-bottom: 24px;
}

.settings-group-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary-color);
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1.5px solid var(--light-color);
}

.settings-field {
  margin-bottom: 14px;
}

.settings-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--dark-color);
  margin-bottom: 5px;
}

.settings-field input {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  font-family: 'Roboto Slab', serif;
  font-size: 0.9rem;
  color: var(--dark-color);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.settings-field input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(125,157,156,0.12);
}

.settings-domain-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.settings-domain-row input {
  flex: 1;
}

.settings-domain-sep {
  color: #aaa;
  font-size: 0.9rem;
  flex-shrink: 0;
}

/* ── Editor sidebars ── */

.editor-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 360px;
  height: 100vh;
  background: #fff;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.14);
  z-index: 10100;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.editor-sidebar.open {
  transform: translateX(0);
}

.editor-sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 10099;
  display: none;
}

.editor-sidebar-backdrop.visible {
  display: block;
}

.editor-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 16px;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.editor-sidebar-header h3 {
  font-family: "Roboto Slab", serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary-color, #7d9d9c);
  margin: 0;
}

.editor-sidebar-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 1rem;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.editor-sidebar-close:hover {
  background: #f1f5f9;
  color: #334155;
}

.editor-sidebar-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

/* Theme swatches in sidebar: 3 columns fits the 320px content area well */
.editor-sidebar .theme-swatches {
  grid-template-columns: repeat(3, 1fr) !important;
}

/* Prevent body scroll when a sidebar is open */
body.editor-sidebar-open {
  overflow: hidden;
}

@media (max-width: 575px) {
  .editor-sidebar {
    width: 100vw;
  }
}

/* ── Social Sidebar ── */
.social-edit-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.social-edit-row:last-of-type {
    border-bottom: none;
}

.social-edit-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    flex-shrink: 0;
}

.social-edit-row.disabled .social-edit-icon {
    opacity: 0.35;
}

.social-edit-icon.facebook  { background: #1877f2; }
.social-edit-icon.instagram { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }
.social-edit-icon.youtube   { background: #ff0000; }
.social-edit-icon.linkedin  { background: #0a66c2; }
.social-edit-icon.tiktok    { background: #010101; }
.social-edit-icon.twitter   { background: #1da1f2; }
.social-edit-icon.bluesky   { background: #0085ff; }
.social-edit-icon.substack  { background: #ff6719; }

.social-edit-url {
    flex: 1;
    min-width: 0;
    padding: 7px 10px;
    border: 1.5px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--dark-color);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.social-edit-url:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(125, 157, 156, 0.12);
}

.social-edit-row.disabled .social-edit-url {
    opacity: 0.4;
    pointer-events: none;
}

/* Toggle switch */
.social-edit-toggle {
    position: relative;
    width: 38px;
    height: 22px;
    flex-shrink: 0;
}

.social-edit-toggle input {
    display: none;
}

.social-edit-toggle .toggle-slider {
    position: absolute;
    inset: 0;
    background: #ccc;
    border-radius: 11px;
    cursor: pointer;
    transition: background 0.2s;
}

.social-edit-toggle .toggle-slider::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    top: 3px;
    left: 3px;
    transition: transform 0.2s;
}

.social-edit-toggle input:checked + .toggle-slider {
    background: var(--primary-color);
}

.social-edit-toggle input:checked + .toggle-slider::after {
    transform: translateX(16px);
}

.social-panel-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* Settings sidebar subtitle */
.editor-sidebar-body .subtitle {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 20px;
}

/* ── Workshops & Retreats Editor ── */
.workshop-card-wrapper {
    position: relative;
}

.workshop-card-wrapper.unpublished .workshop-card {
    opacity: 0.5;
}

.workshop-card-wrapper .card-edit-controls {
    display: none;
}

.editable-section.editing .workshop-card-wrapper .card-edit-controls {
    display: flex;
}

.editable-section.editing .workshop-card-wrapper .event-type {
    opacity: 0;
    pointer-events: none;
}

.workshop-draft-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    z-index: 3;
    display: none;
}

.editable-section.editing .workshop-card-wrapper.unpublished .workshop-draft-badge {
    display: block;
}

.add-workshop-card {
    border: 3px dashed var(--primary-color, #7c3aed);
    border-radius: 10px;
    background: rgba(125, 157, 156, 0.05);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
    min-height: 380px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--primary-color, #7c3aed);
}

.editable-section.editing .add-workshop-card {
    display: flex;
}

.add-workshop-card:hover {
    background: rgba(125, 157, 156, 0.12);
    border-color: var(--accent-color, #5b21b6);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(125, 157, 156, 0.2);
}

.add-workshop-card i {
    font-size: 2.5rem;
    opacity: 0.8;
}

.add-workshop-card span {
    font-weight: 600;
    font-size: 1.05rem;
}

/* Event type pill badge */
.event-type {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: var(--primary-color, #7c3aed);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 2;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.event-type.workshop {
    background-color: var(--primary-color, #7c3aed);
}

.event-type.retreat {
    background-color: var(--accent-color, #5b21b6);
}

.event-type.training {
    background-color: #6a994e;
}

.event-type.event {
    background-color: #bc6c25;
}

/* Workshop card layout */
.workshop-info {
    display: flex;
    flex-wrap: wrap;
    margin-top: 15px;
    font-size: 0.9rem;
    color: var(--accent-color, #5b21b6);
}

.workshop-info-left,
.workshop-info-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.workshop-info-right {
    text-align: right;
}

.workshop-info-item {
    display: flex;
    align-items: center;
}

.workshop-info-left .workshop-info-item i {
    width: 20px;
    margin-right: 8px;
    text-align: center;
}

.workshop-info-right .workshop-info-item i {
    width: 20px;
    margin-left: 8px;
    text-align: center;
}

.workshop-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color, #7c3aed);
    margin: 15px 0;
    text-align: left;
    padding: 10px 0;
}

.workshop-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
}
