/* ============================================================
   WAYRA — INLINE CMS · UI
   ============================================================ */

/* editable hint — visible only in edit mode */
.cms-edit [data-cms-id] {
  outline: 1px dashed rgba(255, 107, 100, 0.55);
  outline-offset: 3px;
  cursor: text;
  transition: outline-color .15s ease, background-color .15s ease;
}
.cms-edit [data-cms-id]:hover {
  outline: 1px solid var(--accent);
  outline-offset: 3px;
}
.cms-edit [data-cms-id]:focus {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  background-color: rgba(255, 107, 100, 0.08);
  border-radius: 2px;
}

/* images get a different affordance — they're not text */
.cms-edit img[data-cms-id] {
  cursor: pointer;
  outline: 2px solid rgba(255, 107, 100, 0.55);
  outline-offset: 4px;
}
.cms-edit img[data-cms-id]:hover {
  outline-color: var(--accent);
  filter: brightness(1.05);
}

.cms-edit { cursor: default; }

/* keep the panel reveal-animation neutral during edit mode  */
.cms-edit .panel > * { transition: none; opacity: 1; transform: none; }

/* ============== floating toolbar ============== */
#cms-bar {
  position: fixed;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: #0A0A0A;
  color: #ECECEC;
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border-radius: 6px;
  box-shadow:
    0 24px 48px -12px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset;
  user-select: none;
  animation: cmsBarIn .3s cubic-bezier(.16, 1, .3, 1);
  max-width: 92vw;
  flex-wrap: wrap;
  justify-content: center;
}
@keyframes cmsBarIn {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
#cms-bar .cms-bar__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #FF6B64; flex: 0 0 auto;
  animation: cmsPulse 1.4s ease-in-out infinite;
}
@keyframes cmsPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(1.45); }
}
#cms-bar .cms-bar__title { font-weight: 700; color: #fff; }
#cms-bar .cms-bar__info  { color: rgba(255, 255, 255, 0.55); padding: 0 8px; min-width: 200px; }
#cms-bar button {
  background: transparent; color: inherit;
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 6px 10px;
  font: inherit; letter-spacing: 0.18em;
  cursor: pointer;
  border-radius: 3px;
  transition: border-color .15s, color .15s, background-color .15s;
}
#cms-bar button:hover  { border-color: #FF6B64; color: #FF6B64; }
#cms-bar button:active { background: rgba(255, 107, 100, 0.12); }

/* ============== image-edit modal ============== */
.cms-modal {
  position: fixed; inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.72);
  display: grid;
  place-items: center;
  padding: 24px;
  animation: cmsModalIn .2s ease;
}
@keyframes cmsModalIn { from { opacity: 0 } to { opacity: 1 } }

.cms-modal__panel {
  background: #0A0A0A;
  color: #ECECEC;
  width: min(560px, 100%);
  max-height: 88vh;
  overflow: auto;
  border-radius: 6px;
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  box-shadow: 0 30px 80px -10px rgba(0, 0, 0, .65);
  display: flex;
  flex-direction: column;
}
.cms-modal__panel header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.cms-modal__id {
  color: rgba(255, 255, 255, 0.55);
  font-weight: 700;
}
.cms-modal__panel header button[data-x] {
  background: transparent;
  color: #ECECEC;
  border: 1px solid rgba(255, 255, 255, 0.22);
  width: 28px; height: 28px;
  cursor: pointer;
  border-radius: 3px;
}
.cms-modal__panel header button[data-x]:hover { color: #FF6B64; border-color: #FF6B64; }

.cms-modal__preview {
  margin: 16px;
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  max-height: 240px;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.cms-modal__preview img {
  max-width: 100%; max-height: 240px;
  display: block;
  object-fit: contain;
}

.cms-modal__row {
  padding: 0 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cms-modal__row label {
  display: flex; flex-direction: column; gap: 6px;
}
.cms-modal__row label span {
  color: rgba(255, 255, 255, 0.55);
  font-size: 10px;
}
.cms-modal__row input[type="file"],
.cms-modal__row input[type="url"] {
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ECECEC;
  padding: 8px 10px;
  font: inherit;
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0.02em;
  border-radius: 3px;
  outline: none;
}
.cms-modal__row input[type="url"]:focus {
  border-color: #FF6B64;
}
.cms-modal__row button {
  background: #FF6B64;
  color: #0A0A0A;
  border: 0;
  padding: 8px 12px;
  font: inherit;
  letter-spacing: 0.18em;
  cursor: pointer;
  border-radius: 3px;
  align-self: flex-start;
}
.cms-modal__row button:hover { filter: brightness(0.9); }

.cms-modal__panel footer {
  display: flex; gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  justify-content: space-between;
}
.cms-modal__panel footer button {
  background: transparent;
  color: #ECECEC;
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 8px 12px;
  font: inherit;
  letter-spacing: 0.18em;
  cursor: pointer;
  border-radius: 3px;
}
.cms-modal__panel footer button:hover { border-color: #FF6B64; color: #FF6B64; }

.cms-modal__status {
  padding: 0 16px 14px;
  color: rgba(255, 255, 255, 0.55);
  min-height: 16px;
  font-size: 10.5px;
}
.cms-modal__status.is-err { color: #FF6B64; }

/* small viewports */
@media (max-width: 720px) {
  #cms-bar {
    bottom: 60px;
    font-size: 9.5px;
    padding: 8px 10px;
    gap: 8px;
  }
  #cms-bar .cms-bar__info { display: none; }
}
