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

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  transition: background 0.8s ease;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Динамические фоны для разной погоды */
body.weather-clear {
  background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
}

body.weather-cloudy {
  background: linear-gradient(135deg, #a1c4fd 0%, #c2e9fb 100%);
}

body.weather-rain {
  background: linear-gradient(135deg, #5c6bc0 0%, #3f51b5 100%);
}

body.weather-snow {
  background: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%);
}

body.weather-thunder {
  background: linear-gradient(135deg, #434343 0%, #1a1a1a 100%);
}

body.weather-fog {
  background: linear-gradient(135deg, #9fa2b2 0%, #cfd9df 100%);
}

.weather-container {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  text-align: center;
  max-width: 400px;
  width: 100%;
}

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

.controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 15px;
}

.city-select {
  padding: 10px 15px;
  border: 2px solid #667eea;
  border-radius: 10px;
  font-size: 14px;
  color: #333;
  background: white;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}

.city-select:hover {
  border-color: #764ba2;
}

.gps-btn {
  width: 42px;
  height: 42px;
  border: 2px solid #667eea;
  border-radius: 10px;
  background: white;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gps-btn:hover {
  background: #667eea;
  border-color: #667eea;
}

.gps-btn.active {
  background: #667eea;
  border-color: #667eea;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.city-name {
  font-size: 20px;
  color: #666;
  margin-bottom: 10px;
  font-weight: 500;
}

.temperature {
  font-size: 72px;
  font-weight: bold;
  color: #667eea;
  margin: 10px 0;
}

.unit {
  font-size: 24px;
  color: #999;
}

.description {
  font-size: 20px;
  color: #666;
  margin-bottom: 30px;
  min-height: 30px;
}

.details {
  display: flex;
  justify-content: space-around;
  margin-bottom: 30px;
  padding: 20px;
  background: #f5f5f5;
  border-radius: 10px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.label {
  font-size: 14px;
  color: #999;
}

.detail-item span:nth-child(2) {
  font-size: 24px;
  font-weight: bold;
  color: #333;
}

.refresh-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 15px 40px;
  border-radius: 30px;
  font-size: 16px;
  cursor: pointer;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.refresh-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4);
}

.refresh-btn:active {
  transform: translateY(0);
}

.error {
  color: #e74c3c;
  padding: 20px;
}

/* 3D Canvas для шейдеров */
#weather-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  pointer-events: none;
}

/* Анимированные погодные эффекты */
.weather-effects {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

/* Солнечные лучи */
.sun-rays {
  position: absolute;
  top: -100px;
  right: -100px;
  width: 400px;
  height: 400px;
}

.sun {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, #ffd700 0%, #ff8c00 100%);
  border-radius: 50%;
  box-shadow:
    0 0 60px #ffd700,
    0 0 100px #ff8c00;
  animation: sun-pulse 4s ease-in-out infinite;
}

.ray {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 200px;
  height: 4px;
  background: linear-gradient(90deg, rgba(255, 215, 0, 0.8), transparent);
  transform-origin: left center;
  animation: ray-rotate 20s linear infinite;
}

.ray:nth-child(2) {
  transform: rotate(30deg);
  animation-delay: -2s;
}
.ray:nth-child(3) {
  transform: rotate(60deg);
  animation-delay: -4s;
}
.ray:nth-child(4) {
  transform: rotate(90deg);
  animation-delay: -6s;
}
.ray:nth-child(5) {
  transform: rotate(120deg);
  animation-delay: -8s;
}
.ray:nth-child(6) {
  transform: rotate(150deg);
  animation-delay: -10s;
}
.ray:nth-child(7) {
  transform: rotate(180deg);
  animation-delay: -12s;
}
.ray:nth-child(8) {
  transform: rotate(210deg);
  animation-delay: -14s;
}
.ray:nth-child(9) {
  transform: rotate(240deg);
  animation-delay: -16s;
}
.ray:nth-child(10) {
  transform: rotate(270deg);
  animation-delay: -18s;
}
.ray:nth-child(11) {
  transform: rotate(300deg);
  animation-delay: -20s;
}
.ray:nth-child(12) {
  transform: rotate(330deg);
  animation-delay: -22s;
}

@keyframes sun-pulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow:
      0 0 60px #ffd700,
      0 0 100px #ff8c00;
  }
  50% {
    transform: scale(1.1);
    box-shadow:
      0 0 80px #ffd700,
      0 0 120px #ff8c00;
  }
}

@keyframes ray-rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Облака */
.cloud {
  position: absolute;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 50px;
  animation: cloud-float 20s ease-in-out infinite;
}

.cloud::before,
.cloud::after {
  content: "";
  position: absolute;
  background: inherit;
  border-radius: 50%;
}

.cloud-1 {
  width: 120px;
  height: 40px;
  top: 10%;
  left: -150px;
  animation-delay: 0s;
}

.cloud-1::before {
  width: 50px;
  height: 50px;
  top: -25px;
  left: 20px;
}

.cloud-1::after {
  width: 40px;
  height: 40px;
  top: -15px;
  left: 55px;
}

.cloud-2 {
  width: 100px;
  height: 35px;
  top: 25%;
  left: -150px;
  animation-delay: -7s;
  animation-duration: 25s;
}

.cloud-2::before {
  width: 40px;
  height: 40px;
  top: -20px;
  left: 15px;
}

.cloud-2::after {
  width: 35px;
  height: 35px;
  top: -12px;
  left: 45px;
}

.cloud-3 {
  width: 80px;
  height: 30px;
  top: 15%;
  left: -150px;
  animation-delay: -14s;
  animation-duration: 22s;
}

.cloud-3::before {
  width: 35px;
  height: 35px;
  top: -18px;
  left: 12px;
}

.cloud-3::after {
  width: 30px;
  height: 30px;
  top: -10px;
  left: 38px;
}

@keyframes cloud-float {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(calc(100vw + 300px));
  }
}

/* Дождь */
.rain-drop {
  position: absolute;
  width: 2px;
  height: 20px;
  background: linear-gradient(transparent, rgba(174, 194, 224, 0.8));
  animation: rain-fall linear infinite;
}

@keyframes rain-fall {
  0% {
    transform: translateY(-100vh);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(100vh);
    opacity: 0;
  }
}

/* Снег */
.snowflake {
  position: absolute;
  width: 10px;
  height: 10px;
  background: white;
  border-radius: 50%;
  filter: blur(1px);
  animation: snow-fall linear infinite;
}

@keyframes snow-fall {
  0% {
    transform: translateY(-100vh) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(360deg);
    opacity: 0;
  }
}

/* Гроза - молнии */
.lightning {
  position: absolute;
  top: 0;
  left: 50%;
  width: 200px;
  height: 200px;
  animation: lightning-flash 5s ease-in-out infinite;
  opacity: 0;
}

.lightning::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 100%;
  background: #fff;
  clip-path: polygon(
    50% 0%,
    0% 40%,
    40% 40%,
    30% 100%,
    70% 60%,
    60% 60%,
    100% 0%
  );
}

.lightning::after {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  height: 300px;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.3) 0%,
    transparent 70%
  );
}

@keyframes lightning-flash {
  0%,
  89%,
  91%,
  93%,
  95%,
  100% {
    opacity: 0;
  }
  90%,
  92%,
  94% {
    opacity: 1;
  }
}

/* Туман */
.fog {
  position: absolute;
  width: 200%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.3) 50%,
    transparent 100%
  );
  animation: fog-move 10s ease-in-out infinite;
}

.fog-1 {
  top: 20%;
  animation-delay: 0s;
}
.fog-2 {
  top: 50%;
  animation-delay: -5s;
}
.fog-3 {
  top: 80%;
  animation-delay: -2s;
}

@keyframes fog-move {
  0% {
    transform: translateX(-50%);
  }
  100% {
    transform: translateX(50%);
  }
}

/* Loader 3D */
.loader-3d {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  z-index: 9999;
  transition: opacity 0.5s ease;
}

.loader-3d.hidden {
  opacity: 0;
  pointer-events: none;
}

.loader-sphere {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
  animation: loader-bounce 1s ease-in-out infinite;
  box-shadow: 0 0 30px rgba(246, 211, 101, 0.5);
}

@keyframes loader-bounce {
  0%,
  100% {
    transform: scale(1) translateY(0);
  }
  50% {
    transform: scale(1.1) translateY(-20px);
  }
}

/* Scroll Indicator */
.scroll-indicator {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  font-size: 24px;
  animation: scroll-bounce 2s ease-in-out infinite;
  opacity: 0.7;
  z-index: 100;
  cursor: pointer;
}

.scroll-indicator.hidden {
  opacity: 0;
  pointer-events: none;
}

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

/* GSAP Animations */
.weather-container {
  opacity: 0;
  transform: translateY(30px);
}

.weather-container.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Mouse interaction effects */
body {
  cursor: default;
}

.weather-container:hover {
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
}

.refresh-btn:hover {
  cursor: pointer;
}

.city-select:hover,
.gps-btn:hover {
  cursor: pointer;
}

/* Hourly Forecast */
.hourly-forecast {
  margin: 20px 0;
  padding: 15px;
  background: #f5f5f5;
  border-radius: 10px;
}

.hourly-forecast h3 {
  font-size: 16px;
  color: #333;
  margin-bottom: 15px;
}

.hourly-list {
  display: flex;
  gap: 10px;
  overflow-x: hidden;
  padding-bottom: 10px;
  justify-content: space-between;
}

.hourly-item {
  min-width: 70px;
  padding: 10px;
  background: white;
  border-radius: 8px;
  text-align: center;
}

.hourly-time {
  font-size: 12px;
  color: #666;
  margin-bottom: 5px;
}

.hourly-temp {
  font-size: 18px;
  font-weight: bold;
  color: #667eea;
}

.hourly-icon {
  font-size: 24px;
  margin: 5px 0;
}

/* Map Container */
.map-container {
  display: none;
  margin-top: 20px;
  border-radius: 10px;
  overflow: hidden;
}

.map-container.active {
  display: block;
}

#map {
  width: 100%;
  height: 300px;
  border-radius: 10px;
}

.leaflet-container {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}
