/* Mini CMS editor UI */
.cms-topbar {
  position: fixed;
  top: 12px;
  right: 12px;
  left: auto;
  z-index: 10000001 !important;
  background: rgba(30, 42, 56, 0.92);
  color: #fff;
  padding: 10px 14px;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.18);
  border-radius: 12px;
  max-width: calc(100vw - 24px);
}

.cms-topbar-title {
  font-weight: 700;
}

.cms-topbar-right {
  display: flex;
  gap: 10px;
  align-items: center;
}

.cms-btn {
  border: 1px solid rgba(255,255,255,0.25);
  background: transparent;
  color: #fff;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
}

.cms-btn:hover {
  border-color: rgba(255,255,255,0.6);
}

.cms-btn-secondary {
  background: rgba(255,255,255,0.06);
}
.cms-btn-danger {
  background: #b91c1c !important;
  border-color: transparent !important;
  color: #fff !important;
}

/* Clickable elements while editing */
.cms-editable {
  outline: 2px dashed var(--accent-color, #F57C00);
  outline-offset: 3px;
  cursor: pointer !important;
}

/* Modal */
.cms-modal {
  position: fixed;
  inset: 0;
  z-index: 10000002 !important;
  display: none;
}

.cms-modal.active {
  display: block;
}

.cms-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
}

.cms-modal-dialog {
  position: relative;
  width: min(720px, calc(100vw - 24px));
  margin: 6vh auto 0 auto;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 22px 60px rgba(0,0,0,0.35);
}

.cms-modal-header {
  padding: 14px 16px;
  background: #1E2A38;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cms-modal-close {
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}

.cms-modal-body {
  padding: 16px;
}

.cms-field-wrap {
  display: block;
}

.cms-label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

.cms-textarea,
.cms-file {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #ddd;
}

.cms-color {
  width: 140px;
  height: 38px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid #ddd;
}

.cms-modal-footer {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid #eee;
}

.cms-modal-error {
  margin-right: auto;
  color: #b00020;
  font-weight: 600;
}

.cms-image-preview-wrap {
  margin-top: 12px;
}

.cms-image-preview {
  max-width: 100%;
  border-radius: 10px;
  border: 1px solid #eee;
}

/* Use the template accent color for buttons when available */
.cms-modal .cms-btn {
  background: var(--accent-color, #F57C00);
  border-color: transparent;
  color: #fff;
}

.cms-modal .cms-btn.cms-btn-secondary {
  background: #f1f3f5;
  color: #222;
}

/* In edit mode, force FAQ answers open for easy editing */
body.cms-edit-mode #faqAccordion .collapse {
  display: block !important;
  height: auto !important;
  visibility: visible !important;
}

/* Hero background area: klikbaar voor CMS (tekst blijft boven overlay) */
body.cms-edit-mode .cms-hero-bg.cms-editable {
  cursor: pointer;
}

/* Kliks op lege ruimte in hero-tekstblok vallen door naar achtergrond */
body.cms-edit-mode .Modern-Slider .text-content {
  pointer-events: none;
}
body.cms-edit-mode .Modern-Slider .text-content > * {
  pointer-events: auto;
}

/* Portfolio file manager */
.cms-portfolio-manager {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000003 !important;
}
.cms-portfolio-manager.active {
  display: block;
}
.cms-portfolio-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}
.cms-portfolio-dialog {
  position: relative;
  width: min(1100px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  margin: 12px auto;
  background: #fff;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.cms-portfolio-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid #e5e7eb;
}
.cms-portfolio-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cms-portfolio-close-x {
  border: 0;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: #374151;
  padding: 0 6px;
}
.cms-portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  padding: 12px;
  overflow: auto;
}
.cms-portfolio-card {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px;
  background: #fafafa;
}
.cms-portfolio-label {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}
.cms-portfolio-thumb {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  margin-bottom: 8px;
  background: #fff;
}
.cms-portfolio-empty {
  height: 120px;
  border-radius: 8px;
  border: 1px dashed #cbd5e1;
  display: grid;
  place-items: center;
  color: #64748b;
  font-size: 12px;
  margin-bottom: 8px;
  background: #fff;
}
.cms-portfolio-file {
  width: 100%;
  font-size: 12px;
}
.cms-portfolio-delete {
  width: 100%;
  margin-top: 8px;
  border: 0;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  background: #fee2e2;
  color: #991b1b;
  cursor: pointer;
}

/* Project manager */
.cms-projects-manager {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000004 !important;
}
.cms-projects-manager.active {
  display: block;
}
.cms-projects-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.58);
}
.cms-projects-dialog {
  position: relative;
  width: min(1200px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  min-height: min(720px, calc(100vh - 24px));
  margin: 12px auto;
  background: #fff;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.cms-projects-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid #e5e7eb;
}
.cms-projects-actions {
  display: flex;
  gap: 8px;
}
.cms-projects-body {
  padding: 12px;
  overflow: auto;
  display: grid;
  gap: 12px;
  min-height: 220px;
}
.cms-projects-help {
  padding: 10px 14px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  color: #0f172a;
  font-size: 13px;
  line-height: 1.5;
}
.cms-projects-empty {
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  color: #334155;
  padding: 16px;
}
.cms-project-card {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px;
  background: #f8fafc;
}
.cms-projects-dialog .cms-btn {
  background: #1f2937;
  border-color: #1f2937;
  color: #fff;
}
.cms-projects-dialog .cms-btn.cms-btn-secondary {
  background: #e2e8f0;
  border-color: #cbd5e1;
  color: #0f172a;
}
.cms-project-form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}
.cms-project-form-row label {
  font-size: 13px;
  font-weight: 600;
}
.cms-project-input,
.cms-project-textarea {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px 10px;
}
.cms-project-textarea {
  min-height: 80px;
  resize: vertical;
}
.cms-project-card-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.cms-project-images {
  display: grid;
  gap: 8px;
}
.cms-project-image-row {
  display: grid;
  grid-template-columns: 72px 1fr 90px auto auto;
  gap: 8px;
  align-items: center;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 6px;
  background: #fff;
}
.cms-project-image-row img {
  width: 72px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
}

.cms-project-create-modal {
  position: fixed;
  inset: 0;
  z-index: 10000005;
}
.cms-project-create-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}
.cms-project-create-dialog {
  position: relative;
  width: min(520px, calc(100vw - 48px));
  margin: 70px auto 0 auto;
  background: #fff;
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}
.cms-project-create-dialog h4 {
  margin: 0 0 12px 0;
}
.cms-project-create-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  position: sticky;
  bottom: 0;
  background: #fff;
  padding-top: 8px;
}
.cms-project-helptext {
  font-size: 12px;
  color: #475569;
  margin: -4px 0 10px 0;
}
.cms-create-files-queue {
  display: grid;
  gap: 6px;
  margin-bottom: 8px;
}
.cms-create-file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 8px;
  padding: 6px 8px;
}
.cms-create-file-name {
  font-size: 12px;
  color: #334155;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cms-create-file-remove {
  padding: 4px 8px;
  font-size: 11px;
  border-radius: 6px;
}

.cms-projects-toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 10000010;
  background: #14532d;
  color: #fff;
  border-radius: 10px;
  padding: 10px 14px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 140ms ease, transform 140ms ease;
}
.cms-projects-toast.active {
  opacity: 1;
  transform: translateY(0);
}

