/*BASE*/

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 15px;

  background-color: #2b2b2b;
  background-repeat: no-repeat;
  background-position: center;
  background-attachment: fixed;
  background-size: cover;
  background-image: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3));
  background-blend-mode: overlay;
  transition: background-image 1s ease-in-out;

  color: white;
  font-family: "Funnel Display", sans-serif;
  font-optical-sizing: auto;
  font-weight: 500;
  font-style: normal;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

main {
  height: calc(100vh - 30px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/*TOP PAGE*/

.top-page {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

#news,
#weather {
  padding: 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/*News*/

#news-container {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding-right: 10px;
}

#news {
  max-width: 400px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: background 0.3s ease;
  background: transparent;
  border: none;
  padding: 10px;
  position: relative;
}

#news:hover {
  background: rgba(255, 255, 255, 0.2);
}

#news:hover::after {
  content: " (Click to read article)";
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.9);
  margin-left: 10px;
  font-style: italic;

  /* Positioning it as a floating tooltip */
  position: absolute;
  left: 0;
  top: -30px;
  background: rgba(0, 0, 0, 0.8);
  padding: 4px 10px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
}

#news:active {
  transform: scale(0.98);
}

#refresh-news {
  background: transparent;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 1.2rem;
  opacity: 0.6;
  transition:
    opacity 0.3s,
    transform 0.3s;
}

#refresh-news:hover {
  opacity: 1;
  transform: rotate(90deg);
}

/*Weather*/

#weather {
  display: flex;
  align-items: center;
  font-weight: normal;
  gap: 12px;
  padding: 10px 15px;
}

#weather img {
  width: 40px;
}

.weather-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.weather-temp {
  font-size: 1.6rem;
  margin: 0;
  font-weight: 800;
}

.weather-city {
  font-size: 0.75rem;
  opacity: 0.7;
  margin-top: 2px;
}

.weather-desc {
  font-size: 0.85rem;
  text-transform: capitalize;
  opacity: 0.9;
}

#weather:hover {
  background: rgba(255, 255, 255, 0.2);
  cursor: default;
}

/*CENTER*/

.center-container {
  align-self: center;
  text-align: center;
}

/*Time*/

.time {
  margin: 0;
  font-size: 5rem;
  font-weight: 800;
}

/*Greeting*/

#greeting {
  font-size: 1.8rem;
  font-weight: 500;
  margin: 0 0 5px 0;
  opacity: 0.9;
}

/*Search*/

#search-form input {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  padding: 10px 20px;
  color: white;
  width: 300px;
  margin-top: 20px;
  backdrop-filter: blur(5px);
  outline: none;
  transition: width 0.3s ease;
}

#search-form input:focus {
  width: 400px;
  background: rgba(255, 255, 255, 0.3);
}

#search-form input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

/*BOTTOM PAGE*/

/*Footer*/

#footer {
  display: flex;
  align-items: center;
  gap: 10px;
}

#refresh-bg {
  background: rgba(0, 0, 0, 0.3);
  border: none;
  color: white;
  cursor: pointer;
  border-radius: 50%;
  width: 25px;
  height: 25px;
  display: flex;
  justify-content: center;
  align-items: center;
  transition:
    transform 0.3s ease,
    background 0.2s;
}

#refresh-bg:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(180deg);
}

/*Author*/

#author-container {
  align-self: flex-start;
  min-height: 20px;
  min-width: 100px;
  align-self: flex-start;
  font-size: 0.8rem;
  opacity: 0.8;
  background: rgba(0, 0, 0, 0.4);
  padding: 5px 10px;
  border-radius: 4px;
  backdrop-filter: blur(2px);
}
