body {
  font-family: "Roboto Mono", monospace;
  color: #333;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  text-align: center;
  background-color: #f0f4f8; /* Cor padrão */
  transition: background-color 0.5s ease;
}

.container {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  padding: 40px;
  border-radius: 15px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  max-width: 600px;
  width: 90%;
  margin-top: 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

h1 {
  color: #2c3e50;
  margin-bottom: 10px;
}

h1 i {
  margin-right: 10px;
  color: #f39c12;
}

.subtitle {
  color: #556677;
  margin-bottom: 30px;
}

.card-container {
  display: flex;
  justify-content: space-around;
  gap: 20px;
  margin-bottom: 30px;
}

.card {
  background-color: rgba(255, 255, 255, 0.7);
  padding: 20px;
  border-radius: 10px;
  width: 45%;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  transition: background-color 0.5s ease;
}

.card h2 {
  margin-top: 0;
  color: #34495e;
  font-size: 1.2em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.temp {
  font-size: 2.5em;
  font-weight: 700;
  color: #2c3e50;
  margin: 0;
}

.date-info {
  font-size: 0.8em;
  color: #7f8c8d;
  margin-top: 5px;
  min-height: 1em; /* Garante que o layout não quebre se o texto estiver vazio */
}

.result {
  padding: 20px;
  border-radius: 10px;
  transition: background-color 0.5s ease, color 0.5s ease;
  background-color: #bdc3c7;
  color: #2c3e50;
}

.result p {
  margin: 0;
  font-size: 1.2em;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

/* --- Temas de Cores --- */

/* Tema Quente */
body.hotter-theme {
  background-color: #fff0f0;
}
.hotter-theme .container {
  background: rgba(255, 255, 255, 0.7);
}
.hotter-theme .result.hotter {
  background-color: #e74c3c;
  color: white;
}
.hotter-theme h1,
.hotter-theme .temp {
  color: #c0392b;
}
.hotter-theme .card {
  background-color: rgba(255, 235, 235, 0.8);
}

/* Tema Frio */
body.colder-theme {
  background-color: #eef7ff;
}
.colder-theme .container {
  background: rgba(255, 255, 255, 0.7);
}
.colder-theme .result.colder {
  background-color: #3498db;
  color: white;
}
.colder-theme h1,
.colder-theme .temp {
  color: #2980b9;
}
.colder-theme .card {
  background-color: rgba(230, 240, 255, 0.8);
}

/* Tema Neutro */
body.same-theme {
  background-color: #f0fff4;
}
.same-theme .container {
  background: rgba(255, 255, 255, 0.7);
}
.same-theme .result.same {
  background-color: #2ecc71;
  color: white;
}
.same-theme h1,
.same-theme .temp {
  color: #27ae60;
}
.same-theme .card {
  background-color: rgba(235, 255, 240, 0.8);
}

/* Cores individuais para as temperaturas */
.temp.temp-hot {
  color: #e74c3c !important; /* !important para garantir a sobreposição sobre o tema */
}

.temp.temp-cold {
  color: #3498db !important; /* !important para garantir a sobreposição sobre o tema */
}

footer {
  margin-top: 30px;
  font-size: 0.8em;
  color: #7f8c8d;
}

footer a {
  color: #3498db;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* --- Estilos da Seção do Gráfico --- */

.chart-container {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #e0e0e0;
}

.chart-container h2 {
  color: #2c3e50;
  margin-bottom: 20px;
}

.chart-controls {
  margin-bottom: 20px;
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
}

.chart-controls label {
  font-weight: 700;
  color: #556677;
}

#year-select {
  padding: 8px 12px;
  border-radius: 5px;
  border: 1px solid #ccc;
  font-family: "Roboto Mono", monospace;
  font-size: 1em;
  background-color: white;
}

.chart-wrapper {
  position: relative;
  height: 40vh;
  width: 100%;
  margin-bottom: 20px;
}

#chart-summary {
  background-color: #e9ecef;
  color: #333; /* Cor de texto padrão para o resumo */
}

/* Temas para o card de resumo do gráfico */
#chart-summary.hotter {
  background-color: #e74c3c;
  color: white;
}

#chart-summary.colder {
  background-color: #3498db;
  color: white;
}

#chart-summary.same {
  background-color: #2ecc71;
  color: white;
}

#chart-summary p {
  display: block;
}

#chart-period-notice {
  margin-top: 15px;
  font-style: italic;
}

/* --- Media Queries para Responsividade --- */

/* Para telas menores que 800px (tablets e celulares em modo paisagem) */
@media (max-width: 800px) {
  .container {
    padding: 20px;
    width: 95%;
  }

  .card-container {
    flex-direction: column;
    align-items: center;
    gap: 15px;
  }

  .card {
    width: 90%;
  }

  h1 {
    font-size: 1.8em;
  }

  .temp {
    font-size: 2.2em;
  }

  .result p {
    font-size: 1.1em;
  }

  .chart-wrapper {
    height: 50vh; /* Aumenta a altura em telas de tablet para melhor visualização */
  }
}

/* Para telas menores que 480px (celulares em modo retrato) */
@media (max-width: 480px) {
  body {
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .container {
    padding: 15px;
    margin-top: 10px;
  }

  h1 {
    font-size: 1.5em;
  }

  .subtitle {
    font-size: 0.9em;
    margin-bottom: 20px;
  }

  .temp {
    font-size: 2em;
  }

  .card {
    width: 100%;
  }

  .chart-wrapper {
    height: 45vh; /* Ajusta a altura para telas de celular */
  }

  .chart-controls {
    flex-direction: column;
    gap: 15px;
  }
}
