*,
*::before,
*::after {
    box-sizing: border-box;
}

body{
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: Arial, Helvetica, sans-serif;
    margin: 0;
    min-height: 100vh;
    padding: 24px;
    background:
      linear-gradient(rgba(8, 18, 30, 0.72), rgba(8, 18, 30, 0.72)),
      url("https://images.unsplash.com/photo-1534088568595-a066f7104211?auto=format&fit=crop&q=80&w=2000") center/cover no-repeat;
    color: #f4f9ff;
    font-family: Arial, Helvetica, sans-serif;
    overflow-y: auto;
    flex-direction: column;
    gap: 16px;
 }
 .container{
    display: flex;
    align-items: center;
    flex-direction: column;
    text-align: center;
    background-color: rgba(255, 255, 255, 0.12);
    width: min(100%, 560px);
    padding: 32px 24px;
    border-radius: 18px;
    box-shadow:  0px 16px 40px rgba(2, 12, 24, 0.22);
    backdrop-filter: blur(8px);
    box-sizing: border-box;
}

h2{
   margin: 0;
   color: #f4f9ff;
   font-size: 34px;
   font-weight: 700;
}

.subtitle{
   margin: 10px 0 22px;
   color: rgba(244, 249, 255, 0.82);
   font-size: 18px;
 }
input{
   width: min(100%, 260px);
   min-height: 44px;
   border-radius: 8px;
   /* border: 2px solid rgba(167, 218, 255, 0.55); */
   border: 1px silver solid;
   padding: 0 12px;
   font-size: 16px;
   margin-bottom: 12px;
   font-weight: bold;
   /* background-color: rgba(255, 255, 255, 0.14); */
   background-color: rgba(244, 249, 255, 0.82);
   color: black;
   cursor:text;
   outline: none;
   box-sizing: border-box;
 }
 input::placeholder{
   color: rgb(124, 122, 122);
    font-weight: 500;
 }

 .city-input{
   display: flex;
   align-items: center;
   flex-direction: column;
   gap: 10px;
   justify-content: center;
   width: 100%;
 }

 .city {
    color: #fff;
 }
 label{
    font-size: 18px;
    font-weight: 700;
    color: #dbeeff;
    text-align: center;
 }
 .fa-fa-search{
   position: absolute;
   right: 500px;
   top: 295px;
   color: #dbeeff;
   font-weight: 700;
 }
 .fa-sun-o {
    position: absolute;
    top: 365px;
    color:  #dbeeff;
    font-size: 30px;
    font-weight: 700;
 }

button{
    border: 1px solid rgba(255, 255, 255, 0.18);
    cursor: pointer;
    color: #082033;
    background: linear-gradient(135deg, #9cd9ff 0%, #d8f0ff 100%);
    min-height: 44px;
    min-width: 148px;
    padding: 0 18px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.02em;
    box-shadow: 0 10px 22px rgba(5, 27, 45, 0.22);
    transition:
      transform 0.2s ease,
      box-shadow 0.2s ease,
      background 0.2s ease,
      border-color 0.2s ease;
    box-sizing: border-box;
 }

 button:hover{
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(5, 27, 45, 0.3);
 }

 button:active{
    transform: translateY(0);
    box-shadow: 0 8px 18px rgba(5, 27, 45, 0.2);
 }

 button:focus-visible{
    outline: 3px solid rgba(156, 217, 255, 0.4);
    outline-offset: 3px;
 }

 #search{
    width: 100%;
    max-width: 260px;
    background: linear-gradient(135deg, #8be0ff 0%, #72bdf7 100%);
    color: #06263b;
 }

 #search i{
    font-size: 16px;
 }

 #retry-state,
 .check-again{
    background: rgba(255, 255, 255, 0.14);
    color: #f4f9ff;
    border: 1px solid rgba(255, 255, 255, 0.28);
    backdrop-filter: blur(6px);
 }

 #retry-state:hover,
 .check-again:hover{
    background: rgba(255, 255, 255, 0.22);
 }
 .state {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: white;
}

.state.active {
  display: flex;
}


.temperature {
    color: #fff;
}


.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid white;
  border-top: 4px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.weatherResult,
.weather-result {
    margin-top: 24px;
    width: 100%;
    max-width: 100%;
}
.weather-card {
    margin-bottom: 12px;
}
.weatherResult .weather-card,
.weather-result .weather-card {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
}
.weatherResult .city,
.weather-result .city{
font-size: 20px;
font-weight: bold;
text-align: center;
margin: 0;
}

.weatherResult ,
.weather-result  {
    margin: 0;
    color: #4e6b6d;
    font-size: 16px;
}

.description {
    color: #e6f4ec;
}

.weatherResult .time-of-day,
.weather-result .time-of-day {
    margin: 0;
    padding: 4px 12px;
    border-radius: 999px;
    background-color: #e6f4ec;
    color: #2f6c52;
    font-size: 14px;
    font-weight: 600;
}

.weatherResult .temperature,
.weather-result .temperature {
    font-size: 24px;
    margin: 0;
    font-weight: 700;
}

.weatherResult .weather-icon,
.weather-result .weather-icon{
    width: 72px;
    height: 72px;
    object-fit: contain;
}

.weatherResult .error-message,
.weather-result .error-message {
    margin: 0;
    padding: 12px 14px;
    border-radius: 12px;
    background-color: #fdeaea;
    color: #b42318;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
}

@media (max-width: 900px) {
    body {
        padding: 24px;
        min-height: 100vh;
    }

    .container {
        width: min(100%, 560px);
        min-width: unset;
        padding: 24px 18px;
    }

    .city-input {
        width: 100%;
    }

    input {
        flex: 1;
        min-width: 220px;
    }

    button,
    #search {
        width: 100%;
        max-width: 260px;
    }
}

@media (max-width: 600px) {
    body {
        justify-content: flex-start;
        align-items: stretch;
        padding: 18px 14px 24px;
        gap: 12px;
    }

    .container {
        width: 100%;
        padding: 22px 16px;
        border-radius: 14px;
    }

    h2 {
        margin-top: 6px;
        margin-bottom: 0;
        text-align: center;
        font-size: 28px;
    }

    .subtitle {
        margin: 8px 0 18px;
        font-size: 16px;
    }

    .city-input,
    .state.active,
    .weatherResult,
    .weather-result,
    #error-state {
        width: 100%;
        max-width: 100%;
    }

    input {
        width: 100%;
        max-width: none;
        margin-bottom: 8px;
    }

    button,
    #search,
    #retry-state,
    .check-again {
        width: 100%;
        max-width: none;
    }

    .weatherResult,
    .weather-result {
        margin-top: 20px;
    }

    .weatherResult .city,
    .weather-result .city {
        font-size: 18px;
    }

    .weatherResult .description,
    .weather-result .description {
        font-size: 15px;
    }

    .weatherResult .temperature,
    .weather-result .temperature {
        font-size: 22px;
    }

    .weatherResult .error-message,
    .weather-result .error-message {
        font-size: 14px;
    }

    .weatherResult .weather-icon,
    .weather-result .weather-icon {
        width: 64px;
        height: 64px;
    }
}
