/* Nilu Live Weather Effect - first/landing page only
   Canvas based weather visuals with real GPS location only.
*/
:root {
  --nilu-weather-z: 9997;
}

.nilu-weather-effect {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: var(--nilu-weather-z);
  opacity: 0;
  transition: opacity 700ms ease;
  mix-blend-mode: screen;
}

body.weather-ready .nilu-weather-effect {
  opacity: 1;
}

body.weather-location-needed .nilu-weather-effect {
  opacity: 0;
}

.nilu-weather-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.nilu-weather-status {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: calc(var(--nilu-weather-z) + 2);
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: min(92vw, 390px);
  padding: 10px 13px;
  border-radius: 999px;
  background: rgba(10, 20, 34, 0.62);
  border: 1px solid rgba(255,255,255,.22);
  color: #fff;
  font: 700 12px/1.25 Arial, Helvetica, sans-serif;
  letter-spacing: .1px;
  box-shadow: 0 12px 30px rgba(0,0,0,.22);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .5s ease, transform .5s ease;
}

body.weather-ready .nilu-weather-status,
body.weather-location-needed .nilu-weather-status {
  opacity: 1;
  transform: translateY(0);
}

.nilu-weather-status.is-quiet {
  opacity: .36;
}


/* Top-right live city + temperature badge */
.nilu-weather-widget {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: calc(var(--nilu-weather-z) + 4);
  width: min(370px, calc(100vw - 28px));
  font-family: Arial, Helvetica, sans-serif;
  color: #fff;
  pointer-events: none;
}

.nilu-weather-badge {
  width: auto;
  margin-left: auto;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 999px;
  padding: 8px 10px 8px 9px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  background: linear-gradient(135deg, rgba(9, 21, 42, .78), rgba(15, 63, 116, .66));
  box-shadow: 0 16px 38px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.18);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  cursor: pointer;
  pointer-events: auto;
  transition: transform .22s ease, box-shadow .22s ease, background .22s ease;
}

body.weather-location-needed .nilu-weather-badge {
  background: linear-gradient(135deg, rgba(43, 30, 13, .82), rgba(106, 72, 18, .68));
}

.nilu-weather-badge:hover,
.nilu-weather-badge:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 19px 45px rgba(0,0,0,.34), inset 0 1px 0 rgba(255,255,255,.22);
  outline: none;
}

.nilu-weather-badge-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  font-size: 19px;
  flex: 0 0 auto;
}

.nilu-weather-badge-text {
  display: grid;
  gap: 1px;
  text-align: left;
  min-width: 0;
}

.nilu-weather-badge-text strong {
  display: block;
  max-width: 202px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font: 800 13px/1.15 Arial, Helvetica, sans-serif;
  letter-spacing: .1px;
}

.nilu-weather-badge-text small {
  display: block;
  max-width: 230px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: rgba(255,255,255,.82);
  font: 700 11px/1.2 Arial, Helvetica, sans-serif;
}

.nilu-weather-badge-arrow {
  font-size: 12px;
  opacity: .9;
  transition: transform .22s ease;
}

.nilu-weather-widget.is-open .nilu-weather-badge-arrow {
  transform: rotate(180deg);
}

.nilu-weather-forecast {
  pointer-events: auto;
  margin-top: 10px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 22px;
  background: linear-gradient(160deg, rgba(8, 18, 34, .92), rgba(14, 48, 82, .84));
  box-shadow: 0 24px 64px rgba(0,0,0,.34);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  overflow: hidden;
  animation: niluForecastIn .22s ease both;
}

.nilu-weather-forecast-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 14px 11px;
  border-bottom: 1px solid rgba(255,255,255,.13);
}

.nilu-weather-forecast-head strong {
  display: block;
  font: 900 14px/1.25 Arial, Helvetica, sans-serif;
}

.nilu-weather-forecast-head span {
  display: block;
  margin-top: 3px;
  color: rgba(255,255,255,.76);
  font: 700 11px/1.3 Arial, Helvetica, sans-serif;
}

.nilu-weather-close {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 50%;
  background: rgba(255,255,255,.10);
  color: #fff;
  cursor: pointer;
  font: 900 19px/1 Arial, Helvetica, sans-serif;
}

.nilu-weather-days {
  display: grid;
  gap: 9px;
  max-height: min(70vh, 440px);
  overflow-y: auto;
  padding: 12px;
}

.nilu-weather-day-card {
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px;
  padding: 10px;
  background: rgba(255,255,255,.085);
}

.nilu-weather-day-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.nilu-weather-day-top strong {
  font: 900 13px/1.2 Arial, Helvetica, sans-serif;
}

.nilu-weather-day-top span {
  font-size: 20px;
}

.nilu-weather-day-card p {
  margin: 5px 0 8px;
  color: rgba(255,255,255,.83);
  font: 700 12px/1.35 Arial, Helvetica, sans-serif;
}

.nilu-weather-day-temp {
  display: grid;
  grid-template-columns: auto auto auto auto;
  align-items: baseline;
  gap: 4px 7px;
  color: #fff;
}

.nilu-weather-day-temp b {
  font: 900 16px/1 Arial, Helvetica, sans-serif;
}

.nilu-weather-day-temp small,
.nilu-weather-rain-chance {
  color: rgba(255,255,255,.72);
  font: 700 11px/1.2 Arial, Helvetica, sans-serif;
}

.nilu-weather-rain-chance {
  margin-top: 8px;
}

.nilu-weather-loading {
  padding: 18px;
  text-align: center;
  color: rgba(255,255,255,.84);
  font: 800 12px/1.4 Arial, Helvetica, sans-serif;
}

@keyframes niluForecastIn {
  from { opacity: 0; transform: translateY(-8px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 680px) {
  .nilu-weather-status {
    left: 10px;
    right: 10px;
    bottom: 10px;
    justify-content: center;
    white-space: normal;
    text-align: center;
  }

  .nilu-weather-widget {
    top: 8px;
    right: 8px;
    width: min(342px, calc(100vw - 16px));
  }

  .nilu-weather-badge {
    padding: 7px 9px;
  }

  .nilu-weather-badge-text strong {
    max-width: 150px;
  }

  .nilu-weather-badge-text small {
    max-width: 172px;
  }

  .nilu-weather-forecast {
    border-radius: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nilu-weather-effect {
    transition: none !important;
  }
}

/* Accuracy update: refresh button + live condition card */
.nilu-weather-actions {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
}

.nilu-weather-refresh {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 50%;
  background: rgba(255,255,255,.10);
  color: #fff;
  cursor: pointer;
  font: 900 15px/1 Arial, Helvetica, sans-serif;
  display: grid;
  place-items: center;
}

.nilu-weather-refresh:hover,
.nilu-weather-close:hover,
.nilu-weather-refresh:focus-visible,
.nilu-weather-close:focus-visible {
  background: rgba(255,255,255,.18);
  outline: none;
}

.nilu-weather-live-card {
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 18px;
  padding: 11px;
  background: linear-gradient(135deg, rgba(255,255,255,.14), rgba(255,255,255,.07));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
}

.nilu-weather-live-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.nilu-weather-live-top strong {
  font: 900 14px/1.2 Arial, Helvetica, sans-serif;
}

.nilu-weather-live-top small,
.nilu-weather-live-card em {
  color: rgba(255,255,255,.70);
  font: 800 10px/1.25 Arial, Helvetica, sans-serif;
  font-style: normal;
}

.nilu-weather-live-card p {
  margin: 8px 0 10px;
  color: rgba(255,255,255,.88);
  font: 800 12px/1.35 Arial, Helvetica, sans-serif;
}

.nilu-weather-live-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 8px;
}

.nilu-weather-live-grid span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  padding: 7px 8px;
  border-radius: 12px;
  background: rgba(255,255,255,.085);
  color: rgba(255,255,255,.75);
  font: 800 10px/1.2 Arial, Helvetica, sans-serif;
}

.nilu-weather-live-grid b {
  color: #fff;
  font: 900 12px/1 Arial, Helvetica, sans-serif;
}
