@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap");

:root {
  --primary-color: #5598fd;
  --secondary-color: #4a90e2;
  --accent-color: #ff6b6b;
  --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --glass-bg: rgba(255, 255, 255, 0.25);
  --glass-border: rgba(255, 255, 255, 0.18);
  --shadow-light: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
  --shadow-dark: 0 4px 15px 0 rgba(0, 0, 0, 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}


.loading-spinner {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--gradient-1);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 1;
  transition: opacity 0.5s ease-out;
}

.loading-spinner.hidden {
  opacity: 0;
  pointer-events: none;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

.loading-spinner p {
  color: white;
  font-size: 18px;
  font-weight: 500;
}

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

body {
  display: flex;
  justify-content: center;
  min-height: 100vh;
  min-width: 1000px;
  padding: 50px;
  background: var(--gradient-1);
  transition: background 0.5s ease;
  overflow-x: auto;
}

img {
  width: 100%;
}

.wrapper {
  display: flex;
  width: 1200px;
  min-width: 900px;
  border-radius: 25px;
  overflow: hidden;
  backdrop-filter: blur(10px);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-light);
  animation: slideInUp 0.8s ease-out;
}

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

.sidebar {
  width: 30%;
  min-width: 250px;
  padding: 30px 20px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.sidebar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-3);
  animation: shimmer 2s ease-in-out infinite;
}

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

.search {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;
  margin-top: 20px;
  position: relative;
  animation: fadeInDown 0.6s ease-out 0.2s both;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.search input {
  width: 100%;
  height: 45px;
  border: 2px solid transparent;
  border-top-left-radius: 12px;
  border-bottom-left-radius: 12px;
  padding: 0 15px;
  font-size: 14px;
  color: #495057;
  background: rgba(255, 255, 255, 0.9);
  transition: all 0.3s ease;
}

.search input:focus {
  outline: none;
  border: 2px solid var(--primary-color);
  background: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(85, 152, 253, 0.3);
}

.search button {
  min-width: 45px;
  height: 45px;
  border: none;
  border-top-right-radius: 12px;
  border-bottom-right-radius: 12px;
  background: var(--gradient-3);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.search button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(74, 144, 226, 0.4);
}

.search button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.3s ease, height 0.3s ease;
}

.search button:active::before {
  width: 100px;
  height: 100px;
}
.search ul {
  max-height: 300px;
  overflow-y: auto;
  position: absolute;
  width: 100%;
  top: 47px;
  border-radius: 12px;
  transition: all 0.3s ease;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  z-index: 1000;
}

.search ul li {
  padding: 12px 15px;
  border-bottom: 1px solid rgba(241, 241, 241, 0.5);
  cursor: pointer;
  text-transform: capitalize;
  transition: all 0.2s ease;
  position: relative;
}

.search ul li:last-child {
  border-bottom: none;
}

.search ul li:hover {
  background: var(--gradient-3);
  color: white;
  transform: translateX(5px);
}

.search ul li.active {
  background: var(--primary-color);
  color: white;
}

.weather-icon {
  width: 100%;
  height: 150px;
  text-align: center;
  margin-top: 20px;
  margin-bottom: 100px;
  animation: fadeInScale 0.8s ease-out 0.4s both;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.weather-icon #icon {
  width: 80%;
  object-fit: cover;
  transition: all 0.3s ease;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.weather-icon #icon:hover {
  transform: scale(1.05) rotate(5deg);
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.15));
}

.temperature {
  display: flex;
  animation: fadeInRight 0.6s ease-out 0.6s both;
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.temperature #temp {
  font-size: 70px;
  font-weight: 300;
  line-height: 1;
  background: var(--gradient-3);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: all 0.3s ease;
}

.temperature span {
  font-size: 40px;
  margin-top: -10px;
  display: block;
  color: var(--secondary-color);
  font-weight: 500;
}
.divider {
  width: 100%;
  height: 2px;
  background: var(--gradient-3);
  margin: 20px 0;
  border-radius: 1px;
  animation: fadeIn 0.6s ease-out 0.8s both;
}

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

.condition-rain {
  font-size: 12px;
  text-transform: capitalize;
  animation: fadeInUp 0.6s ease-out 1s both;
}

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

.condition-rain div {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.condition-rain div:hover {
  background: rgba(85, 152, 253, 0.1);
  transform: translateX(5px);
}

.condition-rain div i {
  width: 20px;
  color: var(--primary-color);
  font-size: 14px;
}

.location {
  display: flex;
  align-items: center;
  font-size: 14px;
  gap: 10px;
  margin-top: 10px;
  padding: 12px;
  background: rgba(85, 152, 253, 0.1);
  border-radius: 12px;
  border-left: 4px solid var(--primary-color);
  animation: fadeInLeft 0.6s ease-out 1.2s both;
}

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

.location i {
  color: var(--primary-color);
  font-size: 16px;
}

.main {
  width: 100%;
  min-width: 400px;
  padding: 30px 40px;
  background: rgba(246, 246, 248, 0.95);
  backdrop-filter: blur(20px);
  position: relative;
  padding-bottom: 90px;
  animation: fadeInRight 0.8s ease-out 0.3s both;
}

.main nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  animation: fadeInDown 0.6s ease-out 0.5s both;
}

.main nav .options {
  display: flex;
  gap: 20px;
  align-items: center;
}

.main nav .options button {
  border: none;
  background: none;
  font-size: 16px;
  font-weight: 600;
  color: #495057;
  cursor: pointer;
  text-transform: capitalize;
  padding: 8px 16px;
  border-radius: 8px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.main nav .options button::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--gradient-3);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.main nav .options button:hover {
  color: var(--primary-color);
  background: rgba(85, 152, 253, 0.1);
}

.main nav .options button.active {
  color: var(--primary-color);
  background: rgba(85, 152, 253, 0.15);
}

.main nav .options button.active::before {
  width: 100%;
}

.main nav .units button {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  color: #1a1a1a;
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid transparent;
  transition: all 0.3s ease;
  font-weight: 600;
  cursor: pointer;
}

.main nav .units button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.main nav .units button.active {
  color: #fff;
  background: var(--gradient-3);
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 15px rgba(85, 152, 253, 0.4);
}
.main .cards {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 50px;
  animation: fadeInUp 0.8s ease-out 0.7s both;
}

.cards .card {
  width: 100px;
  height: 130px;
  border-radius: 20px;
  color: #1a1a1a;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  text-align: center;
  padding: 10px 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.4s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.cards .card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--gradient-3);
  opacity: 0;
  transition: all 0.4s ease;
  z-index: -1;
}

.cards .card:hover::before {
  left: 0;
  opacity: 0.1;
}

.cards .card:hover {
  transform: translateY(-10px) scale(1.05);
  box-shadow: 0 15px 35px rgba(85, 152, 253, 0.3);
  color: var(--primary-color);
}

.card h2 {
  font-size: 15px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.card .card-icon {
  width: 50%;
  margin: 0 auto;
  transition: all 0.3s ease;
}

.cards .card:hover .card-icon {
  transform: scale(1.2) rotate(10deg);
}

.card .day-temp {
  font-size: 12px;
  display: flex;
  justify-content: center;
  font-weight: 500;
}
.highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 50px;
  animation: fadeInUp 0.8s ease-out 0.9s both;
}

.highlights .heading {
  width: 100%;
  font-size: 20px;
  font-weight: 600;
  text-transform: capitalize;
  color: #333;
  margin-bottom: 10px;
  position: relative;
}

.highlights .heading::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 60px;
  height: 3px;
  background: var(--gradient-3);
  border-radius: 2px;
}

.card2 {
  width: 250px;
  height: 150px;
  border-radius: 20px;
  color: #1a1a1a;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 20px;
  display: flex;
  flex-direction: column;
  transition: all 0.4s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.card2::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-3);
  transform: scaleX(0);
  transition: transform 0.4s ease;
}

.card2:hover::before {
  transform: scaleX(1);
}

.card2:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 30px rgba(85, 152, 253, 0.25);
}

.card2 .card-heading {
  color: #888;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.tooltip-icon {
  color: #5598fd;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  opacity: 0.7;
}

.tooltip-icon:hover {
  opacity: 1;
  transform: scale(1.2);
  color: #4a90e2;
}

.card2[data-tooltip] {
  position: relative;
}

.card2[data-tooltip]:hover::before {
  content: attr(data-tooltip);
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%) translateY(-100%);
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.95), rgba(20, 20, 20, 0.95));
  color: white;
  padding: 16px 20px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
  white-space: normal;
  width: 320px;
  text-align: left;
  z-index: 1000;
  opacity: 0;
  animation: tooltipFadeIn 0.4s ease forwards;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-family: 'Poppins', sans-serif;
  font-weight: 400;
}

.card2[data-tooltip]:hover::after {
  content: '';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  border: 8px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.95);
  z-index: 1001;
  opacity: 0;
  animation: tooltipFadeIn 0.4s ease forwards;
}

@keyframes tooltipFadeIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-100%) scale(0.8);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(-100%) scale(1);
  }
}

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

.highlights .cards .card2.tooltip-active::before {
  content: attr(data-tooltip) !important;
  position: absolute !important;
  bottom: 110% !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  background: linear-gradient(135deg, rgba(18, 18, 18, 0.95), rgba(40, 40, 40, 0.95)) !important;
  color: white !important;
  padding: 16px 20px !important;
  border-radius: 12px !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
  white-space: pre-wrap !important;
  z-index: 10000 !important;
  max-width: 300px !important;
  min-width: 200px !important;
  text-align: left !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  backdrop-filter: blur(15px) !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: none !important;
  display: block !important;
}

.highlights .cards .card2.tooltip-active::after {
  content: '' !important;
  position: absolute !important;
  bottom: 100% !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  border: 10px solid transparent !important;
  border-top-color: rgba(18, 18, 18, 0.95) !important;
  z-index: 10001 !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: none !important;
  display: block !important;
}

.card2.tooltip-active {
  animation: cardGlow 0.8s ease;
  border: 2px solid rgba(85, 152, 253, 0.5);
}

.card2.tooltip-active::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 110%;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, rgba(18, 18, 18, 0.95), rgba(40, 40, 40, 0.95));
  color: white;
  padding: 16px 20px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  z-index: 1000;
  max-width: 300px;
  min-width: 200px;
  text-align: left;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(15px);
  animation: tooltipSlideIn 0.3s ease forwards;
  opacity: 1;
  visibility: visible;
  pointer-events: none;
}

.card2.tooltip-active::after {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 10px solid transparent;
  border-top-color: rgba(18, 18, 18, 0.95);
  z-index: 1001;
  animation: tooltipSlideIn 0.3s ease forwards;
  opacity: 1;
  visibility: visible;
  pointer-events: none;
}

@keyframes tooltipSlideIn {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes cardGlow {
  0%, 100% {
    box-shadow: 0 12px 30px rgba(85, 152, 253, 0.25);
  }
  50% {
    box-shadow: 0 12px 40px rgba(85, 152, 253, 0.4);
  }
}

@keyframes iconPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.8;
  }
}

.card2 .card-heading .tooltip-icon {
  margin-left: 8px;
}

.card-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mini-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(85, 152, 253, 0.2);
  border-top: 3px solid #5598fd;
  border-radius: 50%;
  animation: miniSpin 1s linear infinite;
}

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

.card2 .content {
  position: relative;
}

.card2.loaded .card-spinner {
  display: none;
}

.card2:not(.loaded) .content > p {
  opacity: 0.3;
}

.card2 .content {
  margin-top: auto;
}

.card2 .content p:first-child {
  text-align: center;
  font-size: 32px;
  font-weight: 600;
  background: var(--gradient-3);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 10px;
}

.card2 .content p:nth-child(2) {
  font-size: 12px;
  text-align: center;
  color: #666;
  font-weight: 500;
}

.credits {
  text-align: center;
  font-size: 14px;
  color: #333;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  animation: fadeIn 1s ease-out 1.5s both;
}

.credits a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 700;
  background: var(--gradient-3);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: all 0.3s ease;
}

.credits a:hover {
  text-decoration: underline;
  text-shadow: 0 2px 4px rgba(85, 152, 253, 0.3);
}

@media (max-width: 1200px) {
  .wrapper {
    width: 100%;
    min-width: 800px;
  }
}

@media (max-width: 900px) {
  .wrapper {
    flex-direction: column;
    min-width: 100%;
  }
  
  .sidebar {
    width: 100%;
    min-width: 100%;
  }
  
  .main {
    width: 100%;
    min-width: 100%;
  }
  
  .cards .card {
    width: calc(20% - 16px);
    min-width: 80px;
  }
  
  .card2 {
    width: calc(50% - 10px);
  }
}

@media (max-width: 600px) {
  body {
    padding: 20px;
  }
  
  .cards .card {
    width: calc(25% - 15px);
  }
  
  .card2 {
    width: 100%;
  }
  
  .card2[data-tooltip]:hover::before {
    width: 250px;
    font-size: 11px;
    padding: 10px 12px;
  }
  
  .tooltip-icon {
    font-size: 14px;
  }
}