/* ==========================================================================
   ARCHIVO: css/ui.css
   DESCRIPCION: Estilos de interfaz pixelada: menu superior, panel lateral
                izquierdo de secciones, editor inferior y ajustes responsive.

   INDICE:
   1. Barra superior y botones de navegacion (#top-bar, #main-menu, .menu-btn)
   2. Panel lateral izquierdo de secciones (#section-panel, .panel-header, .panel-list)
   3. Barra inferior del editor de mundo (#bottom-bar, .control-group, .world-btn)
   4. Ajustes de diseno adaptable en pantallas estrechas (@media)
   ========================================================================== */

/* 1. Barra superior y botones de navegacion (#top-bar, #main-menu, .menu-btn)
   Situa los cuatro botones de seccion en una fila ochentera de alto contraste. */
#top-bar {
  position: relative;
  z-index: 10;
  background: #1b1e26;
  border-bottom: 4px solid #0d0f14;
  padding: 10px 14px;
}

#main-menu {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.menu-btn {
  padding: 8px 14px;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: #2b303c;
  color: #f8f9fa;
  border: 2px solid #f8f9fa;
  box-shadow: 3px 3px 0 #0d0f14;
  transition: transform 0.08s steps(2), background-color 0.12s steps(2);
}

.menu-btn:hover {
  background: #3d4454;
}

.menu-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 #0d0f14;
}

/* 2. Panel lateral izquierdo de secciones (#section-panel, .panel-header, .panel-list)
   Situa la ventana en la parte izquierda con mayor amplitud para dejar libre
   la zona derecha donde aparece el personaje. */
#section-panel {
  position: absolute;
  top: 16px;
  left: 16px;
  bottom: 16px;
  right: auto;
  transform: none;
  z-index: 20;
  width: min(640px, 60%);
  max-height: none;
  overflow-y: auto;
  background: #181b22;
  color: #f8f9fa;
  border: 4px solid #f8f9fa;
  box-shadow: 6px 6px 0 #0d0f14;
  padding: 18px;
}

#section-panel.is-hidden {
  display: none;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  margin-bottom: 14px;
  border-bottom: 2px solid #394052;
}

#panel-title {
  margin: 0;
  font-size: 1.15rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #ffd166;
}

#close-panel {
  width: 32px;
  height: 32px;
  font-weight: 700;
  background: #c92a2a;
  color: #ffffff;
  border: 2px solid #f8f9fa;
  box-shadow: 2px 2px 0 #0d0f14;
}

#close-panel:hover {
  background: #e03131;
}

#panel-body {
  font-size: 0.95rem;
  line-height: 1.55;
}

.panel-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 10px;
}

.panel-list li {
  padding-left: 4px;
}

/* 3. Barra inferior del editor de mundo (#bottom-bar, .control-group, .world-btn)
   Agrupa los botones de Terreno y Cielo y destaca el estado activo. */
#bottom-bar {
  position: relative;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  background: #1b1e26;
  border-top: 4px solid #0d0f14;
  padding: 10px 14px;
}

.control-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.control-label {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #adb5bd;
  margin-right: 4px;
}

.control-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.world-btn {
  padding: 6px 10px;
  font-size: 0.8rem;
  font-weight: 700;
  background: #2b303c;
  color: #e9ecef;
  border: 2px solid #6c757d;
  box-shadow: 2px 2px 0 #0d0f14;
}

.world-btn:hover {
  border-color: #f8f9fa;
}

.world-btn.is-active {
  background: #ffd166;
  color: #111318;
  border-color: #ffffff;
}

/* 4. Ajustes de diseno adaptable en pantallas estrechas (@media)
   Compacta margenes, posicion del panel y tamanos en telefonos o ventanas estrechas. */
@media (max-width: 768px) {
  #section-panel {
    top: 12px;
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
    padding: 14px;
  }
}

@media (max-width: 640px) {
  #top-bar,
  #bottom-bar {
    padding: 8px 10px;
  }

  .menu-btn {
    padding: 6px 10px;
    font-size: 0.78rem;
  }

  #bottom-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .control-group {
    justify-content: space-between;
  }

  .world-btn {
    padding: 5px 8px;
    font-size: 0.75rem;
  }
}
