/* ===================================================
   EDITOR — TEMPLATE 11 LUXURY GOLD
   =================================================== */

/* ── Editor Toggle Button ── */
#editorToggleBtn {
  position: fixed;
  bottom: 1.2rem;
  right: 1.2rem;
  z-index: 10000;
  background: linear-gradient(135deg, #c9a86b, #8a6f4d);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 50px;
  font-size: 0.9rem;
  font-family: 'Jost', sans-serif;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
}
#editorToggleBtn:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(0,0,0,0.5); }
#editorToggleBtn.active-mode { background: linear-gradient(135deg, #27ae60, #1e8449); }

/* ── Music Control Button (top-left) ── */
#musicControlBtn {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 9999;
  background: rgba(42, 34, 24, 0.8);
  color: #c9a86b;
  border: 1px solid rgba(201,168,107,0.3);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}
#musicControlBtn:hover { background: rgba(201,168,107,0.2); }
#musicControlBtn.playing { animation: pulse-music 2s infinite; }
@keyframes pulse-music { 0%,100%{box-shadow:0 0 0 0 rgba(201,168,107,0.3)} 50%{box-shadow:0 0 0 8px rgba(201,168,107,0)} }

/* ── Editor Panel ── */
#editorPanel {
  position: fixed;
  top: 0; right: -320px;
  width: 300px; height: 100vh;
  background: #1e1a15;
  z-index: 9998;
  box-shadow: -8px 0 40px rgba(0,0,0,0.5);
  transition: right 0.4s cubic-bezier(0.4,0,0.2,1);
  display: flex; flex-direction: column;
  overflow: hidden;
  border-left: 2px solid rgba(201,168,107,0.4);
}
#editorPanel.active { right: 0; }

/* Push content left when panel is open */
body.editor-on {
  margin-right: 300px;
  transition: margin-right 0.4s cubic-bezier(0.4,0,0.2,1);
}

.editor-panel-header {
  background: linear-gradient(135deg, #2a2218, #1a1510);
  padding: 1.2rem 1.5rem;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(201,168,107,0.2);
}
.editor-panel-header h3 {
  color: #c9a86b;
  font-family: 'Italiana', serif;
  font-size: 1.2rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.editor-panel-header p { color: rgba(255,255,255,0.4); font-size: 0.75rem; margin-top: 0.3rem; }

.editor-panel-body { flex: 1; overflow-y: auto; padding: 1rem; }
.editor-panel-body::-webkit-scrollbar { width: 4px; }
.editor-panel-body::-webkit-scrollbar-thumb { background: #c9a86b; border-radius: 2px; }

.editor-section {
  margin-bottom: 1.2rem;
  background: rgba(42,34,24,0.8);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(201,168,107,0.15);
}
.editor-section-title {
  background: linear-gradient(135deg, rgba(201,168,107,0.2), rgba(138,111,77,0.2));
  color: #c9a86b; padding: 0.6rem 1rem;
  font-size: 0.75rem; font-weight: 500;
  letter-spacing: 0.15em; text-transform: uppercase;
  display: flex; align-items: center; gap: 0.5rem;
  font-family: 'Jost', sans-serif;
}
.editor-section-body { padding: 0.8rem; }

.quick-edit-btn {
  display: flex; align-items: center; gap: 0.6rem;
  width: 100%; padding: 0.55rem 0.8rem; margin-bottom: 0.4rem;
  background: rgba(58,46,38,0.6); border: 1px solid rgba(201,168,107,0.15);
  border-radius: 8px; font-size: 0.82rem; color: #e8d4a8;
  cursor: pointer; transition: all 0.2s; font-family: 'Jost', sans-serif;
  text-align: left;
}
.quick-edit-btn:hover { background: rgba(201,168,107,0.15); border-color: rgba(201,168,107,0.4); transform: translateX(3px); }
.quick-edit-btn i { width: 18px; text-align: center; color: #c9a86b; flex-shrink: 0; font-size: 0.8rem; }

.color-picker-row { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 0.6rem; }
.color-picker-row label { font-size: 0.82rem; color: #e8d4a8; flex: 1; }
.color-picker-row input[type="color"] {
  width: 40px; height: 32px; border: 1px solid rgba(201,168,107,0.3);
  border-radius: 6px; cursor: pointer; padding: 2px; background: #2a2218;
}
.preset-colors { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.5rem; }
.preset-color {
  width: 26px; height: 26px; border-radius: 50%; cursor: pointer;
  border: 2px solid transparent; transition: all 0.2s; flex-shrink: 0;
}
.preset-color:hover { transform: scale(1.2); border-color: #fff; }

.editor-action-btn {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  width: 100%; padding: 0.65rem; margin-bottom: 0.5rem;
  border: none; border-radius: 8px; font-size: 0.82rem;
  font-family: 'Jost', sans-serif; font-weight: 500;
  cursor: pointer; transition: all 0.2s;
}
.editor-action-btn.save   { background: linear-gradient(135deg, #27ae60, #1e8449); color: white; }
.editor-action-btn.reset  { background: linear-gradient(135deg, #e74c3c, #c0392b); color: white; }
.editor-action-btn:hover  { opacity: 0.85; transform: translateY(-1px); }

/* ── Editable highlight ── */
.editable-active { position: relative; transition: outline 0.2s ease !important; }
.editable-active:hover { outline: 2px solid #c9a86b !important; outline-offset: 4px !important; cursor: pointer; }
.editable-active::after {
  content: '✏️ Klik untuk edit';
  position: absolute; top: -28px; left: 50%; transform: translateX(-50%);
  background: rgba(201,168,107,0.95); color: #1a1510;
  font-size: 0.68rem; padding: 3px 8px; border-radius: 4px;
  white-space: nowrap; opacity: 0; pointer-events: none;
  transition: opacity 0.2s; z-index: 9999; font-family: 'Jost', sans-serif;
  font-weight: 500;
}
.editable-active:hover::after { opacity: 1; }

/* ── Edit Modal ── */
#editModal {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  z-index: 99999; display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.3s; padding: 1rem;
  backdrop-filter: blur(4px);
}
#editModal.active { opacity: 1; pointer-events: all; }
.edit-modal-box {
  background: #2a2218; border-radius: 16px; width: 100%; max-width: 500px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6); overflow: hidden;
  border: 1px solid rgba(201,168,107,0.2);
  transform: scale(0.9); transition: transform 0.3s;
}
#editModal.active .edit-modal-box { transform: scale(1); }
.edit-modal-header {
  background: linear-gradient(135deg, #1a1510, #2a2218);
  padding: 1.2rem 1.5rem; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid rgba(201,168,107,0.15);
}
.edit-modal-header h4 { color: #c9a86b; font-family: 'Italiana', serif; font-size: 1.1rem; }
.edit-modal-close {
  background: rgba(255,255,255,0.1); border: none; color: white;
  width: 32px; height: 32px; border-radius: 50%; cursor: pointer;
  font-size: 1rem; display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.edit-modal-close:hover { background: rgba(255,255,255,0.25); }
.edit-modal-body { padding: 1.5rem; }
.edit-modal-body label { display: block; font-size: 0.82rem; font-weight: 500; color: #e8d4a8; margin-bottom: 0.5rem; font-family: 'Jost', sans-serif; }
.edit-modal-body textarea,
.edit-modal-body input[type="text"] {
  width: 100%; padding: 0.8rem; border-radius: 8px;
  border: 1px solid rgba(201,168,107,0.25); background: rgba(58,46,38,0.6);
  font-family: 'Jost', sans-serif;
  font-size: 0.9rem; color: #f5f0e8; outline: none; transition: border-color 0.2s; resize: vertical;
}
.edit-modal-body textarea:focus,
.edit-modal-body input[type="text"]:focus { border-color: #c9a86b; box-shadow: 0 0 0 3px rgba(201,168,107,0.15); }
.edit-modal-body input[type="file"] {
  width: 100%; padding: 0.6rem; border: 1px dashed rgba(201,168,107,0.4);
  border-radius: 8px; font-size: 0.82rem; cursor: pointer; background: rgba(58,46,38,0.4);
  color: #e8d4a8;
}
.btn-save-edit {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  width: 100%; margin-top: 1rem; padding: 0.8rem;
  background: linear-gradient(135deg, #c9a86b, #8a6f4d); color: #1a1510;
  border: none; border-radius: 8px; font-size: 0.9rem;
  font-family: 'Jost', sans-serif; font-weight: 500; cursor: pointer; transition: all 0.2s;
}
.btn-save-edit:hover { opacity: 0.9; transform: translateY(-1px); }

/* ── Editor Badge ── */
.editor-badge {
  position: fixed; top: 4.5rem; right: 1.2rem;
  background: rgba(39,174,96,0.95); color: white;
  padding: 0.4rem 0.9rem; border-radius: 50px; font-size: 0.72rem;
  font-family: 'Jost', sans-serif; z-index: 9999;
  display: none; align-items: center; gap: 0.4rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.editor-badge.show { display: flex; }
.editor-badge-dot {
  width: 7px; height: 7px; border-radius: 50%; background: white;
  animation: blink 1s infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.3} }

/* ── Toast ── */
.toast-notification {
  position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%);
  background: rgba(42,34,24,0.95); color: #e8d4a8;
  padding: 0.8rem 1.5rem; border-radius: 50px;
  font-size: 0.85rem; font-family: 'Jost', sans-serif;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  border: 1px solid rgba(201,168,107,0.3);
  z-index: 100000;
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.5s forwards;
}
@keyframes toastIn { from { opacity:0; transform: translateX(-50%) translateY(20px); } to { opacity:1; transform: translateX(-50%) translateY(0); } }
@keyframes toastOut { from { opacity:1; } to { opacity:0; transform: translateX(-50%) translateY(20px); } }

/* ── Responsive ── */
@media (max-width: 768px) {
  /* On mobile: panel slides from bottom, takes 50% height */
  #editorPanel {
    width: 100%; right: auto; left: 0;
    top: auto; bottom: -100%; height: 50vh;
    border-radius: 16px 16px 0 0;
    border-left: none; border-top: 2px solid rgba(201,168,107,0.4);
    transition: bottom 0.4s cubic-bezier(0.4,0,0.2,1);
  }
  #editorPanel.active { right: auto; bottom: 0; }

  /* Don't push content on mobile, shrink it instead */
  body.editor-on {
    margin-right: 0 !important;
    padding-bottom: 52vh !important;
  }

  #editorToggleBtn { top: auto; bottom: 1rem; right: 1rem; padding: 0.6rem 1rem; font-size: 0.8rem; }
  .editor-badge { top: auto; bottom: 4rem; right: 1rem; }

  /* Ensure cover doesn't overlap */
  body.editor-on .cover-section,
  body.editor-on #cover {
    max-height: 48vh !important;
    overflow: hidden;
  }
}


/* ── Effect buttons active state ── */
.fx-toggle {
    position: relative;
    transition: all 0.2s;
}
.fx-toggle small {
    font-family: 'Jost', sans-serif;
    pointer-events: none;
}
.fx-toggle.fx-active {
    background: rgba(201,168,107,0.2) !important;
    border-color: rgba(201,168,107,0.5) !important;
}
.fx-toggle.fx-active::after {
    content: '✓ ON';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #27ae60;
    font-size: 0.7rem;
    font-weight: 600;
    font-family: 'Jost', sans-serif;
}


/* ── Section Background (foto/video) ── */
[data-section] {
    position: relative;
    overflow: hidden;
}
.section-bg-media {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}
.section-bg-media img,
.section-bg-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.section-bg-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

/* ── Section BG Editor Button ── */
.section-bg-edit-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 100;
    display: none;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 50px;
    border: 1px solid rgba(201,168,107,0.5);
    background: rgba(26,21,16,0.85);
    color: #c9a86b;
    font-size: 0.72rem;
    font-family: 'Jost', sans-serif;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: all 0.2s;
}
.section-bg-edit-btn:hover {
    background: rgba(201,168,107,0.2);
    border-color: #c9a86b;
}
body.editor-on .section-bg-edit-btn {
    display: flex;
}

/* ── BG Section Panel in Editor ── */
.bg-section-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}
.bg-section-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 6px;
    border-radius: 8px;
    border: 1px solid rgba(201,168,107,0.15);
    background: rgba(58,46,38,0.4);
    color: #e8d4a8;
    font-size: 0.72rem;
    font-family: 'Jost', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}
.bg-section-btn:hover {
    background: rgba(201,168,107,0.15);
    border-color: rgba(201,168,107,0.4);
}
.bg-section-btn .icon {
    font-size: 1.1rem;
}
.bg-section-btn.has-bg {
    border-color: rgba(39,174,96,0.5);
    background: rgba(39,174,96,0.1);
}
.bg-section-btn.has-bg::after {
    content: '✓';
    font-size: 0.6rem;
    color: #27ae60;
}


/* ── Feature Toggle Buttons ── */
.feat-toggle {
    position: relative;
}
.feat-toggle .feat-status {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.65rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
}
.feat-toggle.feat-on .feat-status {
    background: rgba(39,174,96,0.2);
    color: #27ae60;
}
.feat-toggle.feat-off .feat-status {
    background: rgba(231,76,60,0.2);
    color: #e74c3c;
}
.feat-toggle.feat-off {
    opacity: 0.6;
    border-color: rgba(231,76,60,0.2) !important;
}


/* ── Top Action Buttons (Preview, Publish, Riset) ── */
.editor-top-actions {
    display: flex;
    gap: 6px;
    padding: 10px 12px;
    background: rgba(26, 21, 16, 0.95);
    border-bottom: 1px solid rgba(201, 168, 107, 0.15);
    flex-shrink: 0;
}
.top-btn {
    flex: 1;
    padding: 10px 8px;
    border-radius: 8px;
    border: 2px solid;
    font-family: 'Jost', sans-serif;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}
.top-btn:hover {
    transform: translateY(-1px);
}
.top-btn.preview-btn {
    background: transparent;
    border-color: #e74c3c;
    color: #e74c3c;
}
.top-btn.preview-btn:hover {
    background: rgba(231, 76, 60, 0.1);
}
.top-btn.publish-btn {
    background: #e74c3c;
    border-color: #e74c3c;
    color: white;
}
.top-btn.publish-btn:hover {
    background: #c0392b;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}
.top-btn.reset-btn {
    background: rgba(201, 168, 107, 0.15);
    border-color: rgba(201, 168, 107, 0.4);
    color: #c9a86b;
}
.top-btn.reset-btn:hover {
    background: rgba(201, 168, 107, 0.25);
}


/* ── Published Banner ── */
.published-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(39, 174, 96, 0.12);
    border-bottom: 1px solid rgba(39, 174, 96, 0.25);
    font-size: 0.75rem;
    color: #27ae60;
    font-family: 'Jost', sans-serif;
    font-weight: 500;
}
.pub-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #27ae60;
    animation: blink 1.5s infinite;
}
.update-btn {
    margin-left: auto;
    padding: 4px 12px;
    border-radius: 50px;
    border: 1px solid rgba(39, 174, 96, 0.4);
    background: rgba(39, 174, 96, 0.1);
    color: #27ae60;
    font-size: 0.7rem;
    font-family: 'Jost', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
}
.update-btn:hover {
    background: rgba(39, 174, 96, 0.2);
    border-color: #27ae60;
}
