@import url("https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
  color: white;
  font-weight: 600;
}
body {
  background: url(assets/bg.jpg);
  width: 100%;
  height: 100dvh;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
}
body::before {
  content: "";
  position: absolute;
  width: 100%;
  height: 100dvh;
  background: rgb(0, 0, 0, 0.15);
  backdrop-filter: blur(15px);
}
/* util */
.regular-txt{
    font-weight: 400;
}
/*end of  util */
.main-container {
  border: solid;
  width: 300px;
  height: 496px;
  z-index: 1;
  background: linear-gradient(
    to top,
    rgb(0, 0, 0, 0.15),
    rgb(255, 255, 255, 0.15)
  );
  border-radius: 12px;
  backdrop-filter: blur(100px);
  padding: 20px;
}
/* Input container */
.input-container{
    position: relative;
    margin-bottom: 25px;
}
.city-input{
    width: 100%;
    padding: 10px 16px;
    border-radius: 99px;
    border: 3px solid transparent;
    background: rgb(0,0,0,0.15);
    outline: none;
    font-weight: 500;
    transition: 0.25s border;
    padding-right: 45px;
}
.city-input:focus{
border: 3px solid rgb(0, 0, 0,0.15);
}
.city-input::placeholder{
    color: rgb(255,255, 255,0.75);

}
.search-btn{
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    display: flex;
    border: none;
    cursor: pointer;
}
/* end of input container */

/* Section:weather info */
.weather-info{
display: flex;
flex-direction: column;
gap: 25px;
}
.location-date-container{
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.location{
    display: flex;
    align-items: center;
    gap:6px;
}
.weather-summary-container{
  display: flex;
  justify-content: space-between;
  align-items: center;

}
.weather-summary-img{
  width: 120px;
  height: 120px;
}
.weather-summary-info{
  text-align: end;
}
.weather-conditions-container{
  display: flex;
  justify-content:space-between ;
}
.condition-item{
  display: flex;
  align-items: center;
  gap: 6px;
}
.condition-item span{
  font-size: 30px;

}
.forecast-items-container{
display: flex;
 gap: 15px;
 overflow-x: scroll;
 padding-bottom: 12px;
}
.forecast-items-container::-webkit-scrollbar{
  height: 8px;
}
.forecast-items-container::-webkit-scrollbar-track{
  background: rgb(0, 0, 0, 0.1);
  border-radius: 99px;
}
.forecast-items-container::-webkit-scrollbar-thumb{
  background: rgb(0, 0, 0, 0.15);
  border-radius: 99px;

}
.forecast-item {
  min-width: 70px;
  background: rgb(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  align-items: center;
  border-radius: 12px;
  transition: 0.3s background;
}
.forecast-item:hover{
  background: rgb(255, 255, 255, 0.15);
}
.forecast-item-img{
  width: 35px;
}
.forecast-items-container {
  scroll-behavior: smooth;
}

/* END OF Section:weather info */
/* message section */
.section-message{
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
gap: 15px;
margin-top: 25%;
}
.section-message img{
  height: 180px;
  width: fit-content;
}
/* end of message section */


/* watermark section */
.app-watermark {
  position: fixed;
  bottom: 10px;
  right: 10px;
  font-size: 16px;
  font-weight: 400;
  z-index: 9999;
  text-decoration: none;

  background: linear-gradient(90deg, #ffffff, #a0c4ff);
  background-clip: text;
  -webkit-background-clip: text;
  -moz-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;

  text-shadow: 0 0 6px rgba(160, 196, 255, 0.6);
}

.app-watermark:hover {
  text-shadow: 0 0 12px rgba(160, 196, 255, 0.9);
  text-decoration: underline;
}

/*end of watermark section */



/* glowing animation of title and border  */
.app-title {
  position: absolute;
  top: -170px;
  width: 100%;
  text-align: center;
  font-size: 50px;
  font-weight: 800;
  letter-spacing: 4px;
  text-transform: uppercase;
  z-index: 2;

  background: linear-gradient(90deg, #ffffff, #a0c4ff);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;

  transform: translateX(-20px);
  animation: textGlow 4s ease-in-out infinite;
}

@keyframes textGlow {
  0%, 100% {
    text-shadow: 0 0 4px rgba(255, 255, 255, 0.3),
                 0 0 8px rgba(160, 196, 255, 0.3);
  }
  50% {
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.7),
                 0 0 20px rgba(160, 196, 255, 0.5);
  }
}

.main-container {
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 12px;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.15),
    rgba(255, 255, 255, 0.15)
  );
  backdrop-filter: blur(100px);
  padding: 20px;
  width: 300px;
  height: 496px;
  z-index: 1;

  animation: boxGlow 4s ease-in-out infinite;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.25);
}

@keyframes boxGlow {
  0%, 100% {
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.3),
                0 0 12px rgba(255, 255, 255, 0.2);
  }
  50% {
    box-shadow: 0 0 14px rgba(255, 255, 255, 0.6),
                0 0 24px rgba(160, 196, 255, 0.4);
  }
}

/* end */

/* Responsive Design */
@media (max-width: 400px) {
  .main-container {
    width: 90%;
    height: auto;
    padding: 15px;
  }

  .app-title {
    font-size: 36px;
    top: -90px;
  }

  .city-input {
    padding: 8px 12px;
    font-size: 14px;
    padding-right: 40px;
  }

  .forecast-items-container {
    gap: 10px;
  }

  .forecast-item {
    min-width: 60px;
    padding: 8px;
  }

  .forecast-item-img {
    width: 30px;
  }

  .weather-summary-img {
    width: 90px;
    height: 90px;
  }

  .temp-txt {
    font-size: 28px;
  }

  .condition-txt {
    font-size: 16px;
  }

  .condition-item span {
    font-size: 24px;
  }

  .app-watermark {
    font-size: 12px;
    right: 5px;
    bottom: 5px;
  }
}
/* Additional Responsive Fixes for Better Mobile Support */

/* Fix for blur covering entire screen */
body {
  min-height: 100dvh;
}

body::before {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  min-height: 100dvh;
}

/* Ensure body handles small screens properly */
@media (max-height: 700px) {
  body {
    height: auto;
    min-height: 100dvh;
    padding: 60px 10px 20px;
  }
  
  .app-title {
    font-size: 32px;
    top: -60px;
    letter-spacing: 2px;
  }
  
  .main-container {
    height: auto;
    min-height: 450px;
    margin-top: 20px;
  }
}

/* Very small screens (iPhone SE, small Androids) */
@media (max-width: 375px) {
  body {
    padding: 50px 5px 15px;
  }
  
  .app-title {
    font-size: 28px;
    top: -50px;
  }
  
  .main-container {
    width: 95%;
    padding: 12px;
  }
  
  .weather-summary-img {
    width: 80px;
    height: 80px;
  }
  
  .temp-txt {
    font-size: 24px !important;
  }
}

/* Landscape mode fixes */
@media (max-height: 500px) and (orientation: landscape) {
  body {
    padding: 10px;
  }
  
  .app-title {
    font-size: 24px;
    top: -40px;
  }
  
  .main-container {
    height: auto;
    max-height: calc(100dvh - 60px);
    overflow-y: auto;
    margin-top: 10px;
  }
  
  .section-message {
    margin-top: 10%;
  }
  
  .section-message img {
    height: 120px;
  }
}

/* Tablets and larger screens */
@media (min-width: 768px) {
  .main-container {
    width: 350px;
    height: 550px;
  }
  
  .app-title {
    font-size: 60px;
    top: -190px;
  }
}

/* Extra safety for very tall and very short screens */
@media (min-height: 800px) {
  body {
    padding: 100px 10px 20px;
  }
  
  .app-title {
    top: -200px;
  }
}

@media (max-height: 600px) {
  .weather-info {
    gap: 15px;
  }
  
  .input-container {
    margin-bottom: 15px;
  }
  
  .forecast-items-container {
    gap: 10px;
  }
  
  .section-message {
    margin-top: 15%;
  }
  
  .section-message img {
    height: 140px;
  }
}

/* Fix for notched phones (iPhone X and similar) */
@supports (padding: max(0px)) {
  body {
    padding-top: max(60px, env(safe-area-inset-top));
    padding-left: max(10px, env(safe-area-inset-left));
    padding-right: max(10px, env(safe-area-inset-right));
  }
}
