:root {
  /* Light Mode Colors */
  --bg-color-light: rgba(255, 255, 255, 0.3);
  --bg-color-dark: rgba(0, 0, 0, 0.7);
  --text-color-light: black;
  --text-color-dark: white;
  --box-shadow-color-light: rgba(0, 0, 0, 0.1);
  --box-shadow-color-dark: rgba(255, 255, 255, 0.1);
  --hover-box-shadow-light: rgba(0, 0, 0, 0.2);
  --hover-box-shadow-dark: rgba(255, 255, 255, 0.2);
  --top-bar-text-light: rgb(0, 0, 0);
  --top-bar-text-dark: black;
}

/* Dark Mode Styles */
.dark-mode {
  --bg-color-light: rgba(0, 0, 0, 0.558);
  --text-color-light: rgb(255, 255, 255);
  --box-shadow-color-light: rgba(255, 255, 255, 0.1);
  --box-shadow-color-dark: rgba(255, 255, 255, 0.2);
  --hover-box-shadow-light: rgba(255, 255, 255, 0.2);
  --hover-box-shadow-dark: rgba(0, 0, 0, 0.2);
  --top-bar-text-light: rgb(247, 137, 255);
  --top-bar-text-dark: rgb(255, 255, 255);
}

/* Apply Variables */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  background: linear-gradient(to bottom right, #94c1eb, #fdbb57);
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  color: var(--text-color-light);
}

/* Weather Dashboard */
.weather-dashboard {
  margin-top: 100px;
  margin-bottom: 100px;
  width: 90%;
  max-width: 1900px;
  background: var(--bg-color-light);
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 6px 20px var(--box-shadow-color-light);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--text-color-light);
}

/* Top Bar Styles */
.top-bar {
  display: flex;
  justify-content: space-between;
  margin-bottom: 15px;
  background: var(--top-bar-bg-light);
  color: var(--top-bar-text-light);
  padding: 8px;
  border-radius: 4px;
  transition: background 0.3s ease, color 0.3s ease;
}

/* Top Bar Input Styles */
.top-bar input {
  flex: 1;
  padding: 8px 16px;
  font-size: 14px;
  border: none;
  border-radius: 40px;
  background: rgba(255, 255, 255, 0.3);
  color: var(--text-color-light);
  outline: none;
  transition: background 0.3s ease, transform 0.3s ease;
}

/* Focused state for input */
.top-bar input:focus {
  background: rgba(255, 255, 255, 0.5);
  transform: scale(1.02);
}

.top-bar button {
  padding: 8px 16px;
  font-size: 14px;
  background: var(--top-bar-bg-light);
  color: var(--top-bar-text-light);
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.top-bar button:hover {
  background: var(--hover-box-shadow-light);
}

/* Layout for Dashboard Content */
.dashboard-content {
  display: flex;
  gap: 30px;
  align-items: center;
  justify-content: space-evenly;
  flex-wrap: wrap;
}

/* Current Weather Section */
.current-weather {
  flex: 1;
  background: var(--bg-color-light);
  padding: 10px;
  max-width: 500px;
  text-align: center;
  border-radius: 8px;
  box-shadow: 0 2px 8px var(--box-shadow-color-light);
  transition: transform 300ms ease;
  transform: translateZ(0) scale(1.02) perspective(1000px);
  color: var(--text-color-light);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: transform 300ms ease, background 0.5s ease;
  backdrop-filter: blur(6px);
}

.current-weather:hover {
  transform: scale(1.1) perspective(1500px) rotateY(10deg);
}

/* Weather Info */
.weather-info {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.weather-temp {
  font-size: 30px;
  font-weight: bold;
  margin: 8px 0;
}

.feels-like-temp {
  font-size: 14px;
  margin-bottom: 8px;
}

.weather-desc {
  font-size: 14px;
  font-style: italic;
  color: var(--text-color-light);
}

/* Forecast Section */
.forecast {
  flex: 2;
  background: var(--bg-color-light);
  padding: 10px;
  border-radius: 8px;
  box-shadow: 0 2px 8px var(--box-shadow-color-light);
  backdrop-filter: blur(6px);
}

/* Forecast Grid Layout */
.forecast-container {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

/* Day Card Styles */
.day-card {
  background: rgba(255, 255, 255, 0.2);
  padding: 6px;
  text-align: center;
  border-radius: 6px;
  box-shadow: 0 2px 4px var(--box-shadow-color-light);
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease, padding 0.3s ease;
  backdrop-filter: blur(6px);
  color: var(--text-color-light);
  max-width: 140px;
  margin: 0 auto;
}

.day-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 3px 12px var(--hover-box-shadow-light);
  background: rgba(255, 255, 255, 0.3);
}

.day-card.active {
  background: rgba(255, 255, 255, 0.3);
  padding-bottom: 12px;
}

/* Hourly Forecast Styles */
.hourly-forecast {
  display: none;
  margin-top: 6px;
  text-align: left;
  background: var(--bg-color-light);
  border-radius: 6px;
  padding: 6px;
  box-shadow: inset 0 2px 4px var(--box-shadow-color-light);
  max-height: 200px;
  overflow-y: scroll;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.hourly-forecast::-webkit-scrollbar {
  width: 5px;
}

.hourly-forecast::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.4);
  border-radius: 8px;
}

.hourly-forecast::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.6);
}

.hourly-forecast {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.4) transparent;
}

.hourly-forecast:hover {
  overflow-y: auto;
}

.day-card.active .hourly-forecast {
  display: block;
}

/* Hourly Card Styles */
.hour-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 3px 0;
  padding: 3px;
  border-radius: 4px;
  background: var(--bg-color-light);
  box-shadow: 0 1px 2px var(--box-shadow-color-light);
  color: var(--text-color-light);
}

.hour-card img {
  width: 16px;
  height: 16px;
}

/* Map Section */
.map-container {
  flex: 4;
  width: 100%;
  max-width: 500px;
  padding: 15px;
  background: var(--bg-color-light);
  border-radius: 15px;
  box-shadow: 0 2px 10px var(--box-shadow-color-light);
  backdrop-filter: blur(8px);
  transition: transform 300ms ease;
  transform: translateZ(0) scale(1.02) perspective(1000px);
}

.map-container:hover{
  transform: scale(1.1) perspective(1500px) rotateY(-10deg);
}

#map {
  height: 400px;
  width: 100%;
  border-radius: 10px;
  box-shadow: 0 2px 5px var(--box-shadow-color-light);
}

/* News Section */
.news-section {
  display: flex;
  gap: 30px;
  justify-content: left;
  flex-wrap: wrap;
  margin-top: 20px;
}

/* Mini News Container */
.mini-news-container {
  width: 150px;
  background: var(--bg-color-light);
  border-radius: 8px;
  padding: 8px;
  text-align: center;
  box-shadow: 0 2px 8px var(--box-shadow-color-light);
  color: var(--text-color-light);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.mini-news-container:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 15px var(--hover-box-shadow-light);
}

/* News Image */
.news-image {
  width: 100%;
  height: 100px;
  border-radius: 4px;
  object-fit: cover;
  margin-bottom: 5px;
}

/* News Title */
.news-title {
  font-size: 12px;
  font-weight: bold;
  margin: 5px 0;
  color: var(--text-color-light);
  line-height: 1.2;
}

/* News Publisher */
.news-publisher {
  font-size: 10px;
  color: rgb(255, 255, 255);
  margin-bottom: 5px;
}

/* News Button */
.news-button {
  padding: 4px 8px;
  font-size: 10px;
  background: var(--hover-box-shadow-light);
  color: var(--text-color-light);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.news-button:hover {
  background: var(--hover-box-shadow-dark);
}

.dashboard-title {
  font-size: 20px; /* Slightly smaller font */
  text-align: center;
  color: var(--text-color-light);
  margin-bottom: 15px;
  font-weight: bold;
  animation: fadeInZoom 1.5s ease-in-out; /* Animation when loaded */
  transform: scale(1);
  transition: transform 0.3s ease; /* Smooth scale effect */
}

.dashboard-title:hover {
  transform: scale(1.05); /* Slight zoom-in on hover */
  text-shadow: 0 4px 10px rgba(0, 0, 0, 0.3); /* Subtle glow effect */
}

/* Animation for the title */
@keyframes fadeInZoom {
  from {
      opacity: 0;
      transform: scale(0.8);
  }
  to {
      opacity: 1;
      transform: scale(1);
  }
}
/* Responsive adjustments for mobile and tablet */
@media (max-width: 768px) {
    .weather-dashboard {
        width: 95%;
        margin-top: 40px;
        margin-bottom: 40px;
        padding: 10px;
    }

    /* Top bar input and buttons should stack vertically */
    .top-bar {
        flex-direction: column;
        align-items: center;
        padding: 10px;
    }

    .top-bar input {
        width: 100%;
        margin-bottom: 10px;
    }

    .top-bar button {
        width: 100%;
        margin-bottom: 10px;
    }

    /* Current weather card should stack vertically */
    .current-weather {
        flex: 1;
        max-width: 100%;
        margin-bottom: 20px;
    }

    /* Forecast section (reduce grid columns to fit better on small screens) */
    .forecast-container {
        display: grid;
        grid-template-columns: repeat(2, 1fr); /* Use 2 columns instead of 7 */
        gap: 10px;
    }

    /* Forecast day card adjustments */
    .day-card {
        max-width: 100%;
        margin: 10px auto;
    }

    /* Map container scaling */
    .map-container {
        max-width: 100%;
        padding: 10px;
    }

    #map {
        height: 250px;
    }

    /* Mini news section should display 2 items per row on smaller screens */
    .mini-news-container {
        width: 48%; /* Make mini-news containers fit in 2 columns */
        margin-bottom: 15px;
    }

    /* News image adjustments for mobile */
    .news-image {
        width: 100%;
        height: 150px;
        object-fit: cover;
    }

    /* Adjust news button width */
    .news-button {
        width: 100%;
        padding: 8px;
        font-size: 12px;
    }

    /* Adjust header font size */
    .dashboard-title {
        font-size: 18px;
    }
}

/* For very small screens (phones) */
@media (max-width: 480px) {
    .top-bar input {
        font-size: 12px;
        padding: 10px;
    }

    .top-bar button {
        font-size: 12px;
        padding: 10px;
    }

    .weather-info {
        font-size: 14px;
    }

    .weather-temp {
        font-size: 24px;
    }

    /* For very small mobile screens */
    .news-image {
        height: 120px;
    }

    .map-container {
        padding: 5px;
    }

    #map {
        height: 200px;
    }

    .forecast-container {
        grid-template-columns: repeat(1, 1fr); /* Stack forecast items on top of each other */
    }

    .day-card {
        margin: 0 auto;
        max-width: 100%;
    }
}

/* Footer Styles */
.footer {
  background-color: var(--bg-color-light); /* Default to white background */
  color: var(--text-color-dark); /* Dark text for readability */
  text-align: center;
  padding: 5px;
  position: fixed;
  bottom: -50px; /* Start with the footer hidden off-screen */
  left: 0;
  width: 100%;
  transition: bottom 0.3s ease; /* Smooth transition when the footer appears */
  box-shadow: 0 -2px 6px var(--box-shadow-color-light); /* Light shadow for default theme */
}

.footer p {
  margin: 0;
  font-size: 14px;
  font-weight: bold;
}

/* Dark Mode Styles */
.dark-mode .footer {
  background-color: var(--bg-color-dark); /* Dark background in dark mode */
  color: var(--text-color-light); /* Light text in dark mode */
  box-shadow: 0 -2px 6px var(--box-shadow-color-dark); /* Darker shadow for dark mode */
}

/* Styles for Mobile View (when the class 'mobile-view' is added) */
.mobile-view {
  background: #ffffff; /* White background to simulate mobile app feel */
  color: black; /* Dark text for readability */
  font-family: 'Arial', sans-serif;
}

.mobile-view .weather-dashboard {
  width: 100%;
  padding: 10px;
  margin: 0;
}

.mobile-view .top-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.mobile-view .forecast-container {
  display: block; /* Make it stack */
}

.mobile-view .forecast-container .day-card {
  margin: 10px 0;
  width: 100%;
}

/* Mobile Mode Styles (Hidden initially) */
body.mobile-mode {
  font-family: Arial, sans-serif;
  background-color: #f4f4f4;
}

body.mobile-mode .weather-dashboard {
  width: 95%; /* Full width on mobile */
  padding: 10px;
  margin-top: 30px;
  margin-bottom: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 15px var(--box-shadow-color-light);
}

body.mobile-mode .top-bar {
  flex-direction: column;
  align-items: center;
}

body.mobile-mode .current-weather {
  max-width: 100%;
  margin-bottom: 20px;
}

body.mobile-mode .forecast-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* Two columns for mobile */
  gap: 10px;
}

body.mobile-mode .map-container {
  max-width: 100%;
}

body.mobile-mode .news-section {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* For small mobile screens */
@media (max-width: 480px) {
  body.mobile-mode .forecast-container {
    grid-template-columns: 1fr; /* Single column for very small screens */
  }

  body.mobile-mode .mini-news-container {
    width: 100%;
  }
}

