*, *::before, *::after {
  box-sizing: border-box;
}

.weather-widget {
  position: relative;
  background: white;
  border: 2px solid #cbd5e1;
  padding: 10px;
  border-radius: 12px;
  text-align: center;
  font-family: sans-serif;
  box-shadow: 0 4px 8px rgba(0,0,0,0.05);
  min-height: 300px;
  width: 280px;
  max-width: 280px;
}

/* Weather Skeleton */
.weather-skeleton {
  position: absolute; /* <--- prevent stacking */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  opacity: 1;
  padding: 10px;
}

.weather-skeleton.vanish {
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  animation: none;
}

.skeleton-location{
    width: 80%;
    height: 20px;
}

.skeleton-main {
  display: flex;
  justify-content: space-between;
  width: 100%;
}

.skeleton-current, .skeleton-forecast {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.skeleton-forecast {
  justify-content: space-around;
  gap: 12px
}

.skeleton-forecast-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 100%;
}

/* Core skeleton blocks */
.skeleton {
  background-color: #e2e8f0;
  border-radius: 8px;
  animation: skeleton-pulse 1.5s infinite ease-in-out;
}

.weather-skeleton.vanish .skeleton {
  animation: none;
}

.skeleton-text {
  height: 20px;
  width: 70%;
}

.skeleton-text.short {
  width: 50%;
}

.skeleton-text.tiny {
  width: 40%;
}

.skeleton-text.big {
  width: 45px;
  height: 45px;
}

.skeleton-text.small {
  width: 60%;
}

.skeleton-icon {
  width: 65px;
  height: 65px;
}

.skeleton-icon.small {
  width: 45px;
  height: 45px;
}

.skeleton-icon.tiny {
  width: 24px;
  height: 24px;
}

.skeleton-currently, .skeleton.forecast{
    height: 18px;
    width: 80%;
}

/* Pulse Animation */
@keyframes skeleton-pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
  100% {
    opacity: 1;
  }
}

/*End*/

.weather-real {
  opacity: 0;
  transition: opacity 0.6s ease-in-out;
}

.weather-real.loaded{
  opacity: 1;
}

.weather-location {
  font-weight: bold;
  font-size: 1rem;
  margin-bottom: 8px;
  color: #334155;
}

.weather-main {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  margin-bottom: 1rem;
}

.weather-current {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  flex: 1;
  text-align: center;
  border-right: 1px solid #d6dce8;
  padding-right: 8px;
}

.current_wx {
    margin-bottom: 5px;
}

.weather-icon {
  width: 60px;
  height: 60px;
}

.weather-temp {
  font-size: 2rem;
  font-weight: bold;
  margin: 6px 0;
}

.weather-desc {
  font-size: 1rem;
  color: #475569;
  margin-bottom: 6px;
}

.weather-highlow {
  font-size: 16px;
  color: #475569;
  margin-top: 0.25rem;
}

.rain-chance {
  font-size: 14px;
  color: #64748b; /* subtle slate-gray */
  margin-bottom: 4px;
}

.weather-forecast {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  gap: 15px;
  padding-left: 5px;
}

.weather-day {
  text-align: center;
}

.forecast-icon {
  width: 40px;
  height: 40px;
  margin: 0.25rem 0;
}

.weather-alert-cont {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-bottom: 5px;
}

.weather-radar {
    width:100%;
    margin-top: 10px;
}

.weather-radar-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.5rem;
  background-color: #eef2f6;
  padding: 6px 12px;
  border-radius: 10px;
  border: 2px solid #1a202c;
  text-decoration: none;
  font-weight: 600;
  color: #1a202c;
  font-size: 0.95rem;
  transition: background-color 0.3s ease; 
}

.weather-radar-link{
    width:100%;
}

.weather-radar-link:hover {
  background-color: #1a202c;
  color: white;
}

.radar-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  transition: background-color 0.3s ease;
}

.weather-radar-link:hover .radar-icon{
  background-color: gold;
}

.weather-radar-link svg {
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.weather-alert {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    border: 1px solid #ef4444;
    border-radius: 10px;
    padding: 2px 8px 4px;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    background-color: #fff;
    overflow-wrap: break-word;
    word-break: break-word;
}

.alert-toggle {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.alert-dropdown-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: none;
  border: none;
  font-weight: 600;
  font-size: 0.95rem;
  color: #ef4444; /* light red alert text */
  cursor: pointer;
}

.chevron-icon {
  width: 26px;
  height: 26px;
  transition: transform 0.3s ease;
  transform-origin: center;
  color: #475569; 
  fill: currentColor; 
}

/* Chevron rotates when open */
.alert-toggle.open .chevron-icon {
  transform: rotateX(180deg);
}

.alert-details {
  display: none;
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: #475569;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  line-height: 1.6;
  max-width: 100%;
}

/*Weather Pill for Mobile*/
.weather-pill {
  position: relative;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-evenly;
  background: white;
  padding: 6px 8px;
  border: 2px solid #cbd5e1;
  border-radius: 10px; /* perfect pill shape */
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  font-family: sans-serif;
  width: 100%;
  max-width: 650px;
  margin: 0 auto 12px;
  min-height: 50px; /* gives it breathing room while skeleton animates */
  overflow: hidden;
}

.weather-pill.history {
    gap: 0;
}

.weather-pill::before {
  content: "";
  position: absolute;
  width: 90%;
  height: 80%;
  background-color: #e2e8f0;
  border-radius: 8px;
  animation: skeleton-pulse 1.5s infinite ease-in-out;
  z-index: 1;
}

.weather-pill.vanish::before {
  animation: none;
  display: none;
}

/* Pulse animation keyframes */
@keyframes skeleton-pulse {
  0% {
    opacity: .9;
  }
  50% {
    opacity: 0.4;
  }
  100% {
    opacity: 9;
  }
}

@media(min-width: 801px){
    .weather-pill{
        display: none;   
    }
}

/* Specifics for each pill child */
.pill-els{
  transition: all 0.4s ease;
  margin: 0 5px;
}

.pill-city{
  font-size: 18px;
}

.pill-icon{
  height: 40px;
  width: 40px;
  max-width: 40px;
}

.pill-icon img{
  height: 40px;
  width: 40px;
  max-width: 40px;
}

.pill-temp{
  font-size: 24px;
  font-weight: bold;
}

.pill-hi-lo{
    color: #64748b;
    font-weight: 600;
    display: none;
}

@media(min-width: 440px){

    .pill-hi-lo {
        display: flex;
    }
}

.pill-radar{
    padding: 4px 12px;
    display: none;
}

@media(min-width: 630px){

    .pill-radar.loaded {
        display: flex;
    }
}