/* 1. Font Import */
@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@400;700&display=swap');

/* 2. CSS Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* 3. Body Styles */
body {
  min-height: 100vh;
  font-family: 'Quicksand', Arial, sans-serif;
  background: linear-gradient(260deg, #f5f7fa, #88b1f1); /* soft light blue gradient */
  color: #222b45;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background 0.5s;
}

#logo {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 200px;
  height: auto;
  background-size: contain;
}

#icon {
  color: #222b45;
}

.top-header{
  position: absolute;
  top: 20px;
  left: 0;
  width: 100%;
  color:  rgba(255,255,255,0.96);
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 4. Container */
.container {
  background: rgba(255,255,255,0.96);
  border-radius: 20px;
  box-shadow: 0 8px 32px 0 rgba(60, 80, 180, 0.12);
  padding: 2.5rem 2rem 2rem 2rem;
  max-width: 350px;
  width: 100%;
  margin: 2rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  backdrop-filter: blur(6px);
  border: 1.5px solid #e3e9f7;
  transition: box-shadow 0.3s cubic-bezier(.4,2,.6,1);
}

/* 5. Header */
header {
  text-align: center;
  margin-bottom: 1.5rem;
  margin-right: 1rem;
}
header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #3a7bd5;
  margin-bottom: 0.5rem;
  letter-spacing: 1px;
}
header h2 {
  font-size: 1rem;
  color: #7b8794;
  font-weight: 400;
}

/* 6. Search Bar */
#search {
  width: 100%;
  display: flex;
  align-items: center;
  background: #e3e9f7;
  border-radius: 18px;
  padding: 6px 12px;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 8px #e3e9f7;
  border: 1px solid #e3e9f7;
  transition: box-shadow 0.3s cubic-bezier(.4,2,.6,1);
}
#cityInput {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 1rem;
  color: #222b45;
  padding: 8px 0;
  font-family: inherit;
  outline: none;
}
#search .fa-search {
  color: #3a7bd5;
  font-size: 1.2rem;
  margin-left: 8px;
  cursor: pointer;
  transition: color 0.2s;
}
#search .fa-search:hover,
#search .fa-search:focus {
  color: #222b45;
}

/* 7. Weather Icon */
.weather-icon {
  margin: 1.2rem 0 0.8rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 70px;
}
#weatherIcon {
  font-size: 3.5rem;
  color: #3a7bd5 ;
  filter: drop-shadow(0 2px 8px #3a7bd522);
  transition: color 0.3s;
}

/* 8. Weather Info */
.weather-info {
  text-align: center;
  margin-bottom: 1.2rem;
}
#cityName {
  font-size: 1.3rem;
  font-weight: 700;
  color: #222b45;
  margin-bottom: 2px;
}
#temperature {
  font-size: 2.2rem;
  font-weight: 700;
  color: #3a7bd5;
  margin-bottom: 2px;
  text-shadow: 0 2px 8px #e3e9f7;
}
#description {
  font-size: 1rem;
  color: #7b8794;
  text-transform: capitalize;
}

/* 9. Additional Info */
.additional-info {
  width: 100%;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}
.boxes {
  background: #e3e9f7;
  border-radius: 12px;
  padding: 0.7rem 1rem;
  flex: 1;
  text-align: center;
  box-shadow: 0 2px 8px #e3e9f7;
  border: 1px solid #c3cfe2;
  font-size: 0.97rem;
  color: #222b45;
}
.boxes span {
  font-weight: 700;
  color: #3a7bd5;
}

/* 10. Responsive Design */
@media (max-width: 900px) {
  .container {
    max-width: 80vw;
    padding: 2rem 4vw;
  }
  #logo {
    width: 150px;
    top: 10px;
    left: 10px;
  }
  .top-header {
    font-size: 1.2rem;
    height: 48px;
  }
}

@media (max-width: 700px) {
  body {
      background: linear-gradient(0deg, #f5f7fa, #88b1f1); 
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    min-height: 100vh;
    padding: 0;
    display: flex;
  }
  .top-header {
    position: static !important;
    width: 100%;
    height: auto;
    margin-top: 1.2rem;
    margin-bottom: 0.7rem;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 1vw;
  }
  header {
    margin-bottom: 0.7rem;
    margin-right: 0;
  }
  .container {
    margin: 0 auto 1.5rem auto;
  }
}

@media (max-width: 500px) {
  .container {
    max-width: 95vw;
    padding: 1rem 4vw;
    border-radius: 20px;
    margin: 0 0 1rem 0;
    box-shadow: 0 8px 32px 0 rgba(60, 80, 180, 0.12);
    background: rgba(255,255,255,0.96);
  }
  .additional-info {
    flex-direction: column;
    gap: 0.7rem;
  }
  #logo {
    width: 100px;
    top: 6px;
    left: 6px;
  }
  .top-header {
    font-size: 0.95rem;
    height: 32px;
    padding-top: 8px;
  }
  #search {
    padding: 4px 6px;
  }
  #cityInput {
    font-size: 0.95rem;
    padding: 6px 0;
  }
  #search .fa-search {
    font-size: 1rem;
  }
  .weather-icon {
    height: 48px;
  }
  #weatherIcon {
    font-size: 2.2rem;
  }
  .weather-info {
    margin-bottom: 0.7rem;
  }
  #cityName {
    font-size: 1.05rem;
  }
  #temperature {
    font-size: 1.4rem;
  }
  #description {
    font-size: 0.95rem;
  }
  .boxes {
    font-size: 0.93rem;
    padding: 0.5rem 0.7rem;
  }
}

/* 11. Focus Styles for Accessibility */
input:focus, button:focus, .fa-search:focus {
  outline: 2px solid #3a7bd5;
  outline-offset: 2px;
}

/* 12. Subtle Animations */
.container,
.weather-icon,
.boxes {
  transition: box-shadow 0.3s cubic-bezier(.4,2,.6,1), background 0.3s cubic-bezier(.4,2,.6,1), color 0.3s cubic-bezier(.4,2,.6,1);
}
.weather-icon:hover #weatherIcon {
  color: #222b45;
}

/* 13. Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  background: #e3e9f7;
}
::-webkit-scrollbar-thumb {
  background: #3a7bd5;
  border-radius: 8px;
}