/* ── Admin Panel Styles ──────────────────────────── */
/* Only visible when admin mode is active */

body.admin-active .admin-selected {
  outline: 2px solid #c3317d !important;
  outline-offset: 2px;
  position: relative;
}
body.admin-active .admin-selected::after {
  content: attr(class);
  position: absolute;
  top: -22px;
  left: 0;
  background: #c3317d;
  color: #fff;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 3px;
  font-family: monospace;
  z-index: 10000;
  white-space: nowrap;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.admin-active .admin-editing {
  outline: 2px solid #c9a84c !important;
  outline-offset: 2px;
  min-height: 1em;
}

body.admin-active .admin-dragging {
  opacity: 0.4;
  outline: 2px dashed #c3317d !important;
}

body.admin-active .admin-dragover {
  border-top: 3px solid #c3317d !important;
}

body.admin-active section:hover,
body.admin-active .content-section:hover {
  outline: 1px dashed rgba(195,49,125,0.3);
  outline-offset: -1px;
}

/* ── Toolbar ───────────────────────────────────── */
#admin-toolbar {
  position: fixed;
  top: 80px;
  right: 16px;
  width: 260px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  background: #0f1520;
  border: 1px solid rgba(195,49,125,0.3);
  border-radius: 12px;
  z-index: 99999;
  font-family: 'DM Sans', -apple-system, sans-serif;
  font-size: 12px;
  color: #bbb;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  backdrop-filter: blur(20px);
}
#admin-toolbar::-webkit-scrollbar { width: 4px; }
#admin-toolbar::-webkit-scrollbar-thumb { background: #c3317d40; border-radius: 4px; }

.atb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  cursor: move;
  user-select: none;
}
.atb-logo {
  font-weight: 700;
  color: #c3317d;
  font-size: 13px;
  letter-spacing: 0.05em;
}
.atb-close {
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  font-size: 16px;
  padding: 0;
  line-height: 1;
}
.atb-close:hover { color: #fff; }

.atb-section {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.atb-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #666;
  margin-bottom: 8px;
  font-weight: 600;
}
.atb-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.atb-btns button {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: #bbb;
  padding: 5px 10px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 11px;
  font-family: inherit;
  transition: all 0.15s;
  white-space: nowrap;
}
.atb-btns button:hover {
  background: rgba(195,49,125,0.15);
  border-color: rgba(195,49,125,0.4);
  color: #fff;
}
.atb-btns button.atb-danger:hover {
  background: rgba(220,50,50,0.2);
  border-color: rgba(220,50,50,0.5);
  color: #ff6b6b;
}
.atb-info {
  margin-top: 8px;
  font-size: 11px;
  color: #555;
  font-style: italic;
}
.atb-footer {
  padding: 12px 16px;
  font-size: 10px;
  color: #444;
  line-height: 1.6;
  text-align: center;
}

/* ── Modal ─────────────────────────────────────── */
#admin-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.amodal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
}
.amodal-box {
  position: relative;
  background: #0f1520;
  border: 1px solid rgba(195,49,125,0.3);
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
}
.amodal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.amodal-header h3 {
  margin: 0;
  font-size: 15px;
  color: #fff;
  font-family: inherit;
}
.amodal-close {
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  font-size: 18px;
}
.amodal-body {
  padding: 20px;
}
.amodal-body label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #888;
  margin-bottom: 6px;
  font-weight: 600;
}
.amodal-body input,
.amodal-body textarea {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: #ddd;
  padding: 10px 12px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  margin-bottom: 4px;
  box-sizing: border-box;
}
.amodal-body input:focus,
.amodal-body textarea:focus {
  outline: none;
  border-color: rgba(195,49,125,0.5);
}
.amodal-body input[type="color"] {
  padding: 4px;
  height: 36px;
  cursor: pointer;
}
.amodal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.amodal-footer button {
  padding: 8px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  border: 1px solid rgba(255,255,255,0.1);
}
.amodal-cancel {
  background: transparent;
  color: #888;
}
.amodal-save {
  background: #c3317d;
  color: #fff;
  border-color: #c3317d !important;
}
.amodal-save:hover {
  background: #d4428e;
}

/* ── Toast ─────────────────────────────────────── */
.admin-toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #0f1520;
  border: 1px solid rgba(195,49,125,0.3);
  color: #fff;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  z-index: 100001;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}
.admin-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* iframe cover for admin selection */
.admin-iframe-cover:hover {
  background: rgba(195,49,125,0.1) !important;
  outline: 2px dashed rgba(195,49,125,0.5);
}

/* free drag mode */
.admin-dragging-free {
  outline: 2px dashed #c3317d !important;
  outline-offset: 4px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
  transition: none !important;
}
