/* ------------------------------------------------ */
/* CONVERTME – FŐ LAYOUT */
/* ------------------------------------------------ */

.converter-root {
  position: relative;

  display: flex;

  width: 100%;
  height: 100vh;
}


/* ------------------------------------------------ */
/* KONVERTÁLÓ CÍM */
/* ------------------------------------------------ */

.converter-title {
  position: fixed;

  top: 15px;
  left: 50%;

  transform: translateX(-50%);

  z-index: 500;

  font-size: 26px;
  color: var(--neon);

  text-shadow:
    0 0 6px var(--neon),
    0 0 12px #00aa00;

  white-space: nowrap;
}


/* ------------------------------------------------ */
/* BAL OLDALI SIDEBAR */
/* ------------------------------------------------ */

.sidebar {
  width: 240px;
  height: 100vh;

  flex-shrink: 0;

  box-sizing: border-box;

  background: #000;

  padding: 20px;

  display: flex;
  flex-direction: column;

  gap: 12px;

  border-right: 3px solid var(--neon);

  box-shadow: var(--glow-soft);

  overflow-y: auto;
  overflow-x: hidden;

  scrollbar-width: thin;
  scrollbar-color: var(--neon) #000;
}


/* Chrome / Edge / Opera */

.sidebar::-webkit-scrollbar {
  width: 8px;
}

.sidebar::-webkit-scrollbar-track {
  background: #000;
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--neon);

  border-radius: 10px;

  box-shadow: var(--glow-soft);
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: #00ff00;
}


/* ------------------------------------------------ */
/* SIDEBAR GOMBOK */
/* ------------------------------------------------ */

.mode-btn {
  padding: 12px;

  border: 3px solid var(--neon);

  background: #000;

  color: var(--neon);

  cursor: pointer;

  font-size: 16px;

  border-radius: 8px;

  transition: 0.25s;

  opacity: 0.7;
}

.mode-btn:hover {
  opacity: 1;

  transform: translateX(5px);

  box-shadow: var(--glow-soft);
}


/* ------------------------------------------------ */
/* KÖZÉPSŐ / FŐ TERÜLET */
/* ------------------------------------------------ */

.main-panel {
  position: relative;

  flex: 1;

  min-width: 0;
  height: 100vh;

  display: grid;

  grid-template-columns:
    minmax(190px, 0.7fr)
    minmax(400px, 1.6fr)
    minmax(190px, 0.7fr);

  align-items: center;

  box-sizing: border-box;

  padding-top: 50px;
}


/* ------------------------------------------------ */
/* SEARCH TERÜLET */
/* ------------------------------------------------ */

.search-area {
  position: absolute;

  /*
    A lila jelöléshez igazítva:
    közvetlenül a sidebar mellett,
    a felső részen.
  */

  top: 7px;
  left: 12px;

  width: 330px;

  display: flex;

  justify-content: flex-start;
  align-items: flex-start;

  box-sizing: border-box;

  padding: 0;

  z-index: 20;
}


.search-area .search-container {
  width: 330px;
  max-width: 340px;
}


/* ------------------------------------------------ */
/* KONVERTER KÖZÉPSŐ TERÜLET */
/* ------------------------------------------------ */

.converter-center {
  grid-column: 2;

  width: 100%;
  height: 100%;

  display: flex;

  justify-content: center;
  align-items: center;

  box-sizing: border-box;
}


/* ------------------------------------------------ */
/* KONVERTER PANEL */
/* ------------------------------------------------ */

.panel {
  background: #000;

  padding: 25px 35px;

  border-radius: 12px;

  border: 3px solid var(--neon);

  box-shadow: var(--glow-soft);

  display: none;

  flex-direction: column;

  gap: 15px;

  min-width: 350px;

  box-sizing: border-box;
}

.panel.visible {
  display: flex;
}


/* ------------------------------------------------ */
/* JOBB OLDALI ELŐZMÉNYEK */
/* ------------------------------------------------ */

.history-area {
  grid-column: 3;

  width: 100%;
  height: 100%;

  box-sizing: border-box;

  display: flex;

  justify-content: center;
  align-items: center;

  padding: 20px;
}


/* ------------------------------------------------ */
/* INPUT SOR */
/* ------------------------------------------------ */

.input-row {
  display: flex;

  gap: 10px;
}


/* ------------------------------------------------ */
/* INPUT */
/* ------------------------------------------------ */

input {
  flex: 1;

  padding: 10px;

  background: #000;

  border: 3px solid var(--neon);

  border-radius: 8px;

  color: var(--neon);

  font-size: 18px;

  box-sizing: border-box;
}

input.error {
  border-color: #ff4444;

  box-shadow:
    0 0 20px #ff4444;
}


/* ------------------------------------------------ */
/* MÉRTÉKEGYSÉG SOR */
/* ------------------------------------------------ */

.unit-row {
  margin-top: 20px;

  display: flex;

  justify-content: center;
  align-items: center;

  gap: 60px;
}


/* ------------------------------------------------ */
/* MÉRTÉKEGYSÉG SELECT */
/* ------------------------------------------------ */

.unit-select {
  width: 150px;

  padding: 8px;

  background: #000;

  border: 3px solid var(--neon);

  border-radius: 8px;

  color: var(--neon);

  font-size: 16px;

  box-shadow: var(--glow-soft);
}


/* ------------------------------------------------ */
/* NYÍL */
/* ------------------------------------------------ */

.unit-arrow {
  font-size: 22px;

  color: var(--neon);

  text-shadow: var(--glow-soft);
}


/* ------------------------------------------------ */
/* TOOLTIP / KÉPLET */
/* ------------------------------------------------ */

.tooltip {
  font-size: 13px;

  color: var(--neon);

  min-height: 16px;
}


/* ------------------------------------------------ */
/* EREDMÉNY */
/* ------------------------------------------------ */

.result-box {
  padding: 12px;

  background: #000;

  border: 3px solid var(--neon);

  border-radius: 8px;

  cursor: pointer;

  min-height: 20px;

  box-sizing: border-box;
}


/* ------------------------------------------------ */
/* RESET GOMB */
/* ------------------------------------------------ */

.reset-btn {
  padding: 8px 14px;

  border: 3px solid var(--neon);

  background: #000;

  color: var(--neon);

  border-radius: 8px;

  cursor: pointer;

  font-weight: bold;

  width: fit-content;

  font-size: 16px;
}


/* ------------------------------------------------ */
/* RESPONSIVE */
/* ------------------------------------------------ */

@media (max-width: 1100px) {

  .main-panel {
    grid-template-columns:
      minmax(150px, 0.55fr)
      minmax(360px, 1.5fr)
      minmax(150px, 0.55fr);
  }

  .search-area {
    padding: 12px;
  }

  .history-area {
    padding: 12px;
  }

}


@media (max-width: 850px) {

  .sidebar {
    width: 200px;
  }

  .main-panel {
    grid-template-columns:
      minmax(140px, 0.45fr)
      minmax(350px, 1.6fr)
      minmax(140px, 0.45fr);
  }

  .panel {
    min-width: 320px;
  }

}


/* ------------------------------------------------ */
/* MOBIL */
/* ------------------------------------------------ */

@media (max-width: 600px) {

  .converter-root {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;

    flex-direction: row;

    flex-wrap: wrap;

    justify-content: center;

    padding: 12px;

    border-right: 0;

    border-bottom: 3px solid var(--neon);
  }

  .mode-btn {
    flex: 1 1 130px;

    max-width: 180px;
  }

  .main-panel {
    height: auto;
    min-height: 0;

    display: flex;

    flex-direction: column;

    padding: 20px;
  }

  .search-area {
    position: static;

    order: 1;

    width: 100%;

    padding: 10px 0;
  }

  .search-area .search-container {
    width: 100%;
    max-width: 420px;
  }

  .converter-center {
    order: 2;

    width: 100%;
    min-height: 400px;
  }

  .history-area {
    order: 3;

    width: 100%;
    min-height: 150px;
  }

  .panel {
    min-width: min(350px, calc(100vw - 50px));

    max-width: calc(100vw - 50px);
  }

  .unit-row {
    gap: 12px;

    flex-wrap: wrap;
  }

  .unit-select {
    width: min(150px, 40vw);
  }

  .converter-title {
    position: static;

    transform: none;

    text-align: center;

    margin: 12px 0 0;
  }

}