/* ============================================================
   Admin Panel — login modal, floating toolbar, inline editing,
   image overlays, drag & drop / paste feedback, backups panel.
   ============================================================ */

:root {
  --admin-accent: #ffb300;
  --admin-bg: #10151f;
  --admin-bg-2: #161d2a;
  --admin-border: #2a3444;
  --admin-danger: #ff4d4f;
  --admin-success: #4ade80;
}

.admin-hidden { display: none !important; }

/* ---------- Floating launcher button (bottom-right) ---------- */
#admin-launcher-btn {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9998;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffc843 0%, #ffb300 60%, #b87f00 100%);
  color: #1a1300;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.5);
  cursor: pointer;
  border: none;
  transition: transform 0.15s ease;
}
#admin-launcher-btn:hover { transform: scale(1.08); }

/* ---------- Modal overlay (login) ---------- */
.admin-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 10, 0.75);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Rajdhani', 'Oswald', sans-serif;
}

.admin-modal-box {
  background: var(--admin-bg);
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  padding: 32px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

.admin-modal-title {
  font-family: 'Oswald', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-modal-title i { color: var(--admin-accent); }

.admin-modal-subtitle {
  font-size: 13px;
  color: #93a0b4;
  margin-bottom: 22px;
}

.admin-field { margin-bottom: 16px; }

.admin-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #93a0b4;
  margin-bottom: 6px;
}

.admin-input {
  width: 100%;
  background: var(--admin-bg-2);
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  padding: 11px 14px;
  color: #fff;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease;
}
.admin-input:focus { border-color: var(--admin-accent); }

.admin-error {
  color: var(--admin-danger);
  font-size: 12.5px;
  margin-bottom: 12px;
  min-height: 16px;
}

.admin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.5px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  padding: 11px 20px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.admin-btn-primary {
  background: linear-gradient(180deg, #ffc843 0%, #ffb300 60%, #b87f00 100%);
  color: #1a1300;
  width: 100%;
}
.admin-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(255,179,0,0.3); }

.admin-btn-secondary {
  background: var(--admin-bg-2);
  border: 1px solid var(--admin-border);
  color: #fff;
}
.admin-btn-secondary:hover { border-color: var(--admin-accent); }

.admin-btn-danger {
  background: rgba(255, 77, 79, 0.12);
  border: 1px solid rgba(255, 77, 79, 0.4);
  color: var(--admin-danger);
}
.admin-btn-danger:hover { background: rgba(255, 77, 79, 0.2); }

.admin-btn-sm { padding: 7px 12px; font-size: 12px; }

.admin-close-x {
  position: absolute;
  top: 14px;
  right: 14px;
  background: transparent;
  border: none;
  color: #93a0b4;
  font-size: 18px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.admin-close-x:hover { background: rgba(255,255,255,0.08); color: #fff; }

/* ---------- Editing mode banner + toolbar ---------- */
#admin-toolbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9997;
  background: linear-gradient(90deg, #14100a 0%, #1a1300 100%);
  border-bottom: 2px solid var(--admin-accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

#admin-toolbar .admin-toolbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 600;
}

#admin-toolbar .admin-toolbar-left i { color: var(--admin-accent); }

#admin-toolbar .admin-toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

#admin-save-status {
  font-size: 12px;
  color: #93a0b4;
  min-width: 140px;
}
#admin-save-status.saving { color: var(--admin-accent); }
#admin-save-status.saved { color: var(--admin-success); }
#admin-save-status.error { color: var(--admin-danger); }

body.admin-editing { padding-top: 46px; }

/* ---------- Editable text elements ---------- */
body.admin-editing [data-content-key] {
  outline: 1px dashed transparent;
  cursor: text;
  transition: outline-color 0.15s ease, background-color 0.15s ease;
  border-radius: 3px;
}
body.admin-editing [data-content-key]:hover {
  outline-color: rgba(255, 179, 0, 0.6);
  background-color: rgba(255, 179, 0, 0.08);
}
body.admin-editing [data-content-key][contenteditable="true"] {
  outline: 2px solid var(--admin-accent);
  background-color: rgba(255, 179, 0, 0.12);
}

/* ---------- Editable image elements ---------- */
body.admin-editing [data-image-slot],
body.admin-editing [data-bg-slot] {
  cursor: grab;
}

body.admin-editing .admin-image-slot-target {
  outline: 1px dashed transparent;
  transition: outline-color 0.15s ease;
}
body.admin-editing .admin-image-slot-target:hover {
  outline-color: rgba(255, 179, 0, 0.7);
}

/* Single floating overlay, positioned via JS with getBoundingClientRect() */
.admin-image-overlay {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(10, 14, 23, 0.55);
  border: 2px dashed rgba(255, 179, 0, 0.7);
  border-radius: 4px;
  pointer-events: auto;
}
.admin-image-overlay.drag-active {
  display: flex;
}

.admin-image-overlay-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(20, 24, 33, 0.9);
  border: 1px solid var(--admin-border);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: transform 0.15s ease, background 0.15s ease;
}
.admin-image-overlay-btn:hover { transform: scale(1.1); background: var(--admin-accent); color: #1a1300; }
.admin-image-overlay-btn.danger:hover { background: var(--admin-danger); color: #fff; }

.admin-image-slot-target.drop-target {
  outline: 3px solid var(--admin-success) !important;
}

/* ---------- Toast notifications ---------- */
#admin-toast-container {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-toast {
  background: var(--admin-bg);
  border: 1px solid var(--admin-border);
  border-left: 4px solid var(--admin-accent);
  color: #fff;
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  max-width: 320px;
  animation: admin-toast-in 0.2s ease;
}
.admin-toast.success { border-left-color: var(--admin-success); }
.admin-toast.error { border-left-color: var(--admin-danger); }

@keyframes admin-toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Backups panel ---------- */
.admin-backups-panel {
  position: fixed;
  top: 56px;
  right: 20px;
  z-index: 9997;
  width: 340px;
  max-height: 70vh;
  overflow-y: auto;
  background: var(--admin-bg);
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  padding: 16px;
}

.admin-backups-title {
  font-family: 'Oswald', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.admin-backups-title i { color: var(--admin-accent); }

.admin-backup-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--admin-border);
}
.admin-backup-item:last-child { border-bottom: none; }

.admin-backup-info {
  font-size: 12px;
  color: #93a0b4;
  flex: 1;
}
.admin-backup-info strong { display: block; color: #fff; font-size: 12.5px; margin-bottom: 2px; }

/* ---------- Drop zone hint overlay when dragging file over the page ---------- */
#admin-global-drop-hint {
  position: fixed;
  inset: 0;
  z-index: 9996;
  background: rgba(255, 179, 0, 0.08);
  border: 4px dashed var(--admin-accent);
  display: none;
  align-items: center;
  justify-content: center;
  font-family: 'Oswald', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--admin-accent);
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
  pointer-events: none;
}
#admin-global-drop-hint.active { display: flex; }
