:root,
[data-theme="light"] {
  --cl-primary: #5ec576;
  --cl-secondary: #ffcb03;
  --cl-tertiary: #ff585f;
  --cl-primary-darker: #4bbb7d;
  --cl-secondary-darker: #ffbb00;
  --cl-tertiary-darker: #fd424b;
  --cl-primary-opacity: #0b0980d8;
  --cl-secondary-opacity: #ffcd0331;
  --cl-tertiary-opacity: #ff58602d;
  --gradient-primary: linear-gradient(to top left, #393bb3, #5dd2e1);
  --gradient-secondary: linear-gradient(to top left, #0329ffa8, #98f10a94);
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --text-primary: #212529;
  --text-secondary: #6c757d;
}

[data-theme="dark"] {
  --cl-primary: #5ec576;
  --cl-secondary: #ffcb03;
  --cl-tertiary: #ff585f;
  --cl-primary-darker: #4bbb7d;
  --cl-secondary-darker: #ffbb00;
  --cl-tertiary-darker: #fd424b;
  --cl-primary-opacity: #0b0980d8;
  --cl-secondary-opacity: #ffcd0331;
  --cl-tertiary-opacity: #ff58602d;
  --gradient-primary: linear-gradient(to top left, #1a1a2e, #16213e);
  --gradient-secondary: linear-gradient(to top left, #0f3460, #16213e);
  --bg-primary: #1a1a1a;
  --bg-secondary: #2d2d2d;
  --text-primary: #e4e4e7;
  --text-secondary: #a1a1a1;
}

html[data-theme="dark"] {
  color-scheme: dark;
}

html[data-theme="light"] {
  color-scheme: light;
}

/* Section headings visibility */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
}

[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
  color: #ffffff;
  font-weight: 600;
}

[data-theme="light"] h1,
[data-theme="light"] h2,
[data-theme="light"] h3,
[data-theme="light"] h4,
[data-theme="light"] h5,
[data-theme="light"] h6 {
  color: #212529;
  font-weight: 600;
}

/* Forecast section headings - make them more prominent */
#weather-content h3,
.hourly-weather h3,
.five-day-weather h3 {
  margin-bottom: 15px;
  font-size: 1.3rem;
  font-weight: 600;
}

[data-theme="dark"] #weather-content h3,
[data-theme="dark"] .hourly-weather h3,
[data-theme="dark"] .five-day-weather h3 {
  color: #ffd700;
}

[data-theme="light"] #weather-content h3,
[data-theme="light"] .hourly-weather h3,
[data-theme="light"] .five-day-weather h3 {
  color: #1a1a1a;
}

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

#header {
  background: var(--gradient-primary);
}

#main {
  background: var(--gradient-secondary);
}

#search-btn {
  width: 100%;
}

.hourly-card {
  background: var(--cl-primary-opacity) !important;
  min-width: 110px;
  max-width: 110px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 14px 10px;
  border-radius: 8px;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-weight: 500;
}

.hourly-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25) !important;
  border-color: rgba(255, 255, 255, 0.4);
}

.hourly-card p {
  margin: 3px 0;
  line-height: 1.2;
}

.hourly-card .card-time {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  display: block;
}

.hourly-card .weather-icon {
  font-size: 2rem;
  margin: 6px 0;
  display: block;
}

.hourly-card .card-temp {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 4px;
  display: block;
}

.hourly-card .card-wind {
  font-size: 0.8rem;
  margin-top: 2px;
  display: block;
}

.forecast-card {
  background: var(--cl-primary-opacity) !important;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: 16px 12px;
  transition: transform 0.2s, box-shadow 0.2s;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  text-align: center;
}

.forecast-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25) !important;
  border-color: rgba(255, 255, 255, 0.4);
}

.forecast-card h4 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
}

.forecast-card h5 {
  font-size: 0.95rem;
  margin: 0 0 0.75rem 0;
  opacity: 1;
  font-weight: 500;
}

.forecast-card .card-date {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 8px;
  display: block;
}

.forecast-card .weather-icon {
  width: 70px;
  height: 70px;
  margin: 8px 0;
  display: block;
}

.forecast-card .card-weather {
  font-size: 0.95rem;
  font-weight: 500;
  margin: 6px 0;
  display: block;
  color: #ffd700;
}

.forecast-card .card-temp {
  font-size: 1.2rem;
  font-weight: 600;
  margin-top: 8px;
  display: block;
}

.forecast-card > div {
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.forecast-card span {
  font-weight: 500;
}

/* Hourly card details */
.hourly-card .card-feels,
.hourly-card .card-humidity,
.hourly-card .card-wind,
.hourly-card .card-rain,
.hourly-card .card-visibility,
.forecast-card .card-feels,
.forecast-card .card-humidity,
.forecast-card .card-wind,
.forecast-card .card-rain,
.forecast-card .card-visibility,
.forecast-card .card-details,
.forecast-card .card-pressure {
  font-size: 0.8rem;
  margin: 2px 0;
  line-height: 1.2;
}

.hourly-card .card-feels,
.forecast-card .card-feels {
  color: #ffeb3b;
  font-weight: 500;
}

.hourly-card .card-humidity,
.hourly-card .card-wind,
.hourly-card .card-visibility,
.forecast-card .card-humidity,
.forecast-card .card-wind,
.forecast-card .card-visibility,
.forecast-card .card-details {
  color: #b3e5fc;
}

.hourly-card .card-rain,
.forecast-card .card-rain {
  color: #81c784;
  font-weight: 500;
}

.forecast-card .card-pressure {
  color: #ffb3ba;
  margin-top: 4px;
}

#past-searched-cities,
.past-search {
  display: flex !important;
  flex-direction: row !important;
  justify-content: center;
  flex-wrap: wrap;
}

/* Loading States */
.spinner {
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid white;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-state {
  text-align: center;
  padding: 40px 20px;
  color: white;
}

.loading-state p {
  margin-top: 15px;
  font-size: 0.95rem;
}

/* Error States */
.error-message {
  background-color: #dc3545;
  color: white;
  padding: 15px;
  border-radius: 5px;
  margin: 15px 0;
  display: none;
}

.error-message.show {
  display: block;
}

.error-message strong {
  display: block;
  margin-bottom: 5px;
}

.placeholder-content {
  text-align: center;
  padding: 30px;
  color: rgba(255, 255, 255, 0.7);
  font-style: italic;
}

/* Alert Styles */
.alert-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.alert-item {
  padding: 12px 15px;
  border-radius: 5px;
  border-left: 4px solid;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.95rem;
}

.alert-item.danger {
  background-color: rgba(220, 53, 69, 0.1);
  border-left-color: #dc3545;
  color: #dc3545;
}

.alert-item.warning {
  background-color: rgba(255, 193, 7, 0.1);
  border-left-color: #ffc107;
  color: #ff9800;
}

.alert-item.info {
  background-color: rgba(23, 162, 184, 0.1);
  border-left-color: #17a2b8;
  color: #17a2b8;
}

.alert-icon {
  font-size: 1.2rem;
  min-width: 30px;
}

.alert-content {
  flex: 1;
}

.alert-title {
  font-weight: 600;
  margin: 0;
  font-size: 0.95rem;
}

.alert-message {
  margin: 3px 0 0 0;
  font-size: 0.85rem;
  opacity: 0.9;
}

/* Comparison View */
.comparison-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.comparison-card {
  background: var(--cl-primary-opacity) !important;
  color: white;
  padding: 12px;
  border-radius: 8px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  transition: transform 0.2s, box-shadow 0.2s;
}

.comparison-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.comparison-card h5 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  word-wrap: break-word;
  line-height: 1.2;
}

.comparison-card img {
  width: 50px;
  height: 50px;
  margin: 4px auto;
  display: block;
}

.comparison-card p {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.3;
}

.comparison-card strong {
  color: #ffd700;
}

.comparison-card .btn {
  margin-top: 6px;
  padding: 4px 8px;
  font-size: 0.75rem;
  width: 100%;
  border: none;
}

.comparison-card .btn-danger {
  background-color: #dc3545;
  color: white;
}

.comparison-card .btn-danger:hover {
  background-color: #c82333;
}

/* Favorite Buttons and Cities */
#favorite-btn,
#favorite-cities .btn {
  background-color: #ffd700;
  border-color: #ffa500;
  color: #000 !important;
  font-weight: 600;
  transition: all 0.3s ease;
}

#favorite-btn:hover,
#favorite-cities .btn:hover {
  background-color: #ffa500;
  border-color: #ff8c00;
  color: #000 !important;
  transform: scale(1.05);
}

[data-theme="dark"] #favorite-btn,
[data-theme="dark"] #favorite-cities .btn {
  background-color: #ffd700;
  border-color: #ffa500;
  color: #000 !important;
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.3);
}

[data-theme="dark"] #favorite-btn:hover,
[data-theme="dark"] #favorite-cities .btn:hover {
  background-color: #ffa500;
  border-color: #ff8c00;
  color: #000 !important;
  box-shadow: 0 0 12px rgba(255, 165, 0, 0.5);
}

/* Favorite section label */
#favorite-cities h5 {
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: 15px;
}

[data-theme="dark"] #favorite-cities h5 {
  color: #ffd700;
}

#no-favorites {
  color: var(--text-secondary);
}

/* Weather Content Display */
#weather-content {
  color: var(--text-primary);
}

#weather-content div,
#weather-content h4,
#weather-content h5,
#weather-content p {
  color: var(--text-primary);
}

#weather-content strong {
  color: var(--text-primary);
  font-weight: 600;
}

[data-theme="dark"] #weather-content {
  color: #e4e4e7;
}

[data-theme="dark"] #weather-content div,
[data-theme="dark"] #weather-content h4,
[data-theme="dark"] #weather-content h5,
[data-theme="dark"] #weather-content p {
  color: #e4e4e7;
}

[data-theme="dark"] #weather-content strong {
  color: #ffd700;
  font-weight: 600;
}

/* Forecast cards text */
.weather-card {
  color: #ffffff;
}

.weather-card p,
.weather-card div {
  color: #ffffff;
}

[data-theme="light"] .hourly-card,
[data-theme="light"] .forecast-card {
  background: rgba(94, 197, 118, 0.85) !important;
  color: #ffffff;
}

[data-theme="light"] .hourly-card:hover,
[data-theme="light"] .forecast-card:hover {
  background: rgba(94, 197, 118, 0.95) !important;
}

[data-theme="light"] .forecast-card .card-weather {
  color: #ffeb3b;
  font-weight: 600;
}

[data-theme="dark"] .weather-card {
  color: #e4e4e7;
}

[data-theme="dark"] .weather-card p,
[data-theme="dark"] .weather-card div {
  color: #e4e4e7;
}

/* Weather alerts text */
#weather-alerts {
  color: var(--text-primary);
}

#weather-alerts h5 {
  color: var(--text-primary);
}

[data-theme="dark"] #weather-alerts h5 {
  color: #ffd700;
}

.alert-danger {
  color: #dc3545;
}

.alert-warning {
  color: #ff9800;
}

.alert-info {
  color: #17a2b8;
}

