/* Ikon desktop dari database — meniru tampilan ikon Framer. Prefix dk- supaya tidak bentrok. */

#dk-layer {
  position: absolute;
  inset: 0;
  z-index: 10; /* sejajar app Framer, di atas lapisan "Blur" (z 3) */
  pointer-events: none;
}
.dk-icon {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 120px;
  pointer-events: auto;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  outline: none;
  animation: dk-in 260ms ease both;
}
@keyframes dk-in { from { opacity: 0; transform: translate(-50%, -46%); } }
.dk-icon.dk-dragging { cursor: grabbing; opacity: .85; animation: none; }

.dk-frame {
  display: block;
  padding: 3px;
  background: #fff;
  border-radius: 2px;
  box-shadow: 0 2px 3px rgba(0, 0, 0, .08);
}
.dk-frame img {
  display: block;
  max-width: 86px;
  max-height: 72px;
  width: auto;
  height: auto;
  border-radius: 1px;
  pointer-events: none;
}
.dk-frame-empty { width: 72px; height: 54px; background: #e5e5e5; border: 3px solid #fff; }
.dk-sym { display: block; width: 72px; height: 72px; pointer-events: none; }

.dk-label {
  max-width: 116px;
  padding: 0 5px;
  border-radius: 4px;
  font: 500 14px/1.3 "Inter Display", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  color: #fff;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .24);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
}
.dk-icon.dk-selected .dk-label { background: #0a64ff; text-shadow: none; }
.dk-icon.dk-selected .dk-frame,
.dk-icon.dk-selected .dk-sym { filter: brightness(.82); }
.dk-icon:focus-visible .dk-label { outline: 2px solid #fff; outline-offset: 1px; }

@media (max-width: 809.98px) {
  .dk-icon { width: 96px; gap: 4px; }
  .dk-frame img { max-width: 72px; max-height: 60px; }
  .dk-sym { width: 64px; height: 64px; }
  .dk-label { font-size: 13px; max-width: 94px; }
}

/* Quick Look (pratinjau foto/PDF) */
#dk-ql {
  position: fixed;
  z-index: 2147483100;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(900px, calc(100vw - 32px));
  height: min(640px, calc(100vh - 120px));
  display: flex;
  flex-direction: column;
  background: #1d1d1f;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .35);
  font: 13px/1.4 -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
  color: #fff;
}
.dk-ql-bar { display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 14px; background: #2c2c2e; flex: none; }
.dk-ql-close { width: 12px; height: 12px; border-radius: 50%; background: #ff5f57; border: 0; padding: 0; cursor: pointer; }
.dk-ql-title { flex: 1; font-weight: 600; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dk-ql-open { color: #8ab4ff; text-decoration: none; }
.dk-ql-body { flex: 1; min-height: 0; display: grid; place-items: center; }
.dk-ql-body img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.dk-ql-body iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.dk-ql-empty { color: #a1a1a6; }

/* ---------- Mode edit (admin) ---------- */
:root {
  --dk-accent: #0a64ff;
  --dk-ui: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
}
/* Bilah mode edit: kecil, di tengah baris menu atas Framer (sejajar logo Apple). */
#dk-editbar {
  position: fixed;
  z-index: 2147483200;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  height: 24px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 3px 0 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .28);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #fff;
  font: 500 12px/1 var(--dk-ui);
  white-space: nowrap;
}
#dk-editbar strong { font-weight: 600; margin-right: 2px; }
.dk-editbar-dot { width: 6px; height: 6px; border-radius: 50%; background: #28c840; }
#dk-editbar a, #dk-editbar button {
  font: inherit; color: #fff; background: rgba(255, 255, 255, .16); border: 0; border-radius: 999px;
  padding: 4px 9px; cursor: pointer; text-decoration: none;
}
#dk-editbar a:hover, #dk-editbar button:hover { background: rgba(255, 255, 255, .3); }
/* Di HP baris menu atas sudah penuh (nama, sosial, tanggal): bilah pindah ke atas dock. */
@media (max-width: 809.98px) { #dk-editbar { top: auto; bottom: 104px; height: 28px; } }

.dk-editing .dk-icon { cursor: default; }
.dk-editing [data-framer-name="Drag Canvas"] [class*="-container"] { cursor: default; }

.dk-rename {
  width: 116px;
  resize: none;
  overflow: hidden;
  font: 500 14px/1.3 "Inter Display", "Inter", var(--dk-ui);
  text-align: center;
  color: #1d1d1f;
  background: #fff;
  border: 0;
  border-radius: 4px;
  padding: 1px 4px;
  outline: 3px solid rgba(10, 100, 255, .55);
  pointer-events: auto;
}

#dk-toast {
  position: fixed;
  z-index: 2147483300;
  left: 50%;
  bottom: 110px;
  transform: translateX(-50%);
  max-width: min(560px, calc(100vw - 32px));
  padding: 9px 16px;
  border-radius: 10px;
  background: rgba(28, 28, 30, .9);
  color: #fff;
  font: 13px/1.4 var(--dk-ui);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
  text-align: center;
}
#dk-toast.dk-toast-error { background: #d70015; }

#dk-menu {
  position: fixed;
  z-index: 2147483400;
  min-width: 210px;
  padding: 5px;
  border-radius: 9px;
  background: rgba(246, 246, 246, .94);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(0, 0, 0, .12);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .22);
  font: 13px/1.3 var(--dk-ui);
  color: #1d1d1f;
}
#dk-menu button {
  display: block; width: 100%; text-align: left;
  font: inherit; color: inherit; background: none; border: 0; border-radius: 5px;
  padding: 5px 10px; cursor: default;
}
#dk-menu button:hover:not(:disabled), #dk-menu button:focus-visible { background: var(--dk-accent); color: #fff; outline: none; }
#dk-menu button:disabled { opacity: .4; }
#dk-menu .dk-danger { color: #d70015; }
.dk-menu-sep { height: 1px; margin: 4px 8px; background: rgba(0, 0, 0, .12); }

#dk-dialog {
  position: fixed; inset: 0; z-index: 2147483500;
  display: grid; place-items: center;
  background: rgba(0, 0, 0, .18);
  font: 13px/1.4 var(--dk-ui);
}
.dk-dialog-box {
  width: min(360px, calc(100vw - 32px));
  padding: 18px;
  border-radius: 12px;
  background: #fff;
  color: #1d1d1f;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .3);
}
.dk-dialog-box label { display: flex; flex-direction: column; gap: 8px; font-weight: 600; }
.dk-dialog-box input {
  font: inherit; font-weight: 400; padding: 7px 10px; border-radius: 7px;
  border: 1px solid #d2d2d7; outline: none;
}
.dk-dialog-box input:focus { border-color: var(--dk-accent); box-shadow: 0 0 0 3px rgba(10, 100, 255, .25); }
.dk-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.dk-dialog-actions button {
  font: inherit; padding: 5px 14px; border-radius: 7px; border: 1px solid #d2d2d7; background: #fff; cursor: pointer;
}
.dk-dialog-actions .dk-primary { background: var(--dk-accent); border-color: var(--dk-accent); color: #fff; }

#dk-panel {
  position: fixed;
  z-index: 2147483150;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(980px, calc(100vw - 32px));
  height: min(760px, calc(100vh - 100px));
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  overflow: hidden;
  background: #f5f5f7;
  border: 1px solid rgba(0, 0, 0, .1);
  box-shadow: 0 24px 64px rgba(0, 0, 0, .3);
  font: 13px/1.3 var(--dk-ui);
}
.dk-panel-bar {
  display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 14px; flex: none;
  background: #fff; border-bottom: 1px solid rgba(0, 0, 0, .1); color: #1d1d1f;
}
.dk-panel-close { width: 12px; height: 12px; border-radius: 50%; background: #ff5f57; border: 0; padding: 0; cursor: pointer; }
.dk-panel-title { flex: 1; font-weight: 600; text-align: center; }
.dk-panel-bar a { color: var(--dk-accent); text-decoration: none; }
#dk-panel iframe { flex: 1; width: 100%; border: 0; }

/* Penanda saat file diseret dari komputer */
.dk-drop-desktop #dk-layer { outline: 3px dashed rgba(255, 255, 255, .8); outline-offset: -12px; border-radius: 16px; background: rgba(10, 100, 255, .08); }
.dk-drop-finder #df-finder { outline: 3px solid var(--dk-accent); }

/* ---------- Kanvas isi proyek (mode edit) ---------- */
.ed-tools { margin-left: auto; display: flex; align-items: center; gap: 10px; font: 12px/1.3 var(--dk-ui); }
.df-detail-head .df-visit + .ed-tools { margin-left: 10px; }
.ed-status { color: #86868b; white-space: nowrap; }
.ed-status[data-kind="ok"] { color: #1f8f3a; }
.ed-status[data-kind="error"] { color: #d70015; cursor: pointer; text-decoration: underline; }
.ed-kop { font: inherit; padding: 4px 10px; border-radius: 6px; border: 1px solid rgba(0,0,0,.14); background: #fff; color: #1d1d1f; cursor: pointer; }
.ed-kop:hover { border-color: rgba(0,0,0,.3); }

.ed-host { margin-top: 16px; }
.ed-host .ed-content.df-doc { margin-top: 0; min-height: 260px; outline: none; cursor: text; padding-bottom: 80px; }
.ed-content p.is-empty::before,
.ed-content h1.is-empty::before, .ed-content h2.is-empty::before, .ed-content h3.is-empty::before {
  content: attr(data-placeholder);
  color: #aeaeb2;
  float: left;
  height: 0;
  pointer-events: none;
}
/* Di editor, heading pakai h1–h3 milik Tiptap; samakan ukurannya dengan tampilan publik (h2–h4). */
.ed-content h1 { font-size: 18px; font-weight: 700; margin: 22px 0 8px; color: #1d1d1f; }
.ed-content h2 { font-size: 15px; font-weight: 600; margin: 18px 0 6px; color: #1d1d1f; }
.ed-content h3 { font-size: 13px; font-weight: 600; margin: 16px 0 6px; color: #1d1d1f; }
.ed-content img { width: 100%; height: auto; border-radius: 6px; display: block; margin: 0 0 12px; }
.ed-content img.ProseMirror-selectednode { outline: 3px solid #0a64ff; outline-offset: 2px; }
.ed-content hr.ProseMirror-selectednode { border-top-color: #0a64ff; }
.ed-content a { cursor: text; }

.ed-slash {
  position: fixed;
  z-index: 2147483600;
  width: 260px;
  max-height: 320px;
  overflow-y: auto;
  padding: 6px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid rgba(0,0,0,.1);
  box-shadow: 0 12px 32px rgba(0,0,0,.18);
  font: 13px/1.3 var(--dk-ui);
  color: #1d1d1f;
}
.ed-slash-head { font-size: 11px; font-weight: 600; color: #86868b; padding: 4px 8px 6px; }
.ed-slash-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 6px 8px; border: 0; border-radius: 6px; background: none; text-align: left; cursor: pointer; font: inherit; color: inherit;
}
.ed-slash-item.ed-active, .ed-slash-item:hover { background: #eef3ff; }
.ed-slash-item b { display: block; font-weight: 500; }
.ed-slash-item small { display: block; color: #86868b; font-size: 11.5px; }
.ed-slash-icon {
  flex: none; width: 32px; height: 32px; display: grid; place-items: center;
  border: 1px solid rgba(0,0,0,.1); border-radius: 6px; background: #fff; font-size: 12px; font-weight: 600; color: #3a3a3c;
}
.ed-slash-empty { padding: 8px; color: #86868b; }

.ed-bubble {
  z-index: 2147483600;
  display: flex;
  gap: 2px;
  padding: 4px;
  border-radius: 8px;
  background: #1d1d1f;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.ed-bubble button {
  min-width: 28px; height: 28px; padding: 0 6px; border: 0; border-radius: 5px;
  background: none; color: #fff; font: 13px/1 var(--dk-ui); cursor: pointer;
}
.ed-bubble button:hover { background: rgba(255,255,255,.14); }
.ed-bubble button.ed-on { background: #0a64ff; }
