* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.container {
  width: 100%;
  max-width: 900px;
}

.weather-gadget {
  background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
  color: white;
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.weather-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}

.weather-title {
  font-size: 2.2rem;
  font-weight: 700;
  margin: 0;
  background: linear-gradient(45deg, #fff, #a8edea);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.search-form {
  display: flex;
  gap: 8px;
}

.search-input {
  padding: 12px 16px;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  min-width: 180px;
  background: rgba(255, 255, 255, 0.95);
  color: #333;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.search-btn,
.location-btn,
.settings-btn {
  padding: 12px 16px;
  border: none;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.search-btn:hover,
.location-btn:hover,
.settings-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.tab-container {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 12px 20px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border-radius: 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.tab-btn.active {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.6);
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1);
}

.current-weather {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.main-info {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: center;
}

.location-info {
  flex: 1;
}

.city-name {
  font-size: 1.6rem;
  font-weight: 600;
  margin: 0 0 16px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.location-icon {
  font-size: 1.2rem;
}

.temperature {
  font-size: 4.5rem;
  font-weight: 200;
  line-height: 1;
  margin: 16px 0;
  background: linear-gradient(45deg, #fff, #a8edea);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.feels-like {
  font-size: 1.1rem;
  opacity: 0.8;
  margin-bottom: 12px;
}

.weather-icon-container {
  text-align: center;
  position: relative;
}

.icon-img {
  width: 120px;
  height: 120px;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.3));
}

.description {
  font-size: 1.1rem;
  text-transform: capitalize;
  opacity: 0.9;
  margin-top: 12px;
  font-weight: 500;
}

.weather-alerts {
  background: linear-gradient(135deg, #ff6b6b, #ee5a24);
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 20px;
  border-left: 4px solid #ff3838;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
  100% {
    opacity: 1;
  }
}

.alert-title {
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 20px;
  background: rgba(255, 255, 255, 0.1);
  padding: 28px;
  border-radius: 16px;
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.detail-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 16px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  transition: transform 0.3s ease;
}

.detail-item:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.1);
}

.detail-label {
  font-size: 0.9rem;
  opacity: 0.8;
  margin-bottom: 8px;
  font-weight: 500;
}

.detail-value {
  font-size: 1.3rem;
  font-weight: 600;
}

.detail-unit {
  font-size: 0.8rem;
  opacity: 0.7;
  margin-top: 4px;
}

.forecast-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.forecast-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.forecast-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.forecast-tab {
  padding: 8px 16px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.3s ease;
}

.forecast-tab.active {
  background: rgba(255, 255, 255, 0.3);
}

.hourly-forecast {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 16px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.hourly-forecast::-webkit-scrollbar {
  height: 6px;
}

.hourly-forecast::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.hourly-forecast::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

.hourly-item {
  min-width: 80px;
  text-align: center;
  padding: 16px 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  transition: transform 0.3s ease;
}

.hourly-item:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.15);
}

.hourly-time {
  font-size: 0.8rem;
  opacity: 0.8;
  margin-bottom: 8px;
}

.hourly-icon {
  width: 40px;
  height: 40px;
  margin: 8px auto;
}

.hourly-temp {
  font-size: 1rem;
  font-weight: 600;
}

.daily-forecast {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.daily-item {
  display: grid;
  grid-template-columns: 1fr auto auto auto 2fr auto;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.daily-item:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.daily-date {
  font-size: 1rem;
  font-weight: 500;
}

.daily-icon {
  width: 50px;
  height: 50px;
}

.daily-temps {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.daily-high {
  font-size: 1.2rem;
  font-weight: 600;
}

.daily-low {
  font-size: 1rem;
  opacity: 0.7;
}

.daily-desc {
  font-size: 0.9rem;
  opacity: 0.9;
  text-transform: capitalize;
}

.daily-details {
  font-size: 0.8rem;
  opacity: 0.8;
  text-align: right;
}

.air-quality {
  background: rgba(255, 255, 255, 0.1);
  padding: 24px;
  border-radius: 16px;
  margin-bottom: 20px;
}

.aqi-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.aqi-value {
  font-size: 2rem;
  font-weight: 600;
}

.aqi-status {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

.aqi-good {
  background: #27ae60;
}
.aqi-moderate {
  background: #f39c12;
}
.aqi-unhealthy {
  background: #e74c3c;
}

.pollutants {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.pollutant-item {
  text-align: center;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  transition: transform 0.3s ease;
}

.pollutant-item:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.1);
}

.radar-container {
  background: rgba(255, 255, 255, 0.1);
  padding: 24px;
  border-radius: 16px;
  text-align: center;
}

.radar-map {
  width: 100%;
  height: 400px;
  border-radius: 12px;
  margin: 20px 0;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.radar-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.radar-btn {
  padding: 8px 16px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.3s ease;
}

.radar-btn:hover,
.radar-btn.active {
  background: rgba(255, 255, 255, 0.3);
}

.ai-assistant {
  background: linear-gradient(135deg, #667eea, #764ba2);
  padding: 24px;
  border-radius: 16px;
  margin-bottom: 20px;
}

.ai-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.ai-input {
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  color: #333;
  margin-bottom: 12px;
  font-size: 14px;
}

.ai-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
}

.ai-submit-btn {
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.ai-submit-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.ai-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.ai-response {
  background: rgba(255, 255, 255, 0.1);
  padding: 16px;
  border-radius: 12px;
  margin-top: 12px;
  line-height: 1.6;
  border-left: 4px solid rgba(255, 255, 255, 0.3);
}

.ai-thinking {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  margin-top: 12px;
}

.thinking-dots {
  display: flex;
  gap: 4px;
}

.thinking-dot {
  width: 8px;
  height: 8px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  animation: thinking 1.4s infinite ease-in-out;
}

.thinking-dot:nth-child(1) {
  animation-delay: -0.32s;
}
.thinking-dot:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes thinking {
  0%,
  80%,
  100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}

.ai-suggestions {
  margin-top: 20px;
  font-size: 0.9rem;
  opacity: 0.8;
}

.suggestion-item {
  padding: 8px 12px;
  margin: 4px 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.suggestion-item:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateX(4px);
}

.weather-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  flex-wrap: wrap;
  gap: 16px;
}

.footer-controls {
  display: flex;
  gap: 12px;
  align-items: center;
}

.refresh-btn,
.export-btn {
  padding: 10px 18px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.refresh-btn:hover,
.export-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.powered-by {
  font-size: 0.75rem;
  opacity: 0.6;
  display: flex;
  align-items: center;
  gap: 8px;
}

.loading {
  text-align: center;
  padding: 80px 20px;
}

.spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 24px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.error {
  text-align: center;
  padding: 80px 20px;
}

.error-icon {
  font-size: 4rem;
  margin-bottom: 20px;
}

.retry-btn {
  padding: 12px 24px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border-radius: 12px;
  cursor: pointer;
  margin-top: 20px;
  transition: all 0.3s ease;
}

.retry-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.hidden {
  display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
  .weather-gadget {
    padding: 20px;
  }

  .main-info {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 20px;
  }

  .details-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 20px;
  }

  .daily-item {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 12px;
  }

  .weather-header {
    flex-direction: column;
    text-align: center;
  }

  .tab-container {
    justify-content: center;
  }

  .temperature {
    font-size: 3.5rem;
  }

  .radar-map {
    height: 300px;
  }
}

@media (max-width: 480px) {
  .details-grid {
    grid-template-columns: 1fr;
  }

  .weather-footer {
    flex-direction: column;
    gap: 16px;
  }

  .radar-map {
    height: 250px;
  }
}
