/* ======================================================
   EDITOR STYLE — editor.css
   Estilos del editor de mapa y sus herramientas
====================================================== */

/* Toolbar superior izquierda */
.map-editor-toolbar {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 950;
  display:flex;
  gap:8px;
  background: var(--panel-bg);
  padding:8px;
  border-radius:8px;
  box-shadow: var(--shadow);
}

/* Botones de herramienta */
.tool-btn {
  width:40px;
  height:40px;
  background: var(--glass);
  border-radius:8px;
  border:1px solid rgba(255,255,255,0.05);
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}
.tool-btn.active{
  border-color:var(--accent);
  box-shadow:0 0 12px rgba(125,211,252,0.5);
}

/* Paleta de objetos */
#objectPalette {
  display:none; /* Paleta lateral deshabilitada */
}

#objectPalette input {
  width:100%;
  margin-bottom:8px;
}

#objectPalette .palette-item {
  display:flex;
  align-items:center;
  gap:8px;
  padding:4px;
  cursor:pointer;
  border-radius:6px;
  transition: background .12s ease;
}
#objectPalette .palette-item:hover {
  background: rgba(255,255,255,0.08);
}

#objectPalette img {
  width:32px;
  height:32px;
}

/* Brush preview */
.brush-preview {
  position:absolute;
  pointer-events:none;
  border:2px dashed var(--accent);
  background: rgba(125,211,252,0.1);
  border-radius:4px;
}

/* Rectangulo de selección */
.rect-preview {
  position:absolute;
  pointer-events:none;
  border:2px dashed rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.05);
}

/* Editor panel izquierdo */
#mapEditorPanel {
  position: fixed;
  left:12px;
  top:12px;
  width:320px;
  max-height:82vh;
  overflow:hidden;
  background: linear-gradient(145deg, rgba(22,27,36,0.92), rgba(26,33,44,0.92));
  padding:12px;
  border-radius:12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.45);
  z-index:950;
  display:none;
}

#mapEditorPanel.open {
  display:block;
}

.map-editor-header {
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:10px;
  margin-bottom:12px;
}
.map-editor-actions {
  display:flex;
  flex-direction:column;
  gap:8px;
  margin-bottom:12px;
}
.map-editor-buttons {
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.map-editor-actions input {
  padding:8px 10px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  outline:none;
}
.map-editor-actions input:focus {
  border-color: var(--accent);
  box-shadow:0 0 0 3px rgba(125,211,252,0.2);
}
.map-editor-flex {
  display:flex;
  gap:8px;
  margin-bottom:12px;
}
.map-editor-folders {
  width:130px;
  display:flex;
  flex-direction:column;
  gap:8px;
  padding:8px;
  border-radius:10px;
  background: rgba(255,255,255,0.03);
  border:1px solid rgba(255,255,255,0.05);
  overflow:auto;
}
.map-editor-folders button {
  width:100%;
  text-align:left;
  border-radius:8px;
  padding:8px;
  border:1px solid rgba(255,255,255,0.05);
  background: rgba(255,255,255,0.03);
  transition:all .12s ease;
}
.map-editor-folder .folder-row {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:8px;
}
.map-editor-folder .folder-name {
  display:flex;
  flex-direction:column;
  gap:2px;
}
.map-editor-folder .folder-parent {
  font-size:11px;
  letter-spacing:0.02em;
  color: rgba(255,255,255,0.55);
  text-transform:uppercase;
}
.map-editor-folder .folder-leaf {
  font-weight:600;
}
.map-editor-folder .folder-count {
  font-size:12px;
  padding:3px 6px;
  border-radius:6px;
  background: rgba(255,255,255,0.08);
  border:1px solid rgba(255,255,255,0.08);
}
.map-editor-folders button:hover {
  border-color: rgba(125,211,252,0.35);
  transform:translateY(-1px);
}
.map-editor-folders button.active {
  border-color: var(--accent);
  box-shadow:0 0 0 2px rgba(125,211,252,0.25);
  background: rgba(125,211,252,0.08);
}
.map-editor-images {
  flex:1;
  max-height:240px;
  overflow:auto;
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(90px,1fr));
  gap:8px;
  padding:4px;
}
.map-editor-item {
  background: rgba(255,255,255,0.04);
  border:1px solid rgba(255,255,255,0.06);
  border-radius:10px;
  padding:8px;
  cursor:pointer;
  text-align:center;
  font-size:12px;
  transition:all .12s ease;
}
.map-editor-item img {
  width:100%;
  height:70px;
  object-fit:contain;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.25));
}
.map-editor-item:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.12);
  transform:translateY(-1px);
}
.map-editor-item-name {
  font-weight:600;
}
.map-editor-item-path {
  font-size:11px;
  color: rgba(255,255,255,0.6);
  margin-top:4px;
}
.map-editor-config {
  display:flex;
  flex-direction:column;
  gap:10px;
  padding:10px;
  border-radius:10px;
  background: rgba(255,255,255,0.03);
  border:1px solid rgba(255,255,255,0.05);
}
.map-editor-config .field {
  display:flex;
  flex-direction:column;
  gap:4px;
}
.map-editor-config .field.grid {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:6px;
}
.map-editor-config label.checkbox {
  display:flex;
  align-items:center;
  gap:6px;
}
.map-editor-config.pulse {
  animation: pulse 0.6s ease-in-out 0s 2;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0px rgba(125,211,252,0.0); }
  50% { box-shadow: 0 0 12px rgba(125,211,252,0.6); }
  100% { box-shadow: 0 0 0px rgba(125,211,252,0.0); }
}

/* Trade modal styles */
#tradeModal {
  max-width: 720px;
  width: 92%;
}
.trade-header {
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:10px;
  margin-bottom:12px;
}
.trade-title { font-weight:700; font-size:18px; }
.trade-subtitle { font-size:12px; color:rgba(255,255,255,0.7); }
.trade-status { font-size:13px; margin-top:4px; color:var(--accent); }
.trade-players {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
  margin-bottom:10px;
}
.trade-col {
  background:rgba(255,255,255,0.04);
  border:1px solid rgba(255,255,255,0.06);
  padding:10px;
  border-radius:10px;
}
.trade-player-name { font-weight:700; margin-bottom:8px; }
.trade-slots {
  display:grid;
  grid-template-columns:repeat(3, 1fr);
  gap:8px;
  margin-bottom:10px;
}
.trade-slot {
  border:1px dashed rgba(255,255,255,0.2);
  border-radius:8px;
  padding:8px;
  text-align:center;
  min-height:40px;
  cursor:pointer;
  font-size:12px;
}
.trade-slot.filled {
  background:rgba(255,255,255,0.06);
  border-style:solid;
}
.trade-slot-name {
  font-weight:600;
  line-height:1.3;
}
.trade-help { font-size:12px; color:rgba(255,255,255,0.7); margin-bottom:8px; }
.trade-actions { display:flex; justify-content:flex-end; gap:8px; }
.btn.small.primary { background:var(--accent); color:#000; }

.trade-request {
  position:fixed;
  right:12px;
  top:80px;
  width:240px;
  background:rgba(0,0,0,0.7);
  border:1px solid rgba(255,255,255,0.15);
  border-radius:10px;
  padding:10px;
  box-shadow:0 10px 30px rgba(0,0,0,0.4);
  z-index:1500;
}
.trade-request.hidden { display:none; }
.trade-request-title { font-weight:700; margin-bottom:6px; }
.trade-request-actions { display:flex; gap:6px; justify-content:flex-end; margin-top:8px; }
