/* Preloader */
.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg-darker);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.preloader.loaded {
  opacity: 0;
  visibility: hidden;
}

.loader {
  width: 60px;
  height: 60px;
  position: relative;
}

.loader:before,
.loader:after {
  content: '';
  border-radius: 50%;
  position: absolute;
  inset: 0;
  box-shadow: 0 0 10px 2px rgba(0, 0, 0, 0.3) inset;
}

.loader:after {
  box-shadow: 0 2px 0 var(--primary-color) inset;
  animation: rotate 2s linear infinite;
}

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

/* Scroll to top button */
.scroll-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--card-bg);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  border: none;
  color: var(--light-text);
  font-size: 1.2rem;
  transition: all 0.3s ease;
  opacity: 0;
  visibility: hidden;
  border: 2px solid var(--primary-color);
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.scroll-to-top:hover {
  transform: translateY(-5px);
  background: var(--primary-color);
}

.scroll-to-top::after {
  content: '↑';
  font-size: 1.5rem;
  font-weight: bold;
}

/* Pulse animation for the scroll-to-top button when visible */
@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

.scroll-to-top.visible {
  animation: pulse 2s infinite;
}

/* Floating additional info */
.floating-info {
  position: fixed;
  top: 80px;
  right: 20px;
  background: var(--card-bg);
  border-radius: 5px;
  padding: 15px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  z-index: 90;
  max-width: 300px;
  transition: transform 0.3s ease, opacity 0.3s ease;
  transform: translateX(120%);
  opacity: 0;
}

.floating-info.visible {
  transform: translateX(0);
  opacity: 1;
}

.floating-info h4 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 16px;
  color: var(--primary-color);
}

.floating-info p {
  font-size: 14px;
  margin-bottom: 0;
}

.floating-info .close-btn {
  position: absolute;
  top: 5px;
  right: 5px;
  background: transparent;
  border: none;
  color: var(--text-color);
  cursor: pointer;
  font-size: 16px;
}

/* Cookie consent */
.cookie-consent {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--card-bg);
  border-radius: 5px;
  padding: 15px 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  z-index: 99;
  max-width: 320px;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cookie-consent.visible {
  opacity: 1;
  visibility: visible;
}

.cookie-consent p {
  font-size: 14px;
  margin-bottom: 10px;
}

.cookie-consent .btn {
  margin-top: 10px;
  padding: 8px 15px;
  font-size: 14px;
}
