/* Global styles */

body {
  font-family: "Rubik", sans-serif;
  font-weight: 300;
  box-sizing: border-box;
  background-color: #a8c0ec;
  position: relative;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-repeat: no-repeat;
  background-attachment: fixed;
  opacity: 0;
  transition: opacity 1s ease-in-out;
  z-index: -1;
}

/* Time of day backgrounds */
body.morning::before {
  background: linear-gradient(to bottom right, #d48c50, #61a4ec);
  opacity: 1;
}

body.day::before {
  background: linear-gradient(to bottom right, #a0d8f0, #f0f0f0);
  opacity: 1;
}

body.evening::before {
  background: linear-gradient(to bottom right, #f57c00, #49126b); /* Sunset-inspired colors */
  opacity: 1;
}
body.night::before {
  background: linear-gradient(to bottom right,#3f33a5, #0a1520 );
  opacity: 1;
}


/* Heading styles */
#globe-weather-div {
  margin-left: 1.3rem;
  color: #333;
}

/* Globe styles */
#globe-container {
    width: 100%;
    height: 100%;
    margin: auto;
}

canvas {
    display: block;
    margin: auto;
}

/* Form and input */
form {
  align-items: stretch;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-top: 1rem;
}

#weather-form {
    position: absolute;
    top: 100px;
    left: 20px;
    z-index: 10;
}

input {
  font-family: "Rubik", sans-serif;
  font-size: 0.9rem;
  flex: 1;
  border: none;
  color: #333;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(4px);
  padding: 0.7rem;
  border-radius: 10px 0 0 10px;
  outline: none;
}

input::placeholder {
  font-weight: 300;
  color: var(--somecolor, rgb(26, 25, 25));
}

#weather-form-btn {
  font-family: "Rubik", sans-serif;
  font-size: 0.9rem;
  padding: 0.7rem;
  color: #333;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 0 10px 10px 0;
  cursor: pointer;
}
/* To ensure that #weather-form-btn does not override .weather-form-btn-night */
.weather-form-btn-day {
  border: none;
}

/* For night background */
.input-night{
  border-top: 1px solid white;
  border-bottom: 1px solid white;
  border-left: 1px solid white;
  border-right: none;
}

.weather-form-btn-night {
  border-top: 1px solid white;
  border-bottom: 1px solid white;
  border-right: 1px solid white;
  border-left: none;
}

/* Weather card */

.weather-card {
    position: absolute;
    top: 200px;
    left: 20px;
    width: fit-content;
    z-index: 10;
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 10px;
    box-shadow: 0 0 12px rgba(7, 7, 7, 0.15);
    backdrop-filter: blur(4px);
}

/* Weather card location info */
.weather-location {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.temp-unit {
  font-size: 0.5em;
  vertical-align: super;
  margin-left: 2px;
}

#loading-message {
    position: absolute;
    top: 180px;
    left: 20px;
    z-index: 10;
    font-style: italic;
    color: #333;
}

#weather-output {
    position:absolute;
    top: 200px;
    left: 20px;
    z-index: 10;
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 4px;
}

/* Weather card main info */

.weather-main {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
}

.weather-temp-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.weather-temp-info .main-temp {
    font-size: 3rem;
}

.weather-temp-info #condition {
    font-size: 1rem;
    font-weight: bold;
}

.weather-temp-info #feels-like {
    font-size: 1rem;
}  

/* #weather-temp {
    font-weight: bold;
} */

#weather-icon {
  width: 80px;
  height: 80px;
}

.hidden {
    display: none;
}

/* Other weather info */

.weather-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 1rem;
  font-size: 1rem;
}


/* Pulse Animations for high uv*/
@keyframes pulse-uv-red {
  0%   { box-shadow: 0 0 0 0 rgba(240, 12, 5, 0.5);
         opacity: 1; }
  100% { box-shadow:  0 0 0 10px rgba(255, 0, 0, 0);
         opacity: 1; }
}

.pulse-uv-red {
  animation: pulse-uv-red 4s infinite ease-out;
  font-weight: bold;
  color: #fff;
}

@keyframes pulse-uv-orange {
  0%   { box-shadow: 0 0 0 0 rgba(255, 165, 0, 0.5);
         opacity: 1; }
  100% { box-shadow:  0 0 0 10px rgba(255, 0, 0, 0);
         opacity: 1; }
}

.pulse-uv-orange {
  animation: pulse-uv-orange 4s infinite ease-out;
  font-weight: bold;
  color: #333;
}

@keyframes pulse-uv-extreme {
  0%   { box-shadow: 0 0 0 0 rgba(86, 0, 139, 0.5);
         opacity: 1; }
  100% { box-shadow:  0 0 0 10px rgba(255, 0, 0, 0);
         opacity: 1; }
}

.pulse-uv-extreme {
  animation: pulse-uv-extreme 4s infinite ease-out;
  font-weight: bold;
  color: #fff;
}

.uv-low {
  color: #333;
}

#uv {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 400;
}

/* Info button and modal */

#info-icon {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 10;
  font-size: 30px;
  cursor: pointer;
  color: #333;
}

.info-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.7);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 20;
  backdrop-filter: blur(4px);
}

#close-info-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 12px;
}
