/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: #333;
  transition: all 0.3s ease;
  overflow-x: hidden;
}

body.dark-mode {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  color: #ffffff;
}

/* Header Styles */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding: 1rem 0;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #ffffff;
  font-weight: 700;
}

.logo i {
  font-size: 2rem;
  color: #ffd700;
}

.logo h1 {
  font-size: 1.75rem;
  font-weight: 700;
  background: linear-gradient(45deg, #ffffff, #ffd700);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.theme-toggle {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50px;
  padding: 0.75rem;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

.theme-toggle i {
  font-size: 1.25rem;
  color: #ffffff;
}

/* Main Content */
.main-content {
  padding-top: 100px;
  min-height: calc(100vh - 100px);
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Search Section */
.search-section {
  width: 100%;
  max-width: 600px;
  margin: 2rem auto;
  padding: 0 2rem;
}

.search-container {
  position: relative;
}

.search-box {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50px;
  padding: 1rem 1.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.search-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.search-box:focus-within {
  border-color: #ffd700;
  box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.1);
}

.search-icon {
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.2rem;
  margin-right: 1rem;
}

#city-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 500;
}

#city-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.search-button {
  background: linear-gradient(45deg, #ffd700, #ffed4e);
  border: none;
  border-radius: 50%;
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #333;
  font-size: 1.1rem;
}

.search-button:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

/* Weather Container */
.weather-section {
  width: 100%;
  max-width: 1200px;
  padding: 0 2rem;
  margin-top: 2rem;
}

.weather-container {
  display: none;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 24px;
  padding: 3rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  color: #ffffff;
  margin-bottom: 30px;
}

.weather-container.show {
  display: block;
  animation: fadeInUp 0.6s ease-out;
}

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

/* Current Weather */
.current-weather {
  text-align: center;
  margin-bottom: 3rem;
}

.location {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: linear-gradient(45deg, #ffffff, #ffd700);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.time {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 2rem;
}

.temperature {
  font-size: 4rem;
  font-weight: 300;
  margin-bottom: 1rem;
  color: #ffffff;
}

.condition {
  font-size: 1.5rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 2rem;
}

.weather-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.detail-card {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 1.5rem;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.detail-card i {
  font-size: 2rem;
  color: #ffd700;
  margin-bottom: 0.5rem;
}

.detail-card h4 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.detail-card p {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
}

/* Forecast */
.forecast {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.forecast-day {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.forecast-day:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.forecast-day h4 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #ffd700;
}

.forecast-day img {
  width: 60px;
  height: 60px;
  margin-bottom: 1rem;
}

.forecast-day .temp {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
}

/* Loading */
.loading-container {
  text-align: center;
  color: #ffffff;
  margin-top: 3rem;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top: 3px solid #ffd700;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

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

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 70%;
  z-index: 2000;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 0%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
}

.modal-content {
  position: relative;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  max-width: 500px;
  width: 90%;
  margin: 5% auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem 2rem 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.modal-header h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #333;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #666;
  transition: color 0.3s ease;
}

.modal-close:hover {
  color: #333;
}

.modal-body {
  padding: 2rem;
}

.modal-weather-info {
  text-align: center;
}

.modal-temp-section {
  margin-bottom: 2rem;
}

.modal-temp-section p {
  font-size: 1.2rem;
  line-height: 1.8;
  color: #333;
}

.modal-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.detail-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 12px;
}

.detail-item i {
  font-size: 1.5rem;
  color: #667eea;
}

.detail-item p {
  font-size: 1rem;
  color: #333;
  font-weight: 500;
}

/* Theme Message */
.theme-message {
  position: fixed;
  top: 100px;
  right: 2rem;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  padding: 1rem 1.5rem;
  border-radius: 50px;
  color: #333;
  font-weight: 600;
  z-index: 1500;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease;
}

.theme-message.show {
  opacity: 1;
  transform: translateX(0);
}

/* Footer */
.footer {
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 2rem 0;
  margin-top: auto;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.8);
}

.footer-content p {
  margin-bottom: 0.5rem;
}

.footer-content i {
  color: #ff6b6b;
  animation: heartbeat 2s ease-in-out infinite;
}

@keyframes heartbeat {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

/* Dark Mode Adjustments */
body.dark-mode .modal-content {
  background: rgba(26, 26, 46, 0.95);
  color: #ffffff;
}

body.dark-mode .modal-header h3 {
  color: #ffffff;
}

body.dark-mode .modal-close {
  color: #ffffff;
}

body.dark-mode .modal-close:hover {
  color: #ffd700;
}

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

body.dark-mode .detail-item p {
  color: #ffffff;
}

body.dark-mode .modal-temp-section p {
  color: #ffffff;
}

body.dark-mode .theme-message {
  background: rgba(26, 26, 46, 0.9);
  color: #ffffff;
}

/* Responsive Design */
@media (max-width: 768px) {
  .header-content {
    padding: 0 1rem;
  }

  .logo h1 {
    font-size: 1.5rem;
  }

  .search-section {
    padding: 0 1rem;
  }

  .weather-section {
    padding: 0 1rem;
  }

  .weather-container {
    padding: 2rem 1.5rem;
  }

  .location {
    font-size: 2rem;
  }

  .temperature {
    font-size: 3rem;
  }

  .weather-details {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .forecast {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
  }

  .modal-content {
    margin: 10% auto;
    width: 95%;
  }

  .modal-details {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .logo h1 {
    font-size: 1.25rem;
  }

  .search-box {
    padding: 0.75rem 1rem;
  }

  .weather-container {
    padding: 1.5rem 1rem;
  }

  .location {
    font-size: 1.75rem;
  }

  .temperature {
    font-size: 2.5rem;
  }

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