* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-repeat: no-repeat;
  background-size: cover;
  font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
  min-height: 100vh;
  background: linear-gradient(to bottom, #87CEEB, #ffffff);
  transition: background 1s ease-in-out, color 0.4s ease-in-out;
  color: #333;
}

/* Layout principal más flexible */
main {
  background: rgba(40, 40, 40, 0.55);
  margin: 4rem auto;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 8px;
  width: min(720px, 92%);
  padding: 1.6rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

/* Títulos */
h1 {
  margin-bottom: 12px;
  color: #fff;
  text-align: center;
}

/* Temas por clima */
body.clear {
  background: linear-gradient(to bottom, #87CEEB, #ffffff);
  color: #333;
}

body.rain {
  background: linear-gradient(to bottom, #373B44, #4286f4);
  
}

body.snow {
  background: linear-gradient(to bottom, #e0eafc, #cfdef3);
  
}

body.clouds {
  background: linear-gradient(to bottom, #bdc3c7, #2c3e50);
  
}

body.thunderstorm {
  background: linear-gradient(to bottom, #0f2027, #203a43, #2c5364);
  
}

body.mist {
  background: linear-gradient(to bottom, #dfe9f3, #ffffff);
  
}

body.default {
  background: linear-gradient(to bottom, #667db6, #0082c8);
  
}
/*Clear backgrounds*/
body.clear,  body.snow, body.mist {
  color: #222; 
}

body.clear #weather-data,
body.clear #suggestions {
  color: #222;
}
/*Dark backgrounds*/
body.rain, 
body.clouds, 
body.thunderstorm, 
body.default {
  color: #f5f5f5; 
}

body.rain #weather-data,
body.rain #suggestions,
body.clouds #weather-data,
body.clouds #suggestions,
body.thunderstorm #weather-data,
body.thunderstorm #suggestions,
body.default #weather-data,
body.default #suggestions {
  color: #f5f5f5;
}

/* Inputs / botones */
#weather-search {
  display: flex;
  gap: 0;
  justify-content: center;
  margin: 0.8rem auto;
  width: 100%;
}

#search {
  border-radius: 5px 0 0 5px;
  border: 1px solid #ccc;
  padding: 10px;
  font-size: 16px;
  width: 70%;
  height: 42px;
  outline: none;
}

#submit {
  border-radius: 0 5px 5px 0;
  padding: 10px;
  font-size: 16px;
  width: 5em;
  cursor: pointer;
  transition: background-color 0.25s, transform 0.15s;
  border: 1px solid #4facfe;
  background: #1a80da; 
}
#submit:hover {
  background: #166bb3; 
  color: white;
  transform: scale(1.03);
}

/* Wrapper y contenedor de datos */
#weather-wrapper {
  display: flex;
  flex-direction: column;
  align-items: stretch; /* permite que #weather-data ocupe el ancho */
  gap: 1rem;
  transition: opacity 0.6s ease-in-out, transform 0.6s ease-in-out;
  opacity: 1;
  transform: translateY(0);
  width: 100%;
}

#suggestions {
  margin: 0.4rem auto;
  width: 100%;
}

#weather-data {
  display: none; /* lo activaremos desde JS */
  width: 100%;
  padding: 1rem;
  border-radius: 8px;
  background: rgba(26, 128, 218, 0.35);
  box-shadow: 0 6px 18px rgba(0,0,0,0.06);
  box-sizing: border-box;
  color: inherit;
}

/* fade utility con transitions (muy importante) */
.fade {
  opacity: 0;
  transform: translateY(-20px);
  transition: opacity 0.6s ease-in-out, transform 0.6s ease-in-out;
}

/* (opcional) estilos de lista de sugerencias */
#suggestions ul {
  list-style: none;
  padding: 0.4rem;
}
#suggestions li {
  padding: 0.4rem;
  cursor: pointer;
  border-radius: 4px;
}
#suggestions li:hover { background: rgba(0,0,0,0.04); }
