:root {
    --primary-color: #2E5BFF;
    --accent-color: #09274A;
    --text-color: #333333;
    --bg-main: #ffffff;
    --bg-secondary: #fafafa;
    --bg-third: #f5f5f5;
}

body {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    color: var(--text-color);
    background: linear-gradient(135deg, #ffffff 0%, #f0f6ff 50%, #e8fdf1 100%);
}

/*###################################
  #             Header              #
  ###################################*/
header {
  /* background: white; */
  padding: 15px 20px;
  color: black;
  z-index: 1000;
}

.header-size {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1000px;
  margin: auto;
}

.logo img {
  height: 40px;
  cursor: pointer;
  align-items: center; 
}

/* Kairė grupė = logo + converters */
.left-group {
  display: flex;
  align-items: center;
  gap: 30px; /* tarpelis tarp logo ir Converters */
}

/* Nav links */
nav ul {
  list-style: none;
  display: flex;
  gap: 20px;
  margin: 0;
  padding: 0;
}

nav a {
  color: black;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s, transform 0.2s, letter-spacing 0.2s;
}

nav a:hover {
  color: var(--primary-color);
  transform: translateY(-2px);   /* subtilus pakilimas */
  letter-spacing: 0.5px;         /* truputį daugiau oro */
}

/* Dropdown */
.dropdown {
  position: relative;
}

.dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dropdown-toggle .chevron {
  width: 16px;
  height: 16px;
  transition: transform 0.25s ease;
}

.dropdown:hover .chevron {
  transform: rotate(180deg); /* chevron-up */
}

/* Mobile (kai aktyvus meniu) */
.dropdown.open .chevron {
  transform: rotate(180deg);
}

.dropdown-menu {
  display: none;
  position: absolute;
  z-index: 2000;
  background: white;
  top: 100%;
  left: 0;
  padding: 15px;
  min-width: 420px;
  box-shadow: 0px 4px 10px rgba(0,0,0,0.08);
  border-radius: 6px;
  z-index: 1000;

  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

/* Desktop hover */
.dropdown:hover .dropdown-menu {
  display: grid;
}

/* Mobile styles */
.menu-toggle {
  display: none;
  font-size: 24px;
  cursor: pointer;
}

.dropdown-column {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.submenu-title {
  font-size: 12px;
  font-weight: 600;
  color: #777;
  /* margin-top: 6px; */
  margin-bottom: 4px;
  text-transform: uppercase;
}

/* Mobile styles */
.menu-toggle {
  display: none;
  font-size: 24px;
  cursor: pointer;
}

@media (max-width: 768px) {
  .dropdown:hover .dropdown-menu {
    display: none;
  }

  .header-size {
    display: flex;
    align-items: center;
  }

  nav ul {
    display: none;
    flex-direction: column;
    background: white;
    position: absolute;
    top: 60px;
    right: 0;
    width: 240px;
    padding: 10px;
    z-index: 2000; /* iškeliam virš hero */
  }
  nav ul.show {
    display: flex;
  }

  /* dropdown menu mobile */
  .dropdown-menu {
    display: none;
    position: static;
    border: none;
    padding: 10px 0;
    min-width: auto;
    box-shadow: none;
    border-radius: 0;
    grid-template-columns: 1fr; /* <-- mobile vienas stulpelis */
  }

  .dropdown.open .dropdown-menu {
    display: grid; /* atsidaro tik su JS toggle */
  }

  .menu-toggle {
    display: block;
  }

  .nav-left ul {
    position: absolute;
    top: 150px;   /* po header */
    right: 0;
  }

  .nav-right ul {
    position: absolute;
    top: 60px;  /* dar žemiau nei .nav-left */
    right: 0;
  }
}

main {
    max-width: 800px;
    margin: auto;
    padding: 20px;
}

h1 {
    color: var(--primary-color);
}

.intro-text {
    max-width: 600px;
}

.tool {
  background: var(--bg-main, #fff);
  margin-bottom: 20px;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.input-group {
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

label {
    display: block;
    margin-bottom: 5px;
}

input, select {
    padding: 8px;
    font-size: 1rem;
    flex: 1;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.input-group label {
  flex: 1;
}

.input-group input, .input-group select {
  padding: 0.5rem;
  flex: 2;
}

.result-box {
  margin-top: 2rem;
}

#resultTable {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

#resultTable th, #resultTable td {
  border: 1px solid #ddd;
  padding: 8px;
  text-align: center;
}

#resultTable th {
  background: var(--bg-secondary, #fafafa);
}

.result-good {
  color: green;
}
.result-warning {
  color: orange;
}
.result-poor {
  color: red;
}

.formula-note {
  font-size: 0.9rem;
  color: #666;
  margin-top: 10px;
}

.tooltip {
  position: relative;
  display: inline-block;
  cursor: help;
  margin-left: 6px;
}

.tooltip svg {
  width: 15px;
  height: 15px;
}

.tooltip .tooltiptext {
  visibility: hidden;
  width: 280px;
  background: #333;
  color: #fff;
  text-align: left;
  border-radius: 6px;
  padding: 8px;
  position: absolute;
  z-index: 1;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.3s;
  font-size: 0.85em;
  line-height: 1.4em;
}

.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}

.info-section {
  max-width: 800px;
  margin: 2rem auto;
  padding: 1.5rem;
  border-radius: 8px;
  line-height: 1.6;
}

.info-section h2,
.info-section h3 {
  margin-top: 1rem;
  color: #333;
}

.info-section ul,
.info-section ol {
  margin-left: 1.5rem;
}

.info-section code {
  background: rgba(255, 255, 255, 0.35);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
}

.extra-tool {
  margin-top: 1.5rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(12px);
  border: 1px solid var(--primary-color);
  box-shadow: 0 6px 20px rgba(46,91,255,0.2);
  transition: all 0.25s ease;
  border-radius: 6px;
}

.extra-tool a {
  color: var(--primary-color);
  text-decoration: none;
}

.extra-tool a:hover {
  text-decoration: underline;
}

h2, h3 {
    color: #2b3a42;
}

/* BUTTON BAR STYLES */
.extra-actions {
  display: flex;
  gap: 0.5rem;
  margin: 1rem 0;
}

.extra-actions button {
  margin: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-size: 0.9rem;
  border: 1px solid var(--primary-color);
  background: var(--bg-secondary);
  color: var(--primary-color);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem; /* tarpas tarp ikonos ir teksto */
  font-family: inherit
}

.extra-actions svg {
  width: 1em; /* automatiškai prisitaiko prie teksto dydžio */
  height: 1em;
}

.extra-actions button:hover {
  margin: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--primary-color);
  color: white;
  cursor: pointer;
}

footer {
    background: var(--accent-color);
    color: white;
    text-align: center;
    padding: 10px;
    margin-top: 30px;
}

@media (max-width: 550px) {
    .unit-input, .scale-inputs {
        flex-direction: column;
    }
}


