:root {
  --day-primary: #4a90e2;
  --day-secondary: #64b5f6;
  --night-primary: #1a237e;
  --night-secondary: #283593;
  --card-glass: rgba(255, 255, 255, 0.15);
  --card-border: rgba(255, 255, 255, 0.2);
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.85);
  --shadow-light: 0 8px 32px rgba(0, 0, 0, 0.1);
  --shadow-medium: 0 12px 48px rgba(0, 0, 0, 0.15);
  --shadow-heavy: 0 20px 60px rgba(0, 0, 0, 0.25);
}

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

body {
  font-family: "Inter", sans-serif;
  background: linear-gradient(
    135deg,
    var(--day-primary) 0%,
    var(--day-secondary) 100%
  );
  min-height: 100vh;
  color: var(--text-primary);
  overflow-x: hidden;
  transition: background 0.6s ease;
}

body.night {
  background: linear-gradient(
    135deg,
    var(--night-primary) 0%,
    var(--night-secondary) 100%
  );
}

/* Animated background particles */
.particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.particle {
  position: absolute;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  animation: float 15s infinite ease-in-out;
}

@keyframes float {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
    opacity: 0.3;
  }
  25% {
    transform: translate(100px, -100px) rotate(90deg);
    opacity: 0.6;
  }
  50% {
    transform: translate(-50px, -200px) rotate(180deg);
    opacity: 0.3;
  }
  75% {
    transform: translate(-150px, -100px) rotate(270deg);
    opacity: 0.6;
  }
}

.container {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  min-height: 100vh;
}

@media (min-width: 1024px) {
  .container {
    grid-template-columns: 400px 1fr;
    padding: 40px;
    gap: 30px;
  }
}

/* Main Weather Card */
.main-weather {
  background: var(--card-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: 30px;
  padding: 40px 30px;
  box-shadow: var(--shadow-medium);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  animation: slideInLeft 0.6s ease-out;
  position: relative;
  overflow: hidden;
}

.main-weather::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.1) 0%,
    transparent 70%
  );
  animation: shimmer 8s infinite;
}

@keyframes shimmer {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(-30%, -30%);
  }
}

.location {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
  animation: fadeIn 0.8s ease-out 0.2s both;
}

.date-time {
  font-size: 0.95rem;
  opacity: 0.8;
  margin-bottom: 30px;
  position: relative;
  z-index: 1;
  animation: fadeIn 0.8s ease-out 0.3s both;
}

.temp-display {
  position: relative;
  z-index: 1;
  margin: 30px 0;
  animation: fadeIn 0.8s ease-out 0.4s both;
}

.temperature {
  font-size: 6rem;
  font-weight: 300;
  line-height: 1;
  margin-bottom: 10px;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.weather-icon {
  font-size: 5rem;
  margin: 20px 0;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.2));
  animation: iconFloat 3s ease-in-out infinite;
}

@keyframes iconFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.weather-desc {
  font-size: 1.5rem;
  font-weight: 400;
  opacity: 0.95;
  text-transform: capitalize;
}

.main-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  width: 100%;
  margin-top: 30px;
  position: relative;
  z-index: 1;
}

.stat-item {
  background: rgba(255, 255, 255, 0.1);
  padding: 15px;
  border-radius: 15px;
  backdrop-filter: blur(10px);
  animation: fadeIn 0.8s ease-out 0.5s both;
}

.stat-label {
  font-size: 0.85rem;
  opacity: 0.7;
  margin-bottom: 5px;
}

.stat-value {
  font-size: 1.3rem;
  font-weight: 600;
}

/* Details Section */
.weather-details {
  animation: slideInRight 0.6s ease-out;
}

.air-quality {
  background: var(--card-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: 25px;
  padding: 25px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-light);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.air-quality:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-medium);
}

.air-quality h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.air-quality-bar {
  position: relative;
  height: 10px;
  background: linear-gradient(90deg, #2e7d32 0%, #fbc02d 50%, #d32f2f 100%);
  border-radius: 10px;
  margin-top: 15px;
  overflow: hidden;
}

.air-quality-indicator {
  position: absolute;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: left 0.6s ease;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.detail-card {
  background: var(--card-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: 25px;
  padding: 25px;
  box-shadow: var(--shadow-light);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  animation: fadeInUp 0.6s ease-out both;
}

.detail-card:nth-child(1) {
  animation-delay: 0.1s;
}
.detail-card:nth-child(2) {
  animation-delay: 0.2s;
}
.detail-card:nth-child(3) {
  animation-delay: 0.3s;
}
.detail-card:nth-child(4) {
  animation-delay: 0.4s;
}
.detail-card:nth-child(5) {
  animation-delay: 0.5s;
}
.detail-card:nth-child(6) {
  animation-delay: 0.6s;
}

.detail-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-medium);
}

.detail-card h4 {
  font-size: 0.9rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.8;
  margin-bottom: 15px;
}

.detail-value {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.detail-description {
  font-size: 0.9rem;
  opacity: 0.8;
  line-height: 1.5;
}

/* Wind Compass */
.wind-compass {
  width: 120px;
  height: 120px;
  margin: 15px auto 20px;
  position: relative;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.compass-labels {
  position: absolute;
  width: 100%;
  height: 100%;
}

.compass-label {
  position: absolute;
  font-weight: 600;
  font-size: 0.85rem;
}

.compass-label.n {
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
}
.compass-label.s {
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
}
.compass-label.e {
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
}
.compass-label.w {
  left: 5px;
  top: 50%;
  transform: translateY(-50%);
}

.wind-arrow {
  position: absolute;
  width: 3px;
  height: 45px;
  background: white;
  top: 10px;
  left: 50%;
  transform-origin: bottom center;
  border-radius: 3px;
  transition: transform 0.8s ease;
}

.wind-arrow::after {
  content: "";
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 12px solid white;
}

/* Pressure Gauge */
.pressure-gauge {
  width: 120px;
  height: 120px;
  margin: 15px auto;
  position: relative;
  border-top: 8px dashed rgba(255, 255, 255, 0.4);
  border-left: 8px dashed rgba(255, 255, 255, 0.4);
  border-right: 8px dashed rgba(255, 255, 255, 0.4);
  border-bottom: 8px dashed transparent;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 10px;
}

.pressure-needle {
  position: absolute;
  top: -8px;
  left: 50%;
  width: 4px;
  height: 50px;
  background: white;
  border-radius: 4px;
  transform-origin: bottom center;
  transition: transform 0.8s ease;
}

.pressure-value {
  font-size: 1.3rem;
  font-weight: 600;
  margin: 0;
}

.pressure-unit {
  font-size: 0.85rem;
  opacity: 0.7;
}

/* Search Sidebar */
.search-sidebar {
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  max-width: 450px;
  height: 100vh;
  background: var(--card-glass);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border-left: 1px solid var(--card-border);
  box-shadow: var(--shadow-heavy);
  padding: 30px;
  z-index: 1000;
  transition: right 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  overflow-y: auto;
}

.search-sidebar.active {
  right: 0;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 30px;
}

.back-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: white;
  font-size: 1.2rem;
}

.back-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.1);
}

.sidebar-header h2 {
  font-size: 1.8rem;
  font-weight: 600;
}

.search-box {
  position: relative;
  margin-bottom: 30px;
}

.search-input {
  width: 100%;
  padding: 18px 55px 18px 20px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  font-family: "Inter", sans-serif;
}

.search-input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.15);
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.search-icon {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.2rem;
}

.cities-list {
  list-style: none;
}

.city-item {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transform: translateX(100%);
  animation: slideInFromRight 0.5s ease-out forwards;
}

.city-item:nth-child(1) {
  animation-delay: 0.1s;
}
.city-item:nth-child(2) {
  animation-delay: 0.2s;
}
.city-item:nth-child(3) {
  animation-delay: 0.3s;
}
.city-item:nth-child(4) {
  animation-delay: 0.4s;
}

.city-item:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateX(0) scale(1.02);
  box-shadow: var(--shadow-light);
}

.city-item:active {
  transform: translateX(0) scale(0.98);
}

.city-info h3 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 5px;
}

.city-time {
  font-size: 0.9rem;
  opacity: 0.7;
}

.city-weather {
  text-align: right;
}

.city-temp {
  font-size: 2rem;
  font-weight: 600;
  display: block;
  margin-bottom: 5px;
}

.city-condition {
  font-size: 0.9rem;
  opacity: 0.8;
}

/* Bottom Nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--card-glass);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border-top: 1px solid var(--card-border);
  padding: 15px 30px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 100;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.1);
}

@media (min-width: 1024px) {
  .bottom-nav {
    position: relative;
    border-radius: 25px;
    border: 1px solid var(--card-border);
    grid-column: 1 / -1;
  }
}

.nav-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  width: 55px;
  height: 55px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: white;
  font-size: 1.3rem;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.1);
}

.nav-btn:active {
  transform: scale(0.95);
}

/* Animations */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInFromRight {
  to {
    transform: translateX(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

/* Loading State */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}
