/* ============================================
   Webysysel — editor UI (site-agnostic)
   Definuje pouze editor chrome: lištu, modaly, rámečky editovatelných prvků,
   × tlačítka na obrázcích a list add/remove.
   Layout a rozměry fotoslotů si určuje konkrétní web ve své styles.css.
   ============================================ */

/* ---------- Spodní lišta ---------- */
.editor-bar {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  background: #0f1e3c;
  color: #fff;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  font: 500 14px/1 Inter, system-ui, sans-serif;
  max-width: calc(100vw - 24px);
}
.editor-bar .eb-status { opacity: .85; padding: 0 6px; }
.editor-bar > button {
  border: 0;
  padding: 8px 14px;
  border-radius: 999px;
  font: inherit;
  cursor: pointer;
}
.editor-bar .eb-save { background: #d4a25c; color: #0f1e3c; font-weight: 600; }
.editor-bar .eb-save:disabled { opacity: .5; cursor: default; }
.editor-bar .eb-logout { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.3); }

/* Formátovací panel */
.editor-bar .eb-format {
  display: flex;
  gap: 4px;
  padding-right: 10px;
  border-right: 1px solid rgba(255,255,255,.2);
  align-items: center;
}
.editor-bar .eb-format button {
  background: rgba(255,255,255,.1);
  color: #fff;
  border: 0;
  padding: 6px 9px;
  min-width: 30px;
  border-radius: 6px;
  cursor: pointer;
  font: 500 13px Inter, sans-serif;
}
.editor-bar .eb-format button:hover { background: rgba(255,255,255,.2); }
.editor-bar .eb-format button b { font-weight: 800; }
.editor-bar .eb-format .eb-size {
  background: #fff;
  color: #0f1e3c;
  border: 0;
  padding: 6px 8px;
  border-radius: 6px;
  font: 500 13px Inter, sans-serif;
  cursor: pointer;
}
.editor-bar .eb-format .eb-size option { background: #fff; color: #0f1e3c; }

/* ---------- Označení editovatelných textů ---------- */
body.editor-on [data-edit] {
  outline: 2px dashed rgba(212,162,92,.7);
  outline-offset: 3px;
  cursor: text;
  min-height: 1em;
  transition: outline-color .15s;
}
body.editor-on [data-edit]:hover,
body.editor-on [data-edit]:focus {
  outline-color: #d4a25c;
  outline-style: solid;
}

/* ---------- Fotosloty ---------- */
body.editor-on [data-img] {
  outline: 2px dashed rgba(15,30,60,.5);
  outline-offset: 3px;
  cursor: pointer;
  position: relative;
  transition: outline-color .15s;
}
body.editor-on [data-img]:hover { outline-color: #0f1e3c; outline-style: solid; }
body.editor-on [data-img]::before {
  content: "📷 Kliknutím vyměnit";
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  background: rgba(15,30,60,.85);
  color: #fff;
  font: 500 12px/1.3 Inter, sans-serif;
  padding: 5px 10px;
  border-radius: 999px;
  pointer-events: none;
  white-space: nowrap;
  z-index: 2;
}

/* IMG tag — wrap pro × tlačítko. Rozměry řídí konkrétní web. */
.img-slot-wrap {
  position: relative;
  display: block;
  max-width: 100%;
}
.img-slot-wrap > img[data-img] {
  display: block;
  width: 100%;
  margin: 0;
}

/* × tlačítko na obrázku */
.img-remove-btn { display: none; }
body.editor-on .img-remove-btn {
  display: flex;
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  background: #c0392b;
  color: #fff;
  border: 0;
  border-radius: 50%;
  font: 700 18px/1 sans-serif;
  cursor: pointer;
  z-index: 3;
  box-shadow: 0 2px 6px rgba(0,0,0,.3);
}
body.editor-on .img-remove-btn:hover { background: #a5281c; }

/* ---------- Dynamické seznamy ---------- */
.list-add-btn { display: none; }
body.editor-on .list-add-btn {
  display: block;
  margin: 20px auto;
  padding: 10px 20px;
  background: #0f1e3c;
  color: #fff;
  border: 0;
  border-radius: 999px;
  font: 500 14px Inter, sans-serif;
  cursor: pointer;
}
body.editor-on .list-add-btn:hover { background: #1a2d57; }

body.editor-on [data-list] { position: relative; }
body.editor-on [data-list-item]:not([data-list-item="original"]) {
  position: relative;
  outline: 2px dashed rgba(192,57,43,.25);
  outline-offset: 6px;
  border-radius: 8px;
}

.list-remove-btn { display: none; }
body.editor-on .list-remove-btn {
  display: inline-block;
  position: absolute;
  top: -14px;
  right: -4px;
  padding: 6px 12px;
  background: #c0392b;
  color: #fff;
  border: 0;
  border-radius: 999px;
  font: 500 12px Inter, sans-serif;
  cursor: pointer;
  z-index: 4;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
body.editor-on .list-remove-btn:hover { background: #a5281c; }

/* ---------- Login modal ---------- */
.editor-login {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(15,30,60,.6);
  display: flex; align-items: center; justify-content: center;
}
.editor-login form {
  background: #fff; padding: 24px; border-radius: 14px;
  width: min(340px, 90vw);
  box-shadow: 0 20px 50px rgba(0,0,0,.3);
  display: flex; flex-direction: column; gap: 12px;
  font-family: Inter, system-ui, sans-serif;
}
.editor-login h3 { margin: 0; color: #0f1e3c; }
.editor-login input {
  padding: 10px 12px; border: 1px solid #ccd3df;
  border-radius: 8px; font: inherit;
}
.editor-login .el-actions { display: flex; gap: 8px; justify-content: flex-end; }
.editor-login button {
  padding: 9px 16px; border-radius: 8px; border: 0;
  font: 500 14px Inter, sans-serif; cursor: pointer;
}
.editor-login .el-cancel { background: #eee; }
.editor-login .el-submit { background: #0f1e3c; color: #fff; }
.editor-login .el-error { color: #c0392b; font-size: 13px; min-height: 1em; }

/* ---------- Toast ---------- */
.editor-toast {
  position: fixed; top: 20px; left: 50%;
  transform: translateX(-50%); z-index: 10001;
  background: #0f1e3c; color: #fff;
  padding: 10px 18px; border-radius: 999px;
  font: 500 14px Inter, sans-serif;
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
  animation: editor-toast-in .2s ease;
}
.editor-toast.is-error { background: #c0392b; }
.editor-toast.is-ok    { background: #2e7d32; }
@keyframes editor-toast-in {
  from { opacity: 0; transform: translate(-50%, -10px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ---------- Mobile responsiveness ---------- */
@media (max-width: 720px) {
  .editor-bar {
    bottom: 8px;
    padding: 8px 10px;
    gap: 6px;
    font-size: 12px;
    border-radius: 12px;
    max-width: calc(100vw - 16px);
    justify-content: center;
  }
  .editor-bar .eb-status {
    flex: 0 0 100%;
    text-align: center;
    padding: 0 4px 4px;
    font-size: 11px;
    order: -1;
  }
  .editor-bar > button {
    padding: 7px 12px;
    font-size: 12px;
    border-radius: 8px;
  }
  .editor-bar .eb-format {
    padding-right: 6px;
    gap: 3px;
    flex-wrap: wrap;
  }
  .editor-bar .eb-format button {
    padding: 5px 8px;
    min-width: 28px;
    font-size: 12px;
  }
  .editor-bar .eb-format .eb-size {
    padding: 5px 6px;
    font-size: 12px;
    max-width: 110px;
  }

  body.editor-on [data-edit],
  body.editor-on [data-img] {
    outline-offset: 2px;
  }
  body.editor-on [data-img]::before {
    font-size: 10px;
    padding: 4px 8px;
    bottom: 6px;
  }

  .editor-login form {
    padding: 18px;
    gap: 10px;
  }
  .editor-login h3 { font-size: 1.1rem; }

  .editor-toast {
    top: 12px;
    font-size: 13px;
    padding: 8px 14px;
    max-width: calc(100vw - 24px);
    text-align: center;
  }

  .list-add-btn,
  body.editor-on .list-add-btn {
    font-size: 13px;
    padding: 9px 16px;
  }
  body.editor-on .list-remove-btn {
    font-size: 11px;
    padding: 5px 10px;
    top: -12px;
  }
}

@media (max-width: 480px) {
  .editor-bar {
    left: 8px;
    right: 8px;
    transform: none;
    max-width: none;
  }
}
