/* CMS Admin Styles */
.cms-editable {
  padding: 5px;
  margin: 2px;
  cursor: pointer;
}

.cms-editable:hover {
  background-color: #f8f9fa;
}

.cms-editable-image {
  padding: 5px;
  margin: 2px;
  cursor: pointer;
}

.cms-editable-image:hover {
  background-color: #f8f9fa;
}

/* Admin-only styling */
.admin-mode .cms-editable {
  border: 1px dashed #007bff;
}

.admin-mode .cms-editable-image {
  border: 1px dashed #007bff;
}

.admin-toolbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: #007bff;
  color: white;
  padding: 10px;
  z-index: 1000;
  display: none;
}

.admin-toolbar.show {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-toolbar a {
  color: white;
  text-decoration: none;
}

.content-area {
  padding-top: 50px;
}
/* ===== Inline CMS modal editor (TipTap) ===== */
.cms-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.cms-modal {
  background: #fff; border-radius: 6px;
  width: 100%; max-width: 720px;
  max-height: 90vh; display: flex; flex-direction: column;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.cms-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid #eee;
}
.cms-modal-header h3 { margin: 0; font-size: 16px; }
.cms-modal-x {
  background: none; border: none; font-size: 24px; line-height: 1;
  cursor: pointer; color: #666;
}
.cms-modal-body { padding: 16px; overflow: auto; flex: 1; }
.cms-modal-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 12px 16px; border-top: 1px solid #eee;
}
.cms-btn {
  padding: 8px 16px; border-radius: 4px; border: 1px solid transparent;
  cursor: pointer; font-size: 14px;
}
.cms-btn-primary { background: #007bff; color: #fff; }
.cms-btn-primary:disabled { background: #6ea8df; cursor: wait; }
.cms-btn-secondary { background: #fff; color: #333; border-color: #ccc; }

.cms-tt-toolbar {
  display: flex; flex-wrap: wrap; gap: 4px;
  padding: 6px; border: 1px solid #ddd; border-bottom: none;
  background: #f8f9fa; border-radius: 4px 4px 0 0;
}
.cms-tt-toolbar button {
  background: #fff; border: 1px solid #ddd; padding: 4px 8px;
  cursor: pointer; border-radius: 3px; font-size: 13px;
}
.cms-tt-toolbar button:hover { background: #e9ecef; }
.cms-tt-host {
  border: 1px solid #ddd; border-radius: 0 0 4px 4px; min-height: 200px;
}
.cms-tt-host .ProseMirror {
  padding: 12px; min-height: 200px; outline: none;
}

.cms-img-current { text-align: center; margin-bottom: 12px; }
.cms-img-current img { max-width: 100%; max-height: 240px; border: 1px solid #eee; }
.cms-img-controls { display: flex; flex-direction: column; gap: 10px; }
.cms-img-controls label { display: block; font-size: 14px; }
.cms-img-controls input[type="text"],
.cms-img-controls input[type="file"] {
  display: block; width: 100%; margin-top: 4px;
  padding: 6px; border: 1px solid #ccc; border-radius: 3px;
}

/* When admin mode is on, push the page down a bit so the toolbar doesn't cover content. */
.admin-mode { padding-top: 44px; }

/* ===== Admin-mode interaction fixes =====
   In admin mode any hover overlays / scale transforms on cards must NOT
   intercept clicks on `.cms-editable` / `.cms-editable-image` elements,
   otherwise the TipTap / image-upload modal never opens (clicks land on
   the overlay <a> instead). Specifically the rooms page has a
   `.minimal-room-card .room-image .hover-overlay` that covers the image,
   and both room-card variants scale the image on hover. */
.admin-mode .room-image .hover-overlay,
.admin-mode .hover-overlay {
  display: none !important;
  pointer-events: none !important;
}
.admin-mode .room-image:hover img,
.admin-mode .room-card:hover .room-image img,
.admin-mode .minimal-room-card:hover .room-image img {
  transform: none !important;
}
/* Make sure the editable image itself is the topmost click target inside
   the card, above any decorative absolutely-positioned siblings. */
.admin-mode .cms-editable-image {
  position: relative;
  z-index: 2;
}

/* ===== Gallery editor (resort + gallery pages) ===== */
.gallery-wrapper { position: relative; }
.gallery-remove-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 5;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(220, 53, 69, 0.92);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}
.gallery-remove-btn:hover { background: #dc3545; }
.admin-mode .gallery-remove-btn { display: inline-flex; align-items: center; justify-content: center; }

.gallery-add-tile { display: none; }
.admin-mode .gallery-add-tile { display: block; }
.gallery-add-btn {
  width: 100%;
  min-height: 220px;
  border: 2px dashed #888;
  background: rgba(255,255,255,0.4);
  color: #333;
  font-size: 1.1rem;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.gallery-add-btn:hover { background: rgba(255,255,255,0.7); border-color: #444; }
.gallery-add-btn i { font-size: 2rem; }
