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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #0f1419 0%, #1a1f2e 50%, #16213e 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
}

.container {
  background: linear-gradient(135deg, #1e2739 0%, #16213e 100%);
  padding: 24px;
  border-radius: 16px;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.6),
    0 0 40px rgba(102, 126, 234, 0.2);
  width: 100%;
  max-width: 480px;
  border: 1px solid rgba(102, 126, 234, 0.2);
}

h1 {
  text-align: center;
  color: #e8f0ff;
  margin-bottom: 28px;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.search-box {
  display: flex;
  gap: 12px;
  margin-bottom: 32px;
}

input {
  flex: 1;
  padding: 14px 18px;
  border: 2px solid rgba(102, 126, 234, 0.3);
  border-radius: 10px;
  font-size: 16px;
  outline: none;
  transition: all 0.3s ease;
  background-color: rgba(30, 39, 57, 0.8);
  color: #e8f0ff;
}

input::placeholder {
  color: #7a8fa6;
}

input:focus {
  border-color: #667eea;
  background-color: rgba(30, 39, 57, 0.95);
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.2);
}

button {
  padding: 14px 32px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.5);
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.7);
}

button:active {
  transform: translateY(0);
}

.error {
  color: #ff6b6b;
  text-align: center;
  margin: 20px 0;
  font-size: 14px;
  display: none;
  background-color: rgba(255, 107, 107, 0.1);
  padding: 12px 16px;
  border-radius: 8px;
  border-left: 4px solid #ff6b6b;
}

.loading {
  text-align: center;
  color: #667eea;
  display: none;
  font-size: 16px;
  padding: 24px;
  color: #a8c5ff;
}

.spinner {
  border: 4px solid rgba(102, 126, 234, 0.2);
  border-top: 4px solid #667eea;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto 12px;
}

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

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

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

.city-name {
  text-align: center;
  font-size: 28px;
  color: #e8f0ff;
  margin-bottom: 24px;
  font-weight: 700;
}

.temperature-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #e8f0ff;
  padding: 32px 24px;
  border-radius: 12px;
  text-align: center;
  margin-bottom: 24px;
  box-shadow:
    0 8px 25px rgba(102, 126, 234, 0.4),
    0 0 20px rgba(102, 126, 234, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.temperature-card h3 {
  font-size: 14px;
  text-transform: uppercase;
  opacity: 0.95;
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.temperature-card p {
  font-size: 56px;
  font-weight: 700;
  margin-bottom: 8px;
}

.temperature-card .condition {
  font-size: 18px;
  opacity: 0.95;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.info-box {
  background: linear-gradient(
    135deg,
    rgba(102, 126, 234, 0.1) 0%,
    rgba(118, 75, 162, 0.1) 100%
  );
  padding: 20px 16px;
  border-radius: 12px;
  border: 1px solid rgba(102, 126, 234, 0.3);
  transition: all 0.3s ease;
}

.info-box:hover {
  border-color: #667eea;
  box-shadow:
    0 8px 20px rgba(102, 126, 234, 0.3),
    0 0 15px rgba(102, 126, 234, 0.15);
  transform: translateY(-3px);
  background: linear-gradient(
    135deg,
    rgba(102, 126, 234, 0.15) 0%,
    rgba(118, 75, 162, 0.15) 100%
  );
}

.info-box h3 {
  color: #a8c5ff;
  font-size: 12px;
  text-transform: uppercase;
  margin-bottom: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.info-box p {
  font-size: 26px;
  color: #e8f0ff;
  font-weight: 700;
}

@media (max-width: 320px) {
  .container {
    padding: 16px;
  }

  h1 {
    font-size: 24px;
    margin-bottom: 20px;
  }

  .search-box {
    flex-direction: column;
    gap: 10px;
  }

  input {
    padding: 12px 14px;
    font-size: 14px;
    width: 100%;
  }

  button {
    padding: 12px 20px;
    font-size: 14px;
    width: 100%;
  }

  .city-name {
    font-size: 20px;
  }

  .temperature-card p {
    font-size: 40px;
  }

  .info-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .info-box p {
    font-size: 22px;
  }
}

@media (min-width: 321px) and (max-width: 375px) {
  .container {
    padding: 18px;
  }

  h1 {
    font-size: 26px;
    margin-bottom: 22px;
  }

  .search-box {
    flex-direction: column;
    gap: 10px;
  }

  input {
    padding: 12px 16px;
    font-size: 15px;
    width: 100%;
  }

  button {
    padding: 12px 24px;
    font-size: 15px;
    width: 100%;
  }

  .city-name {
    font-size: 22px;
  }

  .temperature-card p {
    font-size: 44px;
  }

  .info-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .info-box p {
    font-size: 24px;
  }
}

@media (min-width: 376px) and (max-width: 425px) {
  .container {
    padding: 20px;
  }

  h1 {
    font-size: 28px;
  }

  .search-box {
    flex-direction: column;
    gap: 12px;
  }

  input {
    padding: 14px 16px;
    font-size: 15px;
    width: 100%;
  }

  button {
    padding: 14px 28px;
    font-size: 15px;
    width: 100%;
  }

  .temperature-card p {
    font-size: 48px;
  }

  .info-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 426px) and (max-width: 768px) {
  .container {
    padding: 22px;
  }

  h1 {
    font-size: 30px;
  }

  .search-box {
    gap: 10px;
  }

  input {
    padding: 12px 16px;
    font-size: 15px;
  }

  button {
    padding: 12px 24px;
    font-size: 15px;
    white-space: nowrap;
  }

  .temperature-card p {
    font-size: 52px;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .container {
    max-width: 600px;
    padding: 32px;
  }

  h1 {
    font-size: 36px;
    margin-bottom: 32px;
  }

  .search-box {
    gap: 14px;
    margin-bottom: 36px;
  }

  input {
    padding: 16px 20px;
    font-size: 16px;
  }

  button {
    padding: 16px 36px;
    font-size: 16px;
  }

  .city-name {
    font-size: 32px;
    margin-bottom: 28px;
  }

  .temperature-card {
    padding: 36px 28px;
    margin-bottom: 28px;
  }

  .temperature-card p {
    font-size: 64px;
  }

  .info-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .info-box {
    padding: 24px 18px;
  }

  .info-box p {
    font-size: 32px;
  }
}

@media (min-width: 1920px) {
  .container {
    max-width: 800px;
    padding: 48px 56px;
  }

  h1 {
    font-size: 48px;
    margin-bottom: 40px;
  }

  .search-box {
    gap: 16px;
    margin-bottom: 48px;
  }

  input {
    padding: 18px 24px;
    font-size: 18px;
  }

  button {
    padding: 18px 48px;
    font-size: 18px;
  }

  .city-name {
    font-size: 42px;
    margin-bottom: 36px;
  }

  .temperature-card {
    padding: 48px 40px;
    margin-bottom: 36px;
  }

  .temperature-card h3 {
    font-size: 16px;
    margin-bottom: 12px;
  }

  .temperature-card p {
    font-size: 88px;
    margin-bottom: 12px;
  }

  .temperature-card .condition {
    font-size: 24px;
  }

  .info-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }

  .info-box {
    padding: 32px 24px;
  }

  .info-box h3 {
    font-size: 14px;
    margin-bottom: 14px;
  }

  .info-box p {
    font-size: 40px;
  }
}
