.layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  padding: 2rem;
  max-width: 1600px;
  margin: 0 auto;
}

.main {
  background: rgba(255, 255, 255, 0.98);
  border-radius: 20px;
  padding: 2.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.night-theme .main {
  background-color: #334155;
}

.sidebar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  height: fit-content;
  position: sticky;
  top: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.sidebar h3 {
  margin-bottom: 1.5rem;
  color: #667eea;
  font-size: 1.5rem;
  font-weight: 700;
}

.sidebar ul {
  list-style: none;
  padding-left: 0rem;
}

.sidebar li {
  margin: 1rem 0;
}

.sidebar a {
  text-decoration: none;
  color: #333;
  font-weight: 500;
  padding: 0.75rem 1rem;
  display: block;
  border-radius: 12px;
  transition: all 0.3s;
  background: rgba(102, 126, 234, 0.05);
}

.sidebar a:hover {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  transform: translateX(5px);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.night-theme .sidebar {
  background-color: #0f172a;
}

.night-theme .sidebar a {
  color: white;
}

.night-theme .sidebar a:hover {
  background: white !important;
  color: black !important;
}

.theme-wrapper {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 20px;
}

#themeToggle {
  cursor: pointer;

}

#searchForm {
  margin: 20px 0;
  display: flex;
  gap: 10px;
  max-width: 400px;
}

#searchForm input {
  flex: 1;
}

.cards {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  flex-wrap: wrap;
  gap: 2rem;
  padding: 1rem;
  margin-top: 2rem;
}

.card {
  position: relative;
  width: 100%;
  max-width: 600px;
  background: #fff;
  border-radius: 15px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  text-align: center;
  padding: 1rem;
  transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
  transform: scale(1.05);
}

.card img {
  width: 100%;
  border-radius: 10px;
  margin-bottom: 1rem;
  height: 300px;
  object-fit: cover;
}

.card h3 {
  font-size: 1.4rem;
  color: #667eea;
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.card p {
  font-size: 1rem;
  color: #666;
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.card:hover .discount {
  animation: pulse 1s infinite;
}

.weather {
  position: absolute;
  top: 15px;
  right: 15px;
  padding: 10px 14px;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: white;
  
  background: rgba(0, 0, 0, 0.6);
  border-radius: 14px;
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
  
  min-width: 85px;
  z-index: 10;
  
  opacity: 0;
  animation: fadeIn 0.6s ease forwards;
  animation-delay: 0.3s;
}

.weather span {
  font-size: 1.3em;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.weather img {
  width: 26px;
  height: 26px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

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

.weather:hover {
  background: rgba(0, 0, 0, 0.75);
  transform: scale(1.08);
  transition: all 0.3s ease;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.night-theme .weather {
  background: rgba(255, 255, 255, 0.25);
  border: 1.5px solid rgba(255, 255, 255, 0.6);
}

.night-theme .weather:hover {
  background: rgba(255, 255, 255, 0.35);
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.discount {
  display: inline-block;
  background: #f7d600;
  color: #000;
  padding: 5px 10px;
  margin-top: 10px;
  border-radius: 5px;
  font-weight: bold;
}

.night-theme .card {
  background-color: #334155;
}

.night-theme .card p {
  color: white !important;
}

.night-theme .card h3 {
  color: #a78bfa;
}


.stats {
  display: flex;
  gap: 40px;
  font-size: 26px;
  font-weight: bold;
  justify-content: center;
  margin-top: 40px;
  padding: 2rem 0;
}

.stat {
  white-space: nowrap;
  text-align: center;
}

.counter {
  font-size: 40px;
  color: #3b82f6;
  display: block;
  margin-bottom: 0.5rem;
}

.night-theme .stats {
  color: white;
}

#scrollProgress {
  position: fixed;
  top: 0;
  left: 0;
  height: 6px;
  width: 0%;
  background: linear-gradient(to right, #3b82f6, #8b5cf6, #ec4899);
  z-index: 9999;
  border-radius: 0 4px 4px 0;
  transition: width 0.15s linear;
}

#greetToast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #3b82f6;
  color: white;
  padding: 10px 16px;
  border-radius: 6px;
  display: none;
  z-index: 2000;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
  animation: fadeOut 2s forwards;
}

@keyframes fadeOut {
  0% {
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

.copyBtn {
  position: relative;
  margin-top: 1rem;
}

.copyBtn:active::after {
  content: "Copied!";
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  background: #3b82f6;
  color: white;
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
}

.copyText {
  min-height: 20px;
  font-size: 0.9rem;
  color: #3b82f6;
}

.lazy-img {
  transition: filter 0.4s;
}

.lazy-img.loaded {
  filter: blur(0);
}

.highlight {
  background: yellow;
  font-weight: bold;
  padding: 2px;
  border-radius: 3px;
}


@media (max-width: 700px) {
  .main h3 {
    font-size: 1.2rem;
  }
  
  .card p {
    font-size: 0.9rem;
  }
  
  .layout {
    grid-template-columns: 1fr;
    padding: 1rem;
  }

  .sidebar {
    position: relative;
    top: 0;
  }

  .main {
    padding: 1.5rem;
  }

  .cards {
    padding: 0.5rem;
  }

  .card {
    max-width: 100%;
  }

  .card img {
    height: 200px;
  }

  .weather {
    top: 25px;
    right: 25px;
    padding: 8px 10px;
    font-size: 13px;
    min-width: 70px;
    gap: 6px;
  }

  .weather span {
    font-size: 1.1em;
  }

  .weather img {
    width: 20px;
    height: 20px;
  }

  .stats {
    flex-direction: column;
    gap: 20px;
    font-size: 20px;
  }

  .counter {
    font-size: 30px;
  }
}

@media (min-width: 700px) and (max-width: 992px) {
  .main h3 {
    font-size: 1.3rem;
  }
  
  .card p {
    font-size: 1rem;
  }

  .weather {
    top: 25px;
    right: 25px;
    padding: 9px 12px;
    font-size: 14px;
    min-width: 78px;
  }

  .weather span {
    font-size: 1.2em;
  }

  .weather img {
    width: 23px;
    height: 23px;
  }

  .stats {
    gap: 30px;
    font-size: 24px;
  }

  .counter {
    font-size: 36px;
  }
}

@media (max-width: 1024px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    top: 0;
  }
}

@media (min-width: 993px) {
  .main h3 {
    font-size: 1.5rem;
  }
  
  .card p {
    font-size: 1.1rem;
  }

  .weather {
    top: 25px;
    right: 25px;
    padding: 10px 14px;
    font-size: 16px;
    min-width: 85px;
  }
}
.modeButton {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.modeButton:hover {
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}
