:root {
  --bg-gradient-light: linear-gradient(-45deg, #ff9a9e 0%, #fad0c4 99%, #fad0c4 100%);
  --text-color-light: #333;
  --card-bg-light: rgba(255, 255, 255, 0.4);
  --card-border-light: rgba(255, 255, 255, 0.6);
  --accent-gradient-light: linear-gradient(135deg, #ff8177 0%, #ff867a 0%, #ff8c7f 21%, #f99185 52%, #cf556c 78%, #b12a5b 100%);

  --bg-gradient-dark: linear-gradient(-45deg, #0f2027, #203a43, #2c5364);
  --text-color-dark: #e0e0e0;
  --card-bg-dark: rgba(0, 0, 0, 0.25);
  --card-border-dark: rgba(255, 255, 255, 0.15);
  --accent-gradient-dark: linear-gradient(135deg, #a78bfa 0%, #ec4899 100%);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  min-height: 100vh;
  background: var(--bg-gradient-light);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
  color: var(--text-color-light);
  transition: all 0.3s ease;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

body.dark-mode {
  background: var(--bg-gradient-dark);
  color: var(--text-color-dark);
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  flex: 1 0 auto;
  width: 100%;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding: 15px 25px;
  background: var(--card-bg-light);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  border: 1px solid var(--card-border-light);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

body.dark-mode .header {
  background: var(--card-bg-dark);
  border: 1px solid var(--card-border-dark);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.tagline {
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-style: italic;
  opacity: 0.7;
  margin-top: -2px;
  color: var(--text-color-light);
}

body.dark-mode .tagline {
  color: var(--text-color-dark);
}

.logo img {
  height: 48px;
  width: auto;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.15));
}

.logo h2 {
  font-family: 'Poppins', sans-serif;
  font-size: 26px;
  font-weight: 700;
  background: var(--accent-gradient-light);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
}

body.dark-mode .logo h2 {
  background: var(--accent-gradient-dark);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.dark-mode-toggle {
  background: rgba(0, 0, 0, 0.1);
  border: none;
  padding: 12px 20px;
  border-radius: 50px;
  cursor: pointer;
  font-size: 20px;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.dark-mode-toggle:hover {
  transform: scale(1.1);
  background: rgba(0, 0, 0, 0.15);
}

body.dark-mode .dark-mode-toggle {
  background: rgba(255, 255, 255, 0.1);
}

.search-section {
  background: var(--card-bg-light);
  backdrop-filter: blur(15px);
  padding: 30px;
  border-radius: 25px;
  margin-bottom: 30px;
  border: 1px solid var(--card-border-light);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

body.dark-mode .search-section {
  background: var(--card-bg-dark);
  border: 1px solid var(--card-border-dark);
}

.search-container {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

#locationInput {
  flex: 1;
  min-width: 250px;
  padding: 15px 20px;
  border: 2px solid transparent;
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.5);
  color: #333;
  font-size: 16px;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

body.dark-mode #locationInput {
  background: rgba(0, 0, 0, 0.3);
  border: 2px solid transparent;
  color: var(--text-color-dark);
}

#locationInput:focus {
  outline: none;
  border-color: #ff8177;
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(255, 129, 119, 0.3);
}

body.dark-mode #locationInput:focus {
  border-color: #a78bfa;
  box-shadow: 0 5px 20px rgba(167, 139, 250, 0.3);
}

#locationInput::placeholder {
  color: rgba(0, 0, 0, 0.4);
}

body.dark-mode #locationInput::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.btn {
  padding: 15px 30px;
  border: none;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--accent-gradient-light);
  color: white;
}

body.dark-mode .btn-primary {
  background: var(--accent-gradient-dark);
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.btn:active {
  transform: translateY(-1px);
}

.spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.spinner.active {
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.error-message {
  display: none;
  margin-top: 15px;
  padding: 15px;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 15px;
  color: #dc2626;
  backdrop-filter: blur(10px);
}

.error-message.active {
  display: block;
  animation: slideIn 0.3s ease;
}

body.dark-mode .error-message {
  background: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.placeholder-content {
  display: block;
  text-align: center;
  padding: 60px 20px;
  animation: fadeIn 1s ease;
}

.placeholder-content.hidden {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.placeholder-icon {
  font-size: 80px;
  margin-bottom: 20px;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-20px); }
}

.placeholder-text {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 10px;
  background: var(--accent-gradient-light);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

body.dark-mode .placeholder-text {
  background: var(--accent-gradient-dark);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.placeholder-subtext {
  font-size: 16px;
  opacity: 0.7;
}

.weather-content {
  display: none;
  animation: fadeIn 0.5s ease;
}

.weather-content.active {
  display: block;
}

.main-weather {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 25px;
  margin-bottom: 30px;
}

.glass-card {
  background: var(--card-bg-light);
  backdrop-filter: blur(15px);
  border-radius: 25px;
  padding: 30px;
  border: 1px solid var(--card-border-light);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

body.dark-mode .glass-card {
  background: var(--card-bg-dark);
  border: 1px solid var(--card-border-dark);
}

.glass-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.card-title {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 2px;
  opacity: 0.7;
  margin-bottom: 15px;
  font-weight: 600;
}

.current-weather {
  display: flex;
  align-items: center;
  gap: 20px;
}

#icon {
  width: 80px;
  height: 80px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.weather-details {
  flex: 1;
}

.temp-display {
  font-size: 48px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 10px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

body.dark-mode .info-row {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  opacity: 0.7;
  font-size: 14px;
}

.info-value {
  font-weight: 600;
  text-align: right;
}

#mapFrame {
  height: 400px;
  border-radius: 20px;
  overflow: hidden;
  border: 2px solid var(--card-border-light);
}

body.dark-mode #mapFrame {
  border: 2px solid var(--card-border-dark);
}

.forecast-section {
  margin-top: 30px;
}

.section-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 20px;
  background: var(--accent-gradient-light);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

body.dark-mode .section-title {
  background: var(--accent-gradient-dark);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hourly-forecast {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.hour-card {
  background: var(--card-bg-light);
  backdrop-filter: blur(15px);
  border-radius: 20px;
  padding: 20px;
  border: 1px solid var(--card-border-light);
  transition: all 0.3s ease;
}

body.dark-mode .hour-card {
  background: var(--card-bg-dark);
  border: 1px solid var(--card-border-dark);
}

.hour-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.weekly-forecast {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 15px;
}

.day-card {
  background: var(--card-bg-light);
  backdrop-filter: blur(15px);
  border-radius: 20px;
  padding: 20px;
  text-align: center;
  border: 1px solid var(--card-border-light);
  transition: all 0.3s ease;
}

body.dark-mode .day-card {
  background: var(--card-bg-dark);
  border: 1px solid var(--card-border-dark);
}

.day-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.day-icon {
  width: 50px;
  height: 50px;
  margin: 10px 0;
}

.temp-range {
  font-size: 18px;
  font-weight: 600;
  margin: 10px 0;
}

.temp-high {
  color: #ef4444;
}

.temp-low {
  color: #3b82f6;
}

.voice-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--accent-gradient-light);
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  z-index: 1000;
}

body.dark-mode .voice-btn {
  background: var(--accent-gradient-dark);
}

.voice-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

footer {
  text-align: center;
  padding: 20px;
  margin-top: 30px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 14px;
  opacity: 0.8;
}

body.dark-mode footer {
  background: var(--card-bg-dark);
  border: 1px solid var(--card-border-dark);
}

@media (max-width: 768px) {
  .header {
    flex-direction: column;
    gap: 15px;
  }

  .search-container {
    flex-direction: column;
  }

  #locationInput {
    min-width: 100%;
  }

  .main-weather {
    grid-template-columns: 1fr;
  }
}
