* {
  box-sizing: border-box;
}

html, body {
 
  margin: 0;
  padding: 0;
  height: 100%;
  overflow-x: hidden; /* Prevents horizontal scroll */
  overflow-y: auto; /* Ensures scrolling */
  -webkit-overflow-scrolling: touch;
}
/* 
body {
  font-family:  Verdana, Tahoma, Arial, sans-serif;
} */

#image-container {
  width: 100%;
  height: 100vh;
  background-size: cover;
  background-repeat: no-repeat;
  background-position:  center center;
  z-index: -1; /* Place image behind content */
  position: absolute; /* Fixed position for full-screen background */
  top: 0;
  left: 0;
  pointer-events: none; /* Ensures it doesn't block interactions */
  background-color: black;
 /* transition: background-image 0.35s;  Transition opacity might not keep this */
  animation: fade-in 2s ease-in   1  ;
  opacity: 1;
  }

  @keyframes fade-in {
    from {
      opacity: .1;
    }
    to {
      opacity: 1;
    }
  }



.content {
  font-family: "Playfair Display", Verdana, Tahoma, Arial, sans-serif;
  color: whitesmoke;
  text-shadow: 1px 1px #03021d;
  position: relative;
  font-size: 18px;
  
/*  display: flex;
  flex-wrap: wrap; */
  height: auto;
  margin: 20px auto;
  padding: 5px;
  overflow-y: auto; /* Fixes scrolling */
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  max-width: 800px; /* Controls the max width of the box */
}


.box {
  flex: 1; /* Allow items to grow and shrink */
  padding: 20px;
  margin: 10px;
  border: 1px dotted black;
  background-color: rgba(0, 0, 0, 50%);
  text-align: center;
  text-wrap: pretty;
  flex-basis: 100%; /* Default to full width on small screens */
  border-radius: 25px;
}

@media (prefers-reduced-transparency: reduce) {
  .box {
    background-color: rgba(0, 0, 0, 85%); /* darker black for .box elements */
  }
}

@media (min-width: 768px) {
  .box {
    flex-basis: auto; /* Allow items to adjust width on larger screens */
  }
}

.hidden-section {
  display: none;
}

#city {
  font-size: 40px;
  margin-bottom: 5px;
  margin-top: 0px;
  font-weight: 500;
}



#location-permission {
  color: white;
  text-decoration: underline;
  cursor: pointer;
  font-size: 18px; /* Default size */
  margin-top: 5px;
  opacity: 0.8;
  text-align: center;
  transition: font-size 0.3s ease; /* Smooth transition */
}


#location-permission:visited {
  color: whitesmoke;
  text-decoration: none;

}

#location-permission:hover {
  color: white;
  font-weight: 600; /* Bold font */;

 
}



#current-temp {
  font-size: 110px;
  margin-bottom: 0px;
  margin-left: 40px;
}

#high-low {
  font-size: 24px;
  margin-top: -10px;
  margin-bottom: 15px;
}

#condition {
  font-style: italic;
  margin-bottom: 0px;
  font-size: 40px;
  text-transform: capitalize;
}

#uv-index {
  font-style: italic;
  margin-bottom: 5px;
  font-size: 20px;
  margin-bottom: 15px;
}

#daylight { /*container for sunrise and sunset */
  display: flex;
  flex-direction: row;  /* Change to column if you want to Stack the inner divs in a column "Sunrise: 9:40 AM" */
  justify-content: center; /* Center the items vertically */
  align-items: center;     /* Center the items horizontally */
  margin: 0 auto; /* Needed to center the container within the box */
  width: auto;
 
}

#sunrise, #sunset {
  display: flex;
  flex-direction: column; /* Remove this if you want them stacked "Sunrise: 9:40 AM" */
  font-size: 16px;
  text-align: center;       /* Center-align the text inside each div */
  justify-content: space-between; /* Distribute space between items */
  text-wrap: nowrap;
  margin: 0 15px; /* Added margin to keep columns separated on mobile phones */
}

#message {
  margin-top: 20px;
  font-size: .9em;
  color: lightgray;

}

.header {
  font-size: 24px;
  text-align: center; /* Center the header text */
  margin-bottom: 20px; /* Add some space between header and forecast */
  margin-top: 5px;
  text-wrap: pretty;
  font-weight: 500;
}



/* 10-Day Forecast styles */

#forecast {
  display: grid;
  grid-template-columns: 20% 15% 30% 15% 20%;
  gap: 0px;
  text-align: center;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.forecast-day {
  display: contents;
}

.forecast-day-name,
.forecast-icon,
.forecast-condition,
.forecast-temp,
.forecast-uv {
  display: flex;
  flex-direction: column;
  min-height: 60px;
  align-items: center;
  justify-content: center;
  border-bottom: 1px dotted gray;
  margin-bottom: 0px;
  padding: 8px 4px; /* Changed to padding on all sides */
  -webkit-hyphens: auto;
  -ms-hyphens: auto;
  hyphens: auto;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Override for the first column to be horizontal */
.forecast-day-name {
  flex-direction: row; /* Arrange day and date side-by-side */
  gap: 0.5em; /* Add a small space between them */
}


/* Add these new classes for the condition column */
.forecast-condition-text {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.forecast-precipitation {
  flex-shrink: 0;
  margin-top: 2px;
  font-size: 1em;
}

.forecast-precipitation-chance {
  font-size: 1em;
  color: lightblue;
}


/* Rain amount icon */
.forecast-precipitation .rain-amount::before {
  content: '💧';
  font-size: 0.6em;
  margin-right: 2px;
  position: relative;
  top: -2px;
}

.rain-amount {
  color: lightblue;
}

/* Snow amount icon */
.forecast-precipitation .snow-amount::before {
  content: '❄️';
  font-size: 0.5em;
  margin-right: 2px;
  position: relative;
  top: -2px;
}


#forecast > .forecast-day:last-child .forecast-day-name,
#forecast > .forecast-day:last-child .forecast-icon,
#forecast > .forecast-day:last-child .forecast-condition,
#forecast > .forecast-day:last-child .forecast-temp,
#forecast > .forecast-day:last-child .forecast-uv {
  border-bottom: none;
}

.forecast-icon img {
  max-width: 35px;
  max-height: 35px;
}

@media (max-width: 600px) {
  #forecast {
    grid-template-columns: 10% 20% 25% 20% 25%;
    font-size: 1em;
  }

  .forecast-day-name { /*this will stack them */
    flex-direction: column;
    gap: 0.2em; /* Add a very small vertical gap */
  }

  .forecast-date-month { /*this will make the date, e.g. 10/09 smaller */
    font-size: .8em;
    /* display: none; hide date, still thinking about this fix */
  }


  .forecast-condition {
    padding: 10px 2px;
  }

  .forecast-icon {
    font-size: .8em;
  }

  /* Add these for better mobile spacing */
  .forecast-precipitation {
    font-size: .8em;
    margin-top: 0px;
  }

   .forecast-uv {
    word-break: break-word;
    hyphens: manual;
  }
}


/* Hourly forecast styles */
#hourly-forecast {
  display: grid;
  grid-template-columns: 20% 15% 30% 15% 20%;
  gap: 0px;
  text-align: center;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  text-transform: lowercase;
  
}

.hourly-item {
  display: contents;
}

.hourly-time,
.hourly-icon,
.hourly-condition,
.hourly-temp,
.hourly-uv {
  display: flex;
  flex-direction: column;
  min-height: 60px;
  align-items: center;
  justify-content: center;
  border-bottom: 1px dotted gray;
  margin-bottom: 0px;
  padding: 8px 4px;
  -webkit-hyphens: auto;
  -ms-hyphens: auto;
  hyphens: auto;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Icon styles */
.hourly-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hourly-icon img {
  max-width: 35px;
  max-height: 35px;
}

/* Precipitation chance */
.hourly-precip-chance {
  margin-top: 2px;
  font-size: 1em; /* Default size for larger screens */
  color: lightblue;
}

/* Condition column */
.hourly-condition {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.hourly-condition-text {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.hourly-precip-amount {
  flex-shrink: 0;
  margin-top: 2px;
  font-size: 1em; /* Default size for larger screens */
  color: lightblue;
}

/* Rain amount icon */
.hourly-precip-amount::before {
  content: '💧';
  font-size: 0.6em;
  margin-right: 2px;
  position: relative;
  top: -2px;
}

/* Snow amount icon */
.hourly-precip-amount.snow::before {
  content: '❄️';
  font-size: 0.5em;
  margin-right: 2px;
  position: relative;
  top: -2px;
}

/* Remove bottom border from last row */
#hourly-forecast > .hourly-item:last-child .hourly-time,
#hourly-forecast > .hourly-item:last-child .hourly-icon,
#hourly-forecast > .hourly-item:last-child .hourly-condition,
#hourly-forecast > .hourly-item:last-child .hourly-temp,
#hourly-forecast > .hourly-item:last-child .hourly-uv {
  border-bottom: none;
}

/* Mobile styles */
@media (max-width: 600px) {
  #hourly-forecast {
    grid-template-columns: 20% 15% 30% 15% 20%;
    font-size: 1em;
  }

  .hourly-condition {
    padding: 10px 2px;
  }


  
  /* Use !important to override any inheritance issues */
  .hourly-icon .hourly-precip-chance {
    font-size: 0.8em !important; 
    margin-top: 0px;
  }
  
  .hourly-condition .hourly-precip-amount {
    font-size: 0.8em !important;
    margin-top: 0px;
  }

  .hourly-uv {
    word-break: break-word;
    hyphens: manual;
  }
}

/* Currently */

.currently-header {
  text-align: center;
  margin-bottom: 15px;
}

.currently-grid {
  max-width: 100%;
  display: grid;
  grid-template-columns: 35% 65%;
  gap: 20px;
  -webkit-overflow-scrolling: touch;
  padding: 0 20px; /* Add padding to match .box */
}

.currently-left {
  display: flex;
  flex-direction: column;
  border-right: 1px solid whitesmoke;
  text-align: center;
  width: 100%;
  gap: 10px;
}



.currently-right {
  display: flex;
  flex-direction: column;
  margin-right: 20px;
}

.currently-detail {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  border-bottom: 1px dotted gray;
  padding-bottom: 5px;
}

.detail-label {
  text-align: left;
}

.detail-value {
  text-align: right;
}

@media (max-width: 600px) {
  .currently-grid {
    grid-template-columns: 1fr;
  }

  .currently-left {
    border-right: 0px solid whitesmoke;
  }
  .currently-right {
    padding-right: inherit; /* This matches the box margin */
    margin-right:  0px; /* Reset margin for mobile */
  }

  .currently-detail:first-child {
    border-top: 1px solid whitesmoke;
    padding-top: 20px;
  } 
}

#currently-city {
  font-size: 18px;
}
#currently-current-temp {
  font-size: 50px;
  margin-left: 0px;
  margin-bottom: 0px;

}

#currently-high-low {
  font-size: 14px;
  margin-top: -10px;
  margin-bottom: 1px;
}



#currently-feels-like {
  font-size: 20px;
}
#currently-hour-forecast {
  font-style: italic;
  font-size: 24px;

}

#uvimage {
  max-width: 100%;
  max-height: 100%;
  opacity: 0.7;
  border-radius: 25px;
} 

/* Add to Home Screen styles */

.action-buttons {
  display: grid;
  grid-template-columns: 1fr; /* Single column by default for mobile */
  gap: 12px;
  padding: 10px;
  width: 100%;
  max-width: 400px; /* Maximum width for buttons */
  margin: 0 auto;   /* Center in container */
}

.action-button {
  display: flex; /* Change to Flexbox */
  flex-direction: row; /* Ensure icon and text are in a row */
  align-items: center; /* Vertically center icon and text */
  justify-content: center; /* Horizontally center icon and text */
  gap: 10px; /* Space between icon and text */
  padding: 12px 20px;
  background-color: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  color: white;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  text-align: center; /* Still useful for overall text alignment if needed */
}

/* The CSS rule for your button icons */
.button-icon {
  font-size: 1.2em;
  /* Remove justify-self: end; */
  font-family: "Apple Color Emoji", "Noto Emoji", "Symbola", Verdana, Tahoma, sans-serif; /* Use the custom name */
  font-weight: 500;
  font-style: normal;
}

.button-text {
  font-size: 1.1em;
  /* Remove justify-self: start; */
}

.action-button:hover:not(.disabled) {
  background-color: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
 /* transform: translateY(-2px);  Slight lift effect */
}

.action-button:active:not(.disabled) {
  transform: translateY(0px);
}

.disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.disabled:hover {
  background-color: rgba(255, 255, 255, 0.1);
  transform: none;
}

/* Media query for larger screens - optional if you want horizontal layout on desktop */
@media (min-width: 600px) {
  .action-buttons {
      grid-template-columns: repeat(2, 1fr); /* Three columns on desktop */
      max-width: 800px; /* Larger max-width for desktop */
  }
}



footer a {
  color: whitesmoke;
}

footer a:hover {
  font-weight: bold;
  color: aliceblue;
}

footer a:visited {
  color: whitesmoke;
}

#unsplash-attribution {
  font-size: 12px;
  margin-top: 5px;
  opacity: 0.7;
  color: whitesmoke;
  text-align: center;
}


#uvepalink {
  font-size: 12px;
  margin-top: 5px;
  opacity: 0.7;
  color: whitesmoke;
  text-align: center;
}

#uvepalink:hover {
  font-weight: bold;
  color: white;
}

#refresh-button {
  font-size: 16px;
  color: whitesmoke;
  background-color: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  color: white;
  cursor: pointer;
  text-decoration: none;
  padding: 3px 10px;
  border-radius: 10px;
}

#refresh-button:hover {
  font-style: italic;
  color: white;
}

#refresh-button:active {
 
  color: white;
}


#refresh-now {
  margin-top: 10px;
}
#email {
  font-size: 20px;
  margin-top: 5px;
  opacity: 0.7;
  color: whitesmoke;
  text-align: center;
}

#email:hover {
  font-weight: bold;
  color: white;
}

.weatherapi {
  font-size: 12px;
  margin-top: 5px;
  opacity: 0.7;
  color: whitesmoke;
  text-align: center;
}

/* Terms of Use */

.terms {
 background-color: black;
 font-family: Verdana, Tahoma, Arial, sans-serif;
 color: whitesmoke;
 text-shadow: 1px 1px #03021d;
 font-size: 18px;
 max-width: 800px; 
 height: auto;
 margin: 20px auto;
 padding-left: 20px;
 padding-right: 20px;
 
}

footer.terms-footer {
  font-size: 12px;
  margin: 10px auto;
  padding: 0px;
  opacity: 0.7;
  color: whitesmoke;
  text-align: center;
}

hr {
  color: whitesmoke;
  margin-top:  20px;
  margin-bottom: 20px;
}