/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: #333;
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header Styles */
.header {
  text-align: center;
  margin-bottom: 40px;
  animation: fadeInDown 0.8s ease-out;
}

.app-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: white;
  margin-bottom: 10px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.app-title i {
  margin-right: 15px;
  color: #ffd700;
}

.app-subtitle {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.1rem;
  font-weight: 300;
}

/* Search Section */
.search-section {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 30px;
  animation: fadeInUp 0.8s ease-out 0.2s both;
}

.search-container {
  position: relative;
  display: flex;
  align-items: center;
  background: white;
  border-radius: 50px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: all 0.3s ease;
}

.search-container:focus-within {
  transform: translateY(-2px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.search-icon {
  position: absolute;
  left: 20px;
  color: #667eea;
  font-size: 1.1rem;
}

.search-input {
  flex: 1;
  padding: 18px 20px 18px 50px;
  border: none;
  outline: none;
  font-size: 1rem;
  font-family: inherit;
}

.search-input::placeholder {
  color: #aaa;
}

.search-btn {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: none;
  padding: 18px 25px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.search-btn:hover {
  background: linear-gradient(135deg, #5a67d8, #6b46c1);
  transform: scale(1.05);
}

.location-btn {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.3);
  padding: 15px 25px;
  border-radius: 50px;
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.location-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
}

.location-btn i {
  margin-right: 10px;
}

/* Loading and Error States */
.loading {
  display: none;
  text-align: center;
  color: white;
  margin: 40px 0;
}

.loading.show {
  display: block;
  animation: fadeIn 0.5s ease;
}

.spinner {
  width: 40px;
  height: 40px;
  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 15px;
}

.error-message {
  display: none;
  background: rgba(239, 68, 68, 0.9);
  color: white;
  padding: 20px;
  border-radius: 15px;
  text-align: center;
  margin: 20px 0;
  backdrop-filter: blur(10px);
}

.error-message.show {
  display: block;
  animation: shake 0.5s ease-in-out;
}

/* Weather Content */
.weather-content {
  display: none;
  flex: 1;
  animation: fadeInUp 0.8s ease-out 0.4s both;
}

.weather-content.show {
  display: block;
}

.current-weather {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 25px;
  padding: 40px;
  margin-bottom: 30px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(20px);
}

.weather-main {
  display: flex;
  align-items: center;
  gap: 30px;
  margin-bottom: 40px;
}

.weather-icon {
  font-size: 5rem;
  color: #667eea;
  text-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.weather-info h2 {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 5px;
  color: #333;
}

.weather-info p {
  color: #666;
  margin-bottom: 15px;
}

.temperature {
  font-size: 4rem;
  font-weight: 300;
  color: #667eea;
  line-height: 1;
  margin-bottom: 10px;
}

#description {
  font-size: 1.2rem;
  color: #555;
  text-transform: capitalize;
  font-weight: 500;
}

.weather-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px;
  background: rgba(102, 126, 234, 0.05);
  border-radius: 15px;
  transition: all 0.3s ease;
}

.detail-item:hover {
  transform: translateY(-5px);
  background: rgba(102, 126, 234, 0.1);
}

.detail-item i {
  font-size: 1.5rem;
  color: #667eea;
  margin-bottom: 10px;
}

.detail-label {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 5px;
}

.detail-value {
  font-size: 1.2rem;
  font-weight: 600;
  color: #333;
}

/* Forecast Section */
.forecast-section {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 25px;
  padding: 30px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(20px);
}

.section-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 25px;
  text-align: center;
}

.forecast-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.forecast-item {
  background: rgba(102, 126, 234, 0.05);
  border-radius: 15px;
  padding: 20px;
  text-align: center;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.forecast-item:hover {
  transform: translateY(-5px);
  background: rgba(102, 126, 234, 0.1);
  border-color: rgba(102, 126, 234, 0.2);
}

.forecast-day {
  font-weight: 600;
  color: #333;
  margin-bottom: 10px;
}

.forecast-icon {
  font-size: 2.5rem;
  color: #667eea;
  margin: 15px 0;
}

.forecast-temps {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.forecast-high {
  font-weight: 600;
  color: #333;
}

.forecast-low {
  color: #666;
}

.forecast-desc {
  font-size: 0.9rem;
  color: #666;
  margin-top: 10px;
  text-transform: capitalize;
}

/* Footer */
.footer {
  text-align: center;
  margin-top: 40px;
  padding: 20px 0;
  color: rgba(255, 255, 255, 0.8);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer p {
  margin-bottom: 15px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.5rem;
  transition: all 0.3s ease;
}

.footer-links a:hover {
  color: white;
  transform: translateY(-2px);
}

/* Animations */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 15px;
  }

  .app-title {
    font-size: 2rem;
  }

  .weather-main {
    flex-direction: column;
    text-align: center;
    gap: 20px;
  }

  .current-weather {
    padding: 25px;
  }

  .temperature {
    font-size: 3rem;
  }

  .weather-details {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }

  .forecast-container {
    grid-template-columns: 1fr;
    gap: 15px;
  }
}

@media (max-width: 480px) {
  .weather-details {
    grid-template-columns: 1fr;
  }

  .search-container {
    border-radius: 25px;
  }

  .search-input {
    padding: 15px 15px 15px 45px;
  }

  .search-btn {
    padding: 15px 20px;
  }
}
