/* APP */

.app {
  position: relative;
  overflow: hidden;
  padding-top: 0px;
  display: flex;
  height: 100vh;
  width: 100%;
}

/* ==================== BARRA LATERAL ==================== */
.barra1 {
  background-color: var(--bg-submain);
  position: fixed;
  height: calc(100% - var(--h-sistem_bar));
  width: 48px;
  top: var(--h-sistem_bar);
  left: 0px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 0.5rem;
  border-radius: 1px;
  border: 1px solid var(--border);
  user-select: none;
  color: var(--text-secondary);
}


/* ==================== BOTONES DE LA BARRA ==================== */
.barra1 .btn {
  position: relative;
  /* referencia para tooltip */
  width: 39px;
  height: 39px;
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  color: var(--text-secondary);
}

.barra1 .btn- {
  position: relative;
  /* referencia para tooltip */
  width: 39px;
  height: 39px;
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  color: var(--text-secondary);
}

/* Empuja el penúltimo botón al fondo */

.barra1 .btn:nth-last-child(2) {
  margin-top: auto;
}

/* Imágenes dentro de los botones */

.barra1 .btn img {
  width: 35px;
  height: 35px;
  user-select: none;
}

.barra1 .btn- img {
  width: 35px;
  height: 35px;
  user-select: none;
}

/*Btn especiales*/

#Cuenta {
  margin-top: auto;
  margin-bottom: 0.5rem;
}

#Ajustes {
  margin-bottom: 0.5rem;
}

/* ==================== TOOLTIPS estilo VS Code ==================== */
.barra1 .btn::after,
.btn-::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50px;
  /* al lado del botón */
  top: 50%;
  transform: translateY(-50%) translateX(-6px);
  background: var(--bg-submain);
  color: var(--text-tooltips);
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 3px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.1s ease,
    transform 0.1s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  z-index: 10;
}

.barra1 .btn::before,
.btn-::before {
  content: "";
  position: absolute;
  left: 44px;
  /* borde del botón */
  top: 50%;
  transform: translateY(-50%) translateX(-6px);
  border-width: 5px;
  border-style: solid;
  border-color: transparent #252526 transparent transparent;
  opacity: 0;
  transition:
    opacity 0.1s ease,
    transform 0.1s ease;
  z-index: 10;
}

.barra1 .btn:hover::after,
.barra1 .btn:hover::before {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
  z-index: 10;
}

.barra1 .btn-:hover::after,
.barra1 .btn-:hover::before {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
  z-index: 10;
}


.btn.panel-activo {
  border-left: 2px solid rgb(36, 85, 134);
}

/*==================== BARRA SUPERIOR (Barra 2) =====================*/
.barra2 {
  background-color: var(--bg-submain);
  position: fixed;
  height: 3rem;
  width: calc(100% - 48px);
  top: var(--h-sistem_bar);
  left: 48px;
  z-index: 1;
  border-radius: 1px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1rem;
  gap: 1rem;
  box-sizing: border-box;
  user-select: none;
}

/* Botones de la barra superior */
.BT1,
.BT2,
.BT3,
.BT4,
.BT5,
.BT6 {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: bold;
  cursor: pointer;
  flex-shrink: 0;
  user-select: none;
}

/* Buscador */
#BuscadorInput {
  color: #727272;
  background-color: var(--bg-main);
  border-radius: 0.2rem;
  border: 1px solid var(--border);
  height: 1.5rem;
  width: 15rem;
  background-position: left;
  background-repeat: no-repeat;
  background-size: 1.2rem;
  background-image: url("img/Busqueda.svg");
  padding-left: 1.2rem;
  box-sizing: border-box;
}

#btn2:hover {
  transform: scale(1.005);
  box-shadow: 0 2px 8px rgba(32, 32, 32, 0.4);
}

/*=============================== Barra de información del código =================================*/
.InfoDelCodigo {
  display: none;
  align-items: center;
  gap: 1rem;
  /* espacio uniforme */
  margin-top: 1.5rem;
  margin-bottom: 1.8rem;
  width: 100%;
  height: 3rem;
  border-radius: 0;
  margin-left: 0;
  font-size: var(--fs-small);
  color: var(--text-secondary);
}

/* Contenedor principal */
.main-content {
  display: flex;
  flex-direction: row;
}

/* Bloques de errores y advertencias */
.NºErrores,
.NºAdvertencias {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Iconos */
.svg9,
.svg10 {
  height: 1rem;
  width: 1rem;
  user-select: none;
}

/*---- Líneas y columnas ----*/
.LinCol {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/*---- codificación (lado derecho) ----*/
.codificacion {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-items: center;
  margin-left: auto;
}

.TxtCod,
.TxtTCod {
  margin: 0%;
  text-align: center;
}

/*========================== BARRA DE PESTAÑAS (Barra 3) ============================*/
.barra3 {
  position: fixed;
  top: calc(3.5rem + var(--h-sistem_bar));
  left: 56px;
  width: calc(100% - 64px);
  height: var(--h-barra2);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  user-select: none;
  background-color: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: 1px;
  padding: 0;
  z-index: 1;
}

.margen1,
.margen2 {
  height: calc(var(--h-barra2) - 1px);
  width: var(--h-barra2);
  background-color: var(--border);
  border-radius: 1px;
  user-select: none;
  z-index: 0;
}

.margen2 {
  margin-left: auto;
}

.limpiar-pestaña,
.crear-pestaña {
  height: calc(var(--h-barra2) - 2px);
  width: 1rem;
  border: 1px solid var(--border);
  margin-top: -1px;
  z-index: 0;
  background-size: contain;
  cursor: pointer;
  background-repeat: no-repeat;
  background-position: center;
  user-select: none;
}

.crear-pestaña {
  background-image: url("img/Create.svg");
}

.limpiar-pestaña {
  background-image: url("img/Clear.svg");
}

.pestaña {
  height: calc(var(--h-barra2) - 2px);
  min-width: 108px;
  max-width: auto;
  padding: 0 0.5rem;
  margin-top: -1px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 10px;
  flex-direction: row;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  z-index: 1;
  user-select: none;
}

.pestaña:not(.activa) {
  cursor: pointer;
}

.pestaña.activa {
  background-color: #2d2d2d;
  position: relative;
  border-top: 1px solid rgb(36, 85, 134);
}

/* Pestaña cuyo data-tipo sea "editor" */
.pestaña[data-tipo="editor"] {
  justify-content: space-between;
  font-size: min(11px);
}


.BtnPestaña {
  height: calc(var(--h-barra2) - 2px);
  width: 1rem;
  background-size: contain;
  background-repeat: no-repeat;
  background-image: url("img/Clear.svg");
  background-position: center;
  user-select: none;
  margin-right: 0.2rem;
  cursor: pointer;
}

.iconoNPestaña {
  height: calc(var(--h-barra2) - 2px);
  width: 1rem;
  background-size: contain;
  background-repeat: no-repeat;
  background-image: url("img/Icon.png");
  background-position: center;
  user-select: none;
  margin-left: 0.5rem;
}

/*===================== Visualizacion =====================*/
.caja-visualizacion {
  position: fixed;
  top: calc(3.5rem + var(--h-barra2) + 8px + var(--h-sistem_bar));
  left: 56px;
  right: 8px;
  bottom: 8px;
  display: flex;
  overflow: auto;
  background-color: transparent;
  background-image: url("img/background-info.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  border: 1px solid var(--border);
  border-radius: 4px;
  box-sizing: border-box;
  z-index: 0;
}


.visualizador {
  position: absolute;
  width: 100%;
  height: 100%;
  display: none;
  box-sizing: border-box;
  z-index: 2;
  border-radius: 4px;
}

[id^="vis-editor"] {
  flex-direction: column;
}

.editor {
  width: 100%;
  height: 100%;
  min-height: 0;
  background-color: var(--bg-submain);
}

/*====================== Barra 4 =========================*/
.barra4 {
  position: fixed;
  left: 52px;
  top: calc(2px + (2*var(--h-barra2)));
  bottom: 2px;
  min-width: 17.5rem;
  max-width: 70%;
  display: none;
  box-sizing: border-box;
  background-color: var(--bg-submain);
  border: 1px solid var(--border);
  border-radius: 1px;
  z-index: 1;
  user-select: none;
  color: var(--text-secondary);
}


.w-bar {
  position: absolute;
  height: 100%;
  width: 6px;
  background-color: var(--border);
  margin-top: 0%;
  margin-left: calc(100% - 4px);
  border-radius: 1px;
  cursor: ew-resize;
}

.w-bar:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  transform: scaleX(1.1);
}

/*Btn 1*/
.func-btn1 {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  background: transparent;
  box-sizing: border-box;
  z-index: 1;
  flex-direction: column;
}

.tit-btn1 {
  margin: 10px 0;
  text-align: center;
}

.btn1-c {
  display: flex;
  flex-direction: column;
}

.p-btn1 {
  margin: 3px;
  text-align: left;
}

.lin-barra4 .txt-adv {
  font-size: var(--fs-small);
  opacity: 0;

  height: 1.2rem;

  margin-top: 0.5rem;
  transition: opacity 0.3s ease;
}

.func-btn1:hover .txt-adv {
  opacity: 1;
}

.y {
  width: 1rem;
  height: 1rem;
  margin-left: auto;
  margin-right: 7px;
  background-size: contain;
  background-image: url(img/Flecha-abajo.svg);
  background-repeat: no-repeat;
  background-position: center;
  cursor: pointer;
}

.y:hover {
  transform: scale(1.1);
}

.c-btn1 {
  display: flex;
  flex-direction: row;
}

.txt-adv {
  font-size: var(--fs-small);
  display: none;
  margin-top: 5px;
  margin-left: 0;
}

button.txt-adv {
  z-index: 1;
}

#btn1-open {
  display: none;
  width: 130px;
  margin-left: 14px;
  margin-bottom: 4px;
}


/*==================== MEDIA QUERIES =====================*/
@media screen and (max-width: 768px) {
  .barra2 {
    flex-wrap: wrap;
    height: auto;
    padding: 0.5rem;
    width: calc(100% - 48px);
    left: 48px;
  }

  .BT1,
  .BT2,
  .BT3,
  .BT4,
  .BT5,
  .BT6 {
    font-size: 0.9rem;
  }

  #BuscadorInput {
    width: 12rem;
    height: 1.3rem;
    background-size: 1rem;
  }

  .InfoDelCódigo {
    height: 2rem;
    margin-left: 0.5rem;
  }
}

@media screen and (max-width: 480px) {

  .BT1,
  .BT2,
  .BT3,
  .BT4,
  .BT5,
  .BT6 {
    font-size: 0.8rem;
    margin-bottom: 0.3rem;
  }

  #BuscadorInput {
    width: 10rem;
    height: 1.2rem;
    background-size: 0.9rem;
  }

  .InfoDelCódigo {
    height: 3rem;
  }

  .main-content {
    margin-left: 48px;
  }
}




:root {
  --bg-main: #121314;
  --bg-submain: #191919;
  --border: #444;
  --text-tooltips: #b8b8b8;
  --text-secondary: #727272;
  --text-primary: #888888;
  --fs-smallest: 8px;
  --fs-small: 12px;
  --fs-normal: 16px;
  --fs-large: 24px;
  --h-barra2: 1.5rem;
  --h-sistem_bar: 0px;
}

/* 12px detalles 14–16px texto normal 20–24px títulos */
