:root {
  --primary-color: #3b82f6;
  --primary-light: #60a5fa;
  --secondary-color: #1e293b;
  --background-color: #0f172a;
  --surface-color: #1e293b;
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border-color: #334155;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.2);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px 0 rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4),
    0 4px 6px -2px rgba(0, 0, 0, 0.3);
  --border-radius: clamp(0.25rem, 0.5vw, 0.375rem);
  --transition: all 0.15s ease;
}

@media (prefers-color-scheme: light) {
  :root {
    --primary-color: #2563eb;
    --primary-light: #3b82f6;
    --secondary-color: #f8fafc;
    --background-color: #ffffff;
    --surface-color: #f8fafc;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
      0 4px 6px -2px rgba(0, 0, 0, 0.05);
  }
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui,
    sans-serif;
  background-color: var(--background-color);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  transition: var(--transition);
  font-size: 14px;
}

.container {
  max-width: clamp(320px, 90vw, 1000px);
  margin: 0 auto;
  padding: clamp(0.5rem, 1.5vw, 1rem) clamp(0.5rem, 1vw, 0.75rem);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.header {
  justify-items: center;
  margin-bottom: clamp(0.5rem, 1vw, 0.75rem);
  padding-bottom: clamp(0.75rem, 1vw, 1rem);
  border-bottom: 1px solid var(--border-color);
}

.app-title {
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: clamp(1rem, 2vw, 1.25rem);
}

.search-section {
  max-width: 500px;
  margin: 0 auto;
  width: 100%;
}

.search-form {
  display: flex;
  gap: clamp(0.375rem, 0.75vw, 0.5rem);
  padding: clamp(0.25rem, 0.5vw, 0.375rem);
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: clamp(0.375rem, 0.75vw, 0.5rem);
  box-shadow: var(--shadow-sm);
}

.search-input {
  flex: 1;
  padding: clamp(0.5rem, 1vw, 0.625rem) clamp(0.625rem, 1vw, 0.75rem);
  border: none;
  border-radius: var(--border-radius);
  background: var(--background-color);
  color: var(--text-primary);
  font-size: clamp(0.8125rem, 1.5vw, 0.875rem);
  border: 1px solid transparent;
  transition: var(--transition);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-btn {
  padding: clamp(0.5rem, 1vw, 0.625rem) clamp(0.75rem, 1.5vw, 1rem);
  background: var(--primary-color);
  border: none;
  border-radius: var(--border-radius);
  color: white;
  cursor: pointer;
  transition: var(--transition);
  font-size: clamp(0.8125rem, 1.5vw, 0.875rem);
}

.search-btn:hover {
  background: var(--primary-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.search-btn:active {
  transform: translateY(0);
}

.weather-display {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 300px;
}

.loading,
.error-message {
  text-align: center;
  padding: clamp(1.25rem, 2.5vw, 1.75rem) clamp(1rem, 2vw, 1.25rem);
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: clamp(0.5rem, 1vw, 0.75rem);
  box-shadow: var(--shadow-sm);
  max-width: 400px;
  width: 100%;
}

.spinner {
  width: clamp(1.5rem, 3vw, 2rem);
  height: clamp(1.5rem, 3vw, 2rem);
  border: 2px solid var(--border-color);
  border-top: 2px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto clamp(0.75rem, 1.5vw, 1rem);
}

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

.loading p,
.error-message p {
  font-size: clamp(0.8125rem, 1.5vw, 0.875rem);
  color: var(--text-secondary);
  margin: 0;
}

.weather-card {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: clamp(0.75rem, 1.5vw, 1rem);
  padding: clamp(1rem, 2vw, 1.25rem);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 600px;
  transition: var(--transition);
}

.weather-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}

.weather-header {
  text-align: center;
  margin-bottom: clamp(0.5rem, 1.5vw, 0.75rem);
  padding-bottom: clamp(0.75rem, 1.5vw, 1rem);
  border-bottom: 1px solid var(--border-color);
}

.city-name {
  font-size: clamp(1.125rem, 2.5vw, 1.375rem);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: clamp(0.25rem, 0.5vw, 0.375rem);
  letter-spacing: -0.01em;
}

.date-time {
  font-size: clamp(0.75rem, 1.5vw, 0.875rem);
  color: var(--text-secondary);
  font-weight: 500;
}

.weather-main {
  display: flex;
  flex-direction: column;
  gap: clamp(1rem, 2vw, 1.25rem);
}

.temperature-section {
  text-align: center;
}

.temp-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.75rem, 1.5vw, 1rem);
  margin-bottom: clamp(0.5rem, 1vw, 0.75rem);
}

.temperature {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 400;
  color: var(--primary-color);
  letter-spacing: -0.02em;
}

.weather-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.weather-icon img {
  width: clamp(6rem, 11vw, 8rem);
  height: clamp(6rem, 11vw, 8rem);
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.1));
  border-radius: 5px;
}

.weather-description {
  font-size: clamp(0.875rem, 1.75vw, 1rem);
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: capitalize;
  letter-spacing: -0.01em;
}

.weather-details {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(0.75rem, 1.5vw, 1rem);
  margin-top: clamp(0.5rem, 1vw, 0.75rem);
  justify-content: center;
  max-width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

.detail-item {
  background: var(--background-color);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: clamp(0.75rem, 1.5vw, 1rem) clamp(0.5rem, 1vw, 0.75rem);
  text-align: center;
  transition: var(--transition);
  width: 160px;
  height: min-content;
}

.detail-item:hover {
  border-color: var(--primary-color);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.detail-label {
  display: block;
  font-size: clamp(0.6875rem, 1.25vw, 0.75rem);
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: clamp(0.25rem, 0.5vw, 0.375rem);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.detail-value {
  display: block;
  font-size: clamp(0.875rem, 1.75vw, 1rem);
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

@media (max-width: 768px) {
  .header {
    flex-direction: column;
    gap: clamp(0.5rem, 1.5vw, 0.75rem);
    text-align: center;
  }

  .temp-display {
    flex-direction: column;
    gap: clamp(0.5rem, 1.5vw, 0.75rem);
  }
}

@media (max-width: 480px) {
  .detail-item {
    padding: clamp(0.5rem, 1.5vw, 0.75rem) clamp(0.375rem, 1vw, 0.5rem);
  }

  .search-icon {
    gap: 5px !important;
  }

  .search-icon img {
    max-height: 16px;
    max-width: 16px;
  }

  .search-form {
    gap: clamp(0.5rem, 1.5vw, 0.75rem);
    padding: clamp(0.5rem, 1.5vw, 0.75rem);
  }
}

@media (max-width: 320px) {
  .search-form {
    flex-direction: column;
  }

  .search-icon img {
    display: none;
  }
}

h1,
h2,
h3 {
  line-height: 1.2;
}

p {
  line-height: 1.5;
}

* {
  transition: background-color 0.15s ease, color 0.15s ease,
    border-color 0.15s ease;
}

.search-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.search-icon img {
  height: 18px;
  width: 18px;
}
