/* static/index.css */

body {
  font-family: Arial, sans-serif;
  background-color: #f2f2f2;
  margin: 0;
  padding: 0;
  color: #333;
}

/* header ajustado */
header {
  padding: 0;
  margin-bottom: 0;
}

nav {
  background-color: #ddd;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0;
  position: relative;
}

.nav-left {
  margin-left: 10%;
  flex: 1;
}
.nav-left img {
  max-width: 100%;
  height: auto;
  display: block;
}
.banderas {
  display: flex;
  align-items: center;
  margin-right: 10px;
}
.banderas img {
  height: 30px;
  margin-right: 10px;
}
@media (max-width: 768px){
	.banderas img {
	height: 20px;
	margin-right: 5px;
        }		
}

.nav-center {
  flex: 2;
  display: flex;
  justify-content: center;
  gap: 1rem;
}

a {
  font-size: 1.5em;
  color: #007bff;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.hamburger {
  display: none;
  font-size: 24px;
  cursor: pointer;
  padding: 10px;
}

/* ---- */
.container {
  max-width: 70%;
  margin: 20px auto;
  padding: 20px;
  border-radius: 20px;
}

h1 {
  text-align: center;
  font-size: 3.2em;
  color: #444;
  margin-bottom: 50px;
}

h2 {
  margin-top: 40px;
  font-size: 2.6em;
  border-bottom: 5px solid #ddd;
  padding-bottom: 8px;
  margin-bottom: 45px;
  color: #555;
}

li {
  margin-bottom: 15px;
}

/* gráficas (datos sensores) */
.dashboard {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  column-gap: 80px;
  row-gap: 50px;
  padding: 20px;
}

.thermo-wrapper {
  width: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.label {
  margin-bottom: 8px;
  font-weight: bold;
  text-align: center;
}

.thermometer-container {
  position: relative;
  width: 60px;
  height: 200px;
  margin-bottom: 30px;
}

.thermometer {
  width: 20px;
  height: 100%;
  background-color: #eee;
  margin: 0 auto;
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid #999;
}

.fill {
  background: linear-gradient(to top, red, orange);
  width: 100%;
  position: absolute;
  bottom: 0;
  transition: height 0.3s ease;
}

.bulb {
  width: 40px;
  height: 40px;
  background: red;
  border-radius: 50%;
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  border: 2px solid #999;
}

.thermo-value {
  font-weight: bold;
  font-size: 18px;
}

.gauge-wrapper {
  width: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gauge-container {
  width: 200px;
  height: 100px;
  position: relative;
  overflow: hidden;
}

.gauge {
  width: 100%;
  height: 200px;
  border-radius: 50%;
  background: conic-gradient(
      #76c7c0 var(--percent, 0deg),
      #e0e0e0 0
  );
  transform: rotate(-90deg);
  transition: background 0.5s ease-in-out;
}

.gauge-value {
  margin-top: 10px;
  font-size: 20px;
  font-weight: bold;
}

.data-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 1.6em;
}

.data-list li {
  padding: 8px 0;
  border-bottom: 1px solid #eee;
  margin-top: 7%;
}

.data-list li:last-child {
  border-bottom: none;
}

.data {
  font-weight: bold;
  color: #000;
}

/* controles */
#controls {
  margin-top: 10%;
}

.control-group {
  margin-bottom: 80px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  font-size: 1.3em;
  margin-top: 50px;
  margin-left: 5%;
}

.control-group label {
  width: 300px;
  margin-right: 15px;
  font-size: 1.2em;
}

#threshold {
  height: 53px;
  margin-right: 40px;
}

#speedSelect {
  margin-right: 40px;
}

input[type="number"] {
  padding: 10px;
  width: 400px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-size: 1.3em;
}

select {
  padding: 12px;
  width: 400px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-size: 1.3em;
}

button {
  padding: 10px 15px;
  border: none;
  background-color: #007bff;
  color: #fff;
  border-radius: 3px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

button:hover {
  background-color: #0056b3;
}

/* Adaptación para móviles y tablets */
@media (max-width: 1280px) {
  * {
      box-sizing: border-box;
  }

  nav {
      justify-content: space-between;
      padding: 15px;
  }

  .nav-left {
      flex: 1 1 100%;
  }

  .nav-left img {
      width: 180px;
  }

  .nav-center {
      display: none !important;
      flex-direction: column;
      width: 100%;
      position: absolute;
      top: 100%;
      left: 0;
      background-color: #ddd;
      padding: 15px;
      box-shadow: 0 4px 6px rgba(0,0,0,0.1);
      z-index: 10;
  }

  .nav-center.show {
      display: flex !important;
  }

  .nav-center a {
      font-size: 1em;
      padding: 8px 12px;
      white-space: nowrap;
  }

  .hamburger {
      display: block;
  }

  .container {
      max-width: 90%;
      padding: 15px;
  }

  h1 {
      font-size: 2.2em;
  }
  h2 {
      font-size: 1.8em;
  }

  .data-list {
      font-size: 1.3em;
  }

  .thermometer-container {
      width: 40px;
      height: 140px;
  }

  .bulb {
      width: 30px;
      height: 30px;
      bottom: -15px;
  }

  .thermo-wrapper {
      width: 30%;
      margin-bottom: 5%;
  }

  .thermo-wrapper:nth-child(4) {
      margin: 0 auto;
  }

  .gauge-wrapper {
      width: 45%;
      max-width: 200px;
      margin-top: 5%;
  }

  .gauge-container {
      width: 100%;
      height: auto;
      aspect-ratio: 2/1;
  }

  .gauge {
      height: auto;
      aspect-ratio: 1/1;
  }

  .control-group {
      flex-direction: column;
      align-items: flex-start;
      margin-left: 0;
      font-size: 1.1em;
  }

  #threshold {
      width: 75%;
      height: 40%;
      margin-bottom: 5%;
  }

  #speedSelect {
      width: 75%;
      margin-bottom: 5%;
  }

  input[type="number"], select {
      font-size: 1.1em;
      width: 100%;
  }
}

/* Para que en pantallas como móviles salgan 2 termómetros por fila */
@media (max-width: 768px) {
  .thermo-wrapper {
      width: 45%;
      margin: 0 auto;
  }
}
