/* ============================================================
   Inline Editor CMS Styles
   ============================================================ */

/* 1. Login Gate (Modal overlay) */
#inline-login-gate {
  position: fixed; inset: 0;
  background: rgba(10, 10, 10, 0.95);
  display: flex; align-items: center; justify-content: center;
  z-index: 10000;
  backdrop-filter: blur(8px);
}
.inline-login-box {
  background: var(--surface);
  padding: 40px;
  border-radius: 8px;
  border: 1px solid var(--border);
  width: 100%; max-width: 400px;
  text-align: center;
}
.inline-login-box h2 {
  font-family: 'Oswald', sans-serif;
  color: var(--gold);
  margin-bottom: 8px;
  border: none;
}
.inline-login-box p { color: var(--text-sub); margin-bottom: 24px; font-size: 14px; }
.inline-login-box input {
  width: 100%;
  background: var(--base);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 14px;
  margin-bottom: 16px;
  text-align: center;
}
.inline-login-box input:focus { outline: none; border-color: var(--gold); }
.inline-login-box .btn { width: 100%; }

/* 2. Floating Admin Panel */
#inline-admin-panel {
  position: fixed;
  bottom: 24px; right: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  display: flex; align-items: center; gap: 16px;
  z-index: 9000;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.admin-panel__status {
  display: flex; flex-direction: column;
}
.admin-panel__title {
  font-family: 'Oswald', sans-serif;
  font-weight: 700; color: var(--gold);
  font-size: 14px;
  margin-bottom: 2px;
}
.admin-panel__db {
  font-size: 11px; color: var(--text-sub);
}
.admin-panel__db.connected { color: #52C41A; }
.admin-panel__actions { display: flex; gap: 8px; }

/* 3. Editable Elements Hover/Focus State */
.is-admin-mode [data-i18n] {
  position: relative;
  transition: background-color 0.2s, box-shadow 0.2s;
  cursor: text;
}
.is-admin-mode [data-i18n]:hover {
  background-color: rgba(201, 150, 12, 0.1);
  box-shadow: 0 0 0 1px var(--gold-bright);
  border-radius: 4px;
}
.is-admin-mode [data-i18n]:focus {
  outline: none;
  background-color: rgba(201, 150, 12, 0.2);
  box-shadow: 0 0 0 2px var(--gold);
  border-radius: 4px;
}

/* Tooltip for elements */
.is-admin-mode [data-i18n]::before {
  content: "EDIT";
  position: absolute; top: -18px; left: 0;
  background: var(--gold); color: #000;
  font-size: 10px; font-weight: 700; padding: 2px 6px;
  border-radius: 2px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
  font-family: 'Oswald', sans-serif;
}
.is-admin-mode [data-i18n]:hover::before { opacity: 1; }

/* 4. Link & News Editable Markers */
.is-admin-mode [data-link],
.is-admin-mode .news-card {
  position: relative;
  cursor: pointer !important;
}
.is-admin-mode [data-link]::after,
.is-admin-mode .news-card::after {
  content: '✏️ LINK';
  position: absolute; top: -10px; right: -10px;
  background: var(--surface); color: var(--gold);
  border: 1px solid var(--gold);
  font-size: 10px; font-weight: bold; padding: 4px 8px;
  border-radius: 12px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
  z-index: 10;
}
.is-admin-mode .news-card::after { content: '✏️ EDIT NEWS'; }
.is-admin-mode [data-link]:hover::after,
.is-admin-mode .news-card:hover::after { opacity: 1; }
.is-admin-mode [data-link]:hover,
.is-admin-mode .news-card:hover {
  box-shadow: 0 0 0 2px var(--gold);
  border-radius: 4px;
}

/* Disable pointer events on children of link/news to prevent accidental clicks */
.is-admin-mode [data-link] *,
.is-admin-mode .news-card * {
  pointer-events: none;
}
/* Re-enable for contenteditable inside news if we had them, but we use modal for news */

/* 5. Modals (Link & News Editors) */
.inline-modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.8);
  display: flex; align-items: center; justify-content: center;
  z-index: 10001;
}
.inline-modal__box {
  background: var(--surface);
  padding: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  width: 100%; max-width: 500px;
}
.inline-modal__box h3 { margin-top: 0; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.inline-modal__body { margin: 24px 0; display: flex; flex-direction: column; gap: 16px; }
.inline-modal__actions { display: flex; justify-content: flex-end; gap: 8px; }

/* Form inputs in modal */
.inline-modal input, .inline-modal textarea {
  width: 100%;
  background: var(--base);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px;
  border-radius: 4px;
  font-family: inherit; font-size: 14px;
}
.inline-modal textarea { resize: vertical; min-height: 200px; font-family: monospace; }
.inline-modal label { display: block; font-size: 13px; color: var(--text-sub); margin-bottom: 4px; }
.inline-modal input:focus, .inline-modal textarea:focus { outline: none; border-color: var(--gold); }

/* News specific */
.news-admin-controls {
  margin-top: 16px; text-align: center;
}

/* 6. Image & Video Hover Overlays */
.is-admin-mode [data-img-bind],
.is-admin-mode [data-img-bg-bind] {
  position: relative;
  cursor: pointer !important;
}
.is-admin-mode [data-img-bind]::after,
.is-admin-mode [data-img-bg-bind]::after {
  content: '🖼️ EDIT IMAGE';
  position: absolute; top: 10px; right: 10px;
  background: var(--surface); color: var(--gold);
  border: 1px solid var(--gold);
  font-size: 10px; font-weight: bold; padding: 4px 8px;
  border-radius: 12px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
  z-index: 10;
}
.is-admin-mode [data-img-bind]:hover::after,
.is-admin-mode [data-img-bg-bind]:hover::after { opacity: 1; }
.is-admin-mode [data-img-bind]:hover,
.is-admin-mode [data-img-bg-bind]:hover {
  box-shadow: inset 0 0 0 2px var(--gold);
}

.is-admin-mode .video-overlay {
  position: absolute; inset: 0;
  background: rgba(201, 150, 12, 0.2);
  display: flex; align-items: center; justify-content: center;
  z-index: 20; cursor: pointer;
  border: 2px dashed var(--gold);
  border-radius: 6px;
  opacity: 0; transition: opacity 0.2s;
}
.is-admin-mode .video-overlay::after {
  content: '🎥 EDIT YOUTUBE URL';
  background: var(--gold); color: #000;
  padding: 8px 16px; border-radius: 4px;
  font-weight: bold; font-size: 12px;
}
.is-admin-mode .video-overlay:hover { opacity: 1; }

/* 7. Buttons Array Hover */
.is-admin-mode .dynamic-btn-container {
  position: relative;
  border: 2px dashed transparent;
  padding: 8px; border-radius: 8px;
  transition: border-color 0.2s;
  cursor: pointer;
}
.is-admin-mode .dynamic-btn-container:hover {
  border-color: var(--gold);
  background: rgba(201, 150, 12, 0.05);
}
.is-admin-mode .dynamic-btn-container::before {
  content: '⚙️ EDIT BUTTONS';
  position: absolute; top: -14px; left: 10px;
  background: var(--gold); color: #000;
  font-size: 10px; font-weight: 700; padding: 2px 6px;
  border-radius: 2px;
  opacity: 0; transition: opacity 0.2s;
}
.is-admin-mode .dynamic-btn-container:hover::before { opacity: 1; }
.is-admin-mode .dynamic-btn-container * { pointer-events: none; }

/* Toast override */
#toast { z-index: 10005; }
