/* ===========================================================
   AdNexIMG — editor.css
   Fontes do overlay + layout do editor-preset.php
   =========================================================== */

@font-face { font-family: 'Inter';           src: url('../fonts/Inter.ttf') format('truetype'); font-weight: 100 900; }
@font-face { font-family: 'Roboto';          src: url('../fonts/Roboto.ttf') format('truetype'); font-weight: 100 900; }
@font-face { font-family: 'Montserrat';      src: url('../fonts/Montserrat.ttf') format('truetype'); font-weight: 100 900; }
@font-face { font-family: 'Oswald';          src: url('../fonts/Oswald.ttf') format('truetype'); font-weight: 100 900; }
@font-face { font-family: 'Playfair Display'; src: url('../fonts/PlayfairDisplay.ttf') format('truetype'); font-weight: 100 900; }
@font-face { font-family: 'Arimo';           src: url('../fonts/Arimo.ttf') format('truetype'); font-weight: 100 900; }

.editor-container {
  max-width: 1100px;
}

.editor-voltar {
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
}

.editor-voltar:hover {
  color: var(--white);
}

.editor-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-top: 20px;
  flex-wrap: wrap;
}

.editor-principal {
  flex: 1;
  min-width: 320px;
}

.editor-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.editor-toolbar__btn {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-pill);
  padding: 7px 14px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.editor-toolbar__btn:hover {
  border-color: var(--text-tertiary);
  color: var(--white);
}

.editor-toolbar__btn--perigo {
  color: var(--red-live);
  border-color: rgba(255, 92, 92, 0.3);
  margin-left: auto;
}

.editor-canvas-area {
  display: grid;
  grid-template-columns: 20px 1fr;
  grid-template-rows: 20px 1fr;
  width: 100%;
  max-width: 580px;
}

.editor-ruler-corner {
  grid-column: 1;
  grid-row: 1;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-right: none;
  border-bottom: none;
}

.editor-ruler {
  display: block;
  background: #17171f;
}

.editor-ruler--top {
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  height: 20px;
  border: 1px solid var(--card-border);
  border-left: none;
}

.editor-ruler--left {
  grid-column: 1;
  grid-row: 2;
  width: 20px;
  height: 100%;
  border: 1px solid var(--card-border);
  border-top: none;
}

.editor-canvas-wrap {
  grid-column: 2;
  grid-row: 2;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: repeating-conic-gradient(#20202a 0% 25%, #17171f 0% 50%) 50% / 20px 20px;
  border: 1px solid var(--card-border);
  border-radius: 0;
  overflow: hidden;
}

#editor-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: default;
  touch-action: none;
}

.editor-btn-salvar {
  margin-top: 16px;
  width: auto;
  padding: 12px 28px;
}

.editor-painel {
  width: 260px;
  flex-shrink: 0;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  padding: 16px;
}

.editor-painel__titulo {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 14px;
}

.editor-painel__vazio {
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.5;
}

.editor-campo {
  margin-bottom: 14px;
}

.editor-campo label {
  display: block;
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.editor-campo--inline label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.editor-campo textarea,
.editor-campo select {
  width: 100%;
  font-family: var(--font);
  font-size: 12px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 8px;
  resize: vertical;
}

.editor-campo input[type="range"] {
  width: 100%;
  accent-color: var(--gradient-start);
}

.editor-campo input[type="color"] {
  width: 100%;
  height: 32px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  background: none;
  cursor: pointer;
}

.editor-align-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.editor-align-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 0;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.editor-align-btn svg {
  width: 18px;
  height: 18px;
}

.editor-align-btn:hover {
  border-color: var(--gradient-start);
  color: var(--white);
  background: rgba(124, 92, 255, 0.08);
}

.editor-cor-icone-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.editor-cor-icone-row input[type="color"] {
  flex: 1;
}

.editor-cor-icone-row .editor-toolbar__btn {
  white-space: nowrap;
}

.editor-btn-remover {
  width: 100%;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  color: var(--red-live);
  background: rgba(255, 92, 92, 0.08);
  border: 1px solid rgba(255, 92, 92, 0.3);
  border-radius: var(--radius-sm);
  padding: 9px;
  cursor: pointer;
  margin-top: 6px;
}

.editor-btn-remover:hover {
  background: rgba(255, 92, 92, 0.15);
}

/* ===========================================================
   Lista de presets salvos
   =========================================================== */
.editor-presets-lista {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--card-border);
}

.editor-presets-lista__titulo {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 14px;
}

.presets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.preset-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  overflow: hidden;
}

.preset-card__thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  background: #fff;
}

.preset-card__body {
  padding: 8px 10px;
}

.preset-card__nome {
  font-size: 12px;
  font-weight: 500;
  color: var(--white);
  margin: 0 0 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preset-card__acoes {
  display: flex;
  gap: 6px;
}

.preset-card__acoes button {
  flex: 1;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 500;
  border-radius: var(--radius-pill);
  padding: 5px 0;
  cursor: pointer;
  border: 1px solid var(--card-border);
  background: transparent;
  color: var(--text-secondary);
}

.preset-card__acoes button:hover {
  color: var(--white);
  border-color: var(--text-tertiary);
}

.preset-card__acoes .preset-card__excluir {
  color: var(--red-live);
  border-color: rgba(255, 92, 92, 0.3);
}

/* ===========================================================
   Modal simples (nome do preset)
   =========================================================== */
.editor-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.editor-modal.hidden {
  display: none;
}

.editor-modal__box {
  width: 90%;
  max-width: 340px;
  background: #14141c;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  padding: 20px;
}

.editor-modal__titulo {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 12px;
}

.editor-modal__box input[type="text"] {
  width: 100%;
  font-family: var(--font);
  font-size: 13px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 10px;
  box-sizing: border-box;
}

.editor-modal__acoes {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 16px;
}
