@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

body {
  min-height: 100vh;
  background: linear-gradient(-45deg, #0f172a, #1e1b4b, #311042, #0f172a);
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

/* Background Animated Gradient */
@keyframes gradientBG {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Main Card */
.weather-card {
  width: 100%;
  max-width: 420px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 30px;
  padding: 32px 28px;
  color: #ffffff;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4),
              inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: transform 0.3s ease;
}

.weather-card:hover {
  transform: translateY(-5px);
}

/* Search Controls */
.search-box {
  display: flex;
  gap: 10px;
  align-items: center;
}

.input-wrapper {
  position: relative;
  flex: 1;
}

.input-wrapper i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 16px;
  transition: color 0.3s ease;
}

.input-wrapper input {
  width: 100%;
  padding: 14px 16px 14px 46px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: all 0.3s ease;
}

.input-wrapper input::placeholder {
  color: #64748b;
}

.input-wrapper input:focus {
  border-color: #38bdf8;
  background: rgba(15, 23, 42, 0.8);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.25);
}

.input-wrapper input:focus + i {
  color: #38bdf8;
}

button {
  border: none;
  background: linear-gradient(135deg, #38bdf8, #818cf8);
  color: #ffffff;
  padding: 14px 18px;
  border-radius: 18px;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(56, 189, 248, 0.3);
}

button:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.5);
}

button:active {
  transform: scale(0.98);
}

.unit-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: none;
}

.unit-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

/* Error Alert */
.error-msg {
  display: none;
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  margin-top: 15px;
  text-align: center;
}

/* Loader */
.loader {
  display: none;
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: #38bdf8;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 25px auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Location Header */
.location-details {
  text-align: center;
  margin-top: 25px;
}

.location-details h1 {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.location-details p {
  color: #94a3b8;
  font-size: 14px;
  margin-top: 2px;
  font-weight: 500;
}

/* Main Display & Floating Animation */
.main-display {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  margin: 25px 0 10px 0;
}

.weather-icon-box i {
  font-size: 70px;
  background: linear-gradient(135deg, #38bdf8, #f43f5e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 10px 15px rgba(56, 189, 248, 0.3));
  animation: float 4s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}

.temp-box {
  font-size: 60px;
  font-weight: 800;
  letter-spacing: -2px;
}

.unit-symbol {
  font-size: 26px;
  vertical-align: top;
  color: #38bdf8;
  font-weight: 600;
}

.condition-text {
  text-align: center;
  color: #cbd5e1;
  font-size: 15px;
  text-transform: capitalize;
  margin-bottom: 28px;
  letter-spacing: 0.5px;
}

/* Metrics Grid Cards */
.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.metric-card {
  background: rgba(15, 23, 42, 0.4);
  padding: 16px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.3s ease;
}

.metric-card:hover {
  background: rgba(15, 23, 42, 0.65);
  border-color: rgba(56, 189, 248, 0.3);
  transform: translateY(-3px);
}

.metric-card i {
  font-size: 22px;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  padding: 10px;
  border-radius: 12px;
}

.metric-card span {
  display: block;
  font-size: 11px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.metric-card p {
  font-size: 15px;
  font-weight: 700;
  margin-top: 2px;
  color: #f8fafc;
}

/* Weather Body Transition */
.weather-body {
  transition: opacity 0.3s ease;
}