/* Transparent Glass Dashboard with Background Images */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Roboto Flex", "Segoe UI", sans-serif;
  font-weight: 300;
  background: #1a1a1a;
  /* Fallback if no image loads */
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  min-height: 100vh;
  color: #ffffff;
}

@media (max-width: 768px) {
  body {
    background-attachment: scroll; /* Change to scroll on mobile */
  }
}

.dashboard {
  max-width: 1400px;
  margin: 0 auto;
  padding: 8px 20px;
}

header {
  text-align: center;
  margin-bottom: 20px;
  color: #ffffff;
}

header h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
  font-weight: 300;
  color: #ffffff;
  text-shadow:
    0 0 20px rgba(0, 0, 0, 0.9),
    2px 2px 8px rgba(0, 0, 0, 0.8),
    4px 4px 16px rgba(0, 0, 0, 0.7),
    -1px -1px 4px rgba(0, 0, 0, 0.6);
}

.header-info {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
}

.current-time {
  font-size: 1.3rem;
  color: #ffffff;
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.8);
  opacity: 0.9;
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 25px;
}

@media (orientation: portrait) and (min-width: 769px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (orientation: landscape) and (min-width: 1401px) {
  .grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.widget {
  background: rgba(0, 0, 0, 0.08);
  border-radius: 20px;
  padding: 30px 30px 15px;
  backdrop-filter: blur(3px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.widget.weather-widget {
  padding: 30px 20px 15px;
}

.widget h2 {
  color: #ffffff;
  margin-bottom: 25px;
  font-size: 1.8rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.7);
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 15px;
}
.widget.weather-widget h2 {
  margin-bottom: 20px;
}

.widget.news-widget h2 {
  margin-bottom: 8px;
}

.widget-content {
  min-height: 200px;
}

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: #ffffff;
  font-style: italic;
  font-size: 1.1rem;
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.7);
}

/* Weather Widget Styles */
.weather-display {
  text-align: center;
}

.weather-main {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 25px;
  margin-bottom: 10px;
}

.weather-temp {
  font-size: 4rem;
  font-weight: 600;
  letter-spacing: .5px;
  color: #ffffff;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
}

.weather-icon {
  width: 90px;
  height: 90px;
  filter: drop-shadow(2px 2px 8px rgba(0, 0, 0, 0.5));
}

/* Today's High/Low Styles */
.today-high-low {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 15px;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: .5px;
}

.today-high {
  color: #ff6b47; /* Warm orange/red for high */
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.7);
}

.today-low {
  color: #87ceeb; /* Cool blue for low */
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.7);
}

.today-high::after {
  content: " H";
  font-size: 0.8em;
  opacity: 0.8;
}

.today-low::after {
  content: " L";
  font-size: 0.8em;
  opacity: 0.8;
}

.weather-description {
  font-size: 1.4rem;
  color: #ffffff;
  text-transform: capitalize;
  margin-bottom: 24px;
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.7);
}

.weather-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 15px;
  text-align: center;
  margin-bottom: 30px;
}

.weather-detail {
  padding: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.weather-detail-label {
  margin-bottom: 4px;
  font-size: 0.9rem;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.8;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

.weather-detail-value {
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: .5px;
  color: #ffffff;
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.7);
}

.weather-hourly h3,
.weather-forecast h3 {
  font-size: 1.3rem;
  color: #ffffff;
  margin-bottom: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-top: 20px;
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.7);
}

.hourly-timeline {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 15px;
  margin-bottom: 25px;
  max-width: 402px;
}

.hourly-item {
  flex: 0 0 auto;
  text-align: center;
  padding: 12px 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  min-width: 70px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.hourly-time {
  font-size: 0.85rem;
  color: #ffffff;
  font-weight: 600;
  letter-spacing: .5px;
  margin-bottom: 4px;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

.hourly-description {
  font-size: 0.7rem;
  color: #ffffff;
  text-transform: capitalize;
  margin-bottom: 5px;
  line-height: 1.1;
  opacity: 0.9;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
  min-height: 28px; /* Ensures consistent spacing */
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  max-width: 70px; /* Matches the hourly item width */
  word-wrap: break-word;
  hyphens: auto;
}

.hourly-icon {
  width: 36px;
  height: 36px;
  filter: drop-shadow(1px 1px 4px rgba(0, 0, 0, 0.5));
}

.hourly-temp {
  font-weight: 600;
  color: #ffffff;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
  margin-bottom: 3px;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

.hourly-rain {
  font-size: 0.75rem;
  color: #87ceeb;
  font-weight: 600;
  letter-spacing: .5px;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

.forecast-days {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.forecast-day {
  text-align: center;
  flex: 1;
  padding: 15px 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.forecast-day-name {
  font-size: 0.9rem;
  color: #ffffff;
  font-weight: 600;
  letter-spacing: .5px;
  margin-bottom: 5px;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

.forecast-icon {
  width: 45px;
  height: 45px;
  filter: drop-shadow(1px 1px 4px rgba(0, 0, 0, 0.5));
}

.forecast-temps {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.forecast-description {
  font-size: 0.8rem;
  color: #ffffff;
  text-transform: capitalize;
  margin-bottom: 8px;
  line-height: 1.2;
  opacity: 0.9;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
  min-height: 32px; /* Ensures consistent spacing even for short descriptions */
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.forecast-high {
  font-weight: 600;
  letter-spacing: .5px;
  color: #ffffff;
  font-size: 1rem;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

.forecast-low {
  color: #ffffff;
  font-size: 0.9rem;
  opacity: 0.8;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

/* Air Quality Widget Styles */

.air-quality-widget .widget-content {
  overflow: hidden;
}

.air-quality-display {
  text-align: center;
}

.aqi-main {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 25px;
  margin-bottom: 25px;
}

.aqi-value {
  font-size: 4rem;
  font-weight: 600;
  letter-spacing: .5px;
  color: #000000;
  padding: 17px 25px 14px;
  border-radius: 20px;
  min-width: 120px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.aqi-status {
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: .5px;
  margin-bottom: 20px;
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.7);
}

.aqi-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  text-align: center;
}

.aqi-detail {
  padding: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.aqi-detail-label {
  margin-bottom: 4px;
  font-size: 0.9rem;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.8;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

.aqi-detail-value {
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: .5px;
  color: #ffffff;
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.7);
}

/* Calendar Widget Styles - More opaque for readability */
.calendar-widget {
  background: rgba(0, 0, 0, 0.4);
}

.calendar-widget .widget-content {
  max-height: 400px;
  overflow-y: auto; /* Enable vertical scrolling */
  padding-right: 12px; /* Add some space for the scrollbar */
  /* Make Firefox scrollbar less ugly */
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.4) transparent;
}

/* Custom scrollbar styling for calendar widget */
.calendar-widget .widget-content::-webkit-scrollbar {
  width: 8px;
}

.calendar-widget .widget-content::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.calendar-widget .widget-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
}

.calendar-widget .widget-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

.calendar-event {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 15px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.calendar-event:last-child {
  border-bottom: none;
}

.event-info {
  flex: 1;
}

.event-title {
  font-weight: 600;
  letter-spacing: .5px;
  color: #ffffff;
  margin-bottom: 6px;
  font-size: 1.1rem;
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.7);
}

.event-time {
  color: #ffffff;
  font-size: 1rem;
  opacity: 0.9;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

.event-date {
  background: rgba(82, 71, 227, 0.8);
  /* background: rgba(236, 110, 76 .8); */
  color: white;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: .5px;
  white-space: nowrap;
  margin-left: 15px;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.no-events {
  text-align: center;
  color: #ffffff;
  font-style: italic;
  padding: 40px 0;
  font-size: 1.1rem;
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.7);
}

/* News Widget Styles - No longer spans columns */
.news-widget {
  background: rgba(0, 0, 0, 0.4);
}

.news-item {
  padding: 15px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.news-item:last-child {
  border-bottom: none;
}

.news-title {
  font-weight: 600;
  letter-spacing: .5px;
  letter-spacing: .5px;
  color: #ffffff;
  margin-bottom: 6px;
  line-height: 1.3;
  font-size: 0.95rem;
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.7);
}

.news-title a {
  color: inherit;
  text-decoration: none;
}

.news-title a:hover {
  color: #87ceeb;
}

.news-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 0.8rem;
  color: #ffffff;
  opacity: 0.8;
}

.news-source {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: 4px 8px;
  border-radius: 6px;
  font-weight: 600;
  letter-spacing: .5px;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

.news-description {
  color: #ffffff;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  opacity: 0.9;
  font-size: 0.9rem;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

.update-info {
  display: flex;
  justify-content: center;
}

.last-updated {
  font-size: .9rem;
  color: #ffffff;
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.8);
  opacity: 0.9;
}

/* Error States */
.error {
  color: #ff6b6b;
  text-align: center;
  padding: 20px;
  background: rgba(255, 107, 107, 0.2);
  border-radius: 12px;
  border: 1px solid rgba(255, 107, 107, 0.3);
  font-weight: 600;
  letter-spacing: .5px;
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.7);
}

/* Responsive Design */
@media (max-width: 1200px) {
  .news-widget {
    grid-column: span 1;
  }
}

@media (max-width: 768px) {
  .dashboard {
    padding: 15px;
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .widget {
    min-width: 0;
    overflow-x: auto;
  }

  .weather-main {
    flex-direction: column;
    gap: 15px;
  }

  .weather-details {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .calendar-event {
    flex-direction: column;
    align-items: flex-start;
  }

  .event-date {
    margin-left: 0;
    margin-top: 10px;
  }

  header h1 {
    font-size: 2.5rem;
  }

  .hourly-timeline {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
  }

  .forecast-days {
    flex-wrap: wrap;
  }
}

.weather-alerts {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.weather-alerts h3 {
  color: #ffffff;
  margin-bottom: 15px;
  font-size: 1.3rem;
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.7);
}

.weather-alert {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  margin-bottom: 10px;
  overflow: hidden;
}

.alert-header {
  padding: 12px 15px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.2);
}

.alert-title {
  font-weight: 600;
  color: #ffffff;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

.alert-toggle {
  color: #ffffff;
  transition: transform 0.3s;
}

.weather-alert.expanded .alert-toggle {
  transform: rotate(180deg);
}

.alert-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.weather-alert.expanded .alert-content {
  max-height: 410px;
  padding: 15px;
}

.alert-headline {
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 10px;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

.alert-description {
  color: #ffffff;
  line-height: 1.4;
  opacity: 0.9;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}