/* =========================== */
/* Scroll-to-Top Button Styles */
/* =========================== */

/* Keyframes for the arrow animation (choose one or modify) */
@keyframes jumpArrow {

  0%,
  100% {
    transform: translateY(0);
    /* Normal position */
  }

  50% {
    transform: translateY(-4px);
    /* Move up slightly */
  }
}

/* Keyframes for flashing arrow (alternative) */
/*
@keyframes flashArrow {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}
*/

/* Base button style (Visible State) */
.up-btn {
  /* Positioning & Size */
  width: 50px;
  height: 50px;
  right: 20px;
  bottom: 20px;
  position: fixed;
  z-index: 2000;
  /* Ensure it's above other content */

  /* Appearance */
  background: #ec5493;
  /* Your desired background */
  border-radius: 50%;
  /* Make it circular */
  cursor: pointer;
  box-sizing: border-box;
  /* Include padding/border in size */

  /* For centering content (the SVG container) */
  display: flex;
  justify-content: center;
  align-items: center;

  /* Animation Properties - Visible State */
  transform: scale(1) translateY(0);
  /* End state for transform */
  opacity: 1;

  /* Glow effect matching the milestone ticks */
  box-shadow:
    0 0 8px 2px rgba(236, 84, 147, 0.6),
    0 2px 8px rgba(0, 0, 0, 0.3);
  animation: subtleGlow 2.5s ease-in-out infinite;

  /* Transition definition - applied when class changes */
  /* Using slide + fade example */
  transition: transform 0.4s ease-out, opacity 0.3s ease-out;
}

/* Glow animation matching milestone ticks */
@keyframes subtleGlow {

  0%,
  100% {
    box-shadow:
      0 0 8px 2px rgba(236, 84, 147, 0.6),
      0 2px 8px rgba(0, 0, 0, 0.3);
  }

  50% {
    box-shadow:
      0 0 16px 4px rgba(255, 112, 177, 0.8),
      0 0 24px 6px rgba(236, 84, 147, 0.4),
      0 2px 8px rgba(0, 0, 0, 0.3);
  }
}

/* Styles for the button when it's hidden */
.up-btn.up-btn__hide {
  /* Animation Properties - Hidden State */
  transform: scale(0.5) translateY(30px);
  /* Start smaller and lower */
  opacity: 0;
  /* Start invisible */
  pointer-events: none;
  /* Prevent clicks when hidden */
}

/* Hover effect for the button */
.up-btn:hover {
  opacity: 1;
  /* Become fully opaque on hover */
}

/* Container for the image/SVG inside the button */
.up-btn__img {
  width: 100%;
  max-width: 100%;
  padding: 10px;
  /* Adjust padding around SVG */
  box-sizing: border-box;
  display: flex;
  /* Helps center SVG */
  justify-content: center;
  align-items: center;
}

/* Styles for the SVG arrow itself */
.up-btn .up-btn__img svg {
  /* Ensure visibility & sizing */
  fill: #fff;
  /* Arrow color */
  width: 75%;
  /* Adjust size relative to button */
  height: 75%;
  /* Adjust size relative to button */

  /* Apply the chosen animation */
  animation: jumpArrow 1s infinite ease-in-out;
  /* Or use flashArrow: */
  /* animation: flashArrow 1.5s infinite ease-in-out; */
}

/* =========================== */
/* Home Button Styles          */
/* =========================== */

.home-btn {
  /* Positioning & Size */
  width: 50px;
  height: 50px;
  right: 20px;
  bottom: 80px;
  /* Above the up-btn */
  position: fixed;
  z-index: 2000;

  /* Appearance */
  background: #4a90d9;
  border-radius: 50%;
  cursor: pointer;
  box-sizing: border-box;
  text-decoration: none;

  /* For centering content */
  display: flex;
  justify-content: center;
  align-items: center;

  /* Glow effect */
  box-shadow:
    0 0 8px 2px rgba(74, 144, 217, 0.6),
    0 2px 8px rgba(0, 0, 0, 0.3);

  /* Spin in from right on load (delayed 1s), then glow continuously */
  animation: homeSpinIn 0.6s ease-out 1s forwards, homeGlow 2.5s ease-in-out 1.6s infinite;
  opacity: 0;
  /* Start hidden until animation kicks in */

  /* Transition */
  transition: transform 0.3s ease, background 0.3s ease;
}

@keyframes homeSpinIn {
  0% {
    transform: translateX(100px) rotate(-360deg);
    opacity: 0;
  }

  100% {
    transform: translateX(0) rotate(0deg);
    opacity: 1;
  }
}

.home-btn i {
  color: #fff;
  font-size: 22px;
}

.home-btn:hover {
  background: #5aa0e9;
  transform: scale(1.1);
}

@keyframes homeGlow {

  0%,
  100% {
    box-shadow:
      0 0 8px 2px rgba(74, 144, 217, 0.6),
      0 2px 8px rgba(0, 0, 0, 0.3);
  }

  50% {
    box-shadow:
      0 0 16px 4px rgba(100, 160, 230, 0.8),
      0 0 24px 6px rgba(74, 144, 217, 0.4),
      0 2px 8px rgba(0, 0, 0, 0.3);
  }
}

/* =========================== */
/* Filter Button Styles        */
/* =========================== */

.filter-btn {
  /* Positioning & Size */
  width: 50px;
  height: 50px;
  right: 20px;
  bottom: 140px;
  /* Above home-btn */
  position: fixed;
  z-index: 2000;

  /* Appearance */
  background: #8b5cf6;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-sizing: border-box;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;

  /* Glow effect */
  box-shadow:
    0 0 8px 2px rgba(139, 92, 246, 0.6),
    0 2px 8px rgba(0, 0, 0, 0.3);

  /* Animation on load */
  animation: filterSpinIn 0.6s ease-out 1.3s forwards, filterGlow 2.5s ease-in-out 1.9s infinite;
  opacity: 0;

  /* Transition */
  transition: transform 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}

.filter-btn:hover {
  background: #a78bfa;
  transform: scale(1.1);
}

/* Active/Toggled state */
.filter-btn.active {
  background: #f59e0b;
  opacity: 1;
  box-shadow:
    0 0 12px 4px rgba(245, 158, 11, 0.7),
    0 2px 8px rgba(0, 0, 0, 0.3);
  animation: filterActiveGlow 1.5s ease-in-out infinite;
}

@keyframes filterSpinIn {
  0% {
    transform: translateX(100px) rotate(-360deg);
    opacity: 0;
  }

  100% {
    transform: translateX(0) rotate(0deg);
    opacity: 1;
  }
}

@keyframes filterGlow {

  0%,
  100% {
    box-shadow:
      0 0 8px 2px rgba(139, 92, 246, 0.6),
      0 2px 8px rgba(0, 0, 0, 0.3);
  }

  50% {
    box-shadow:
      0 0 16px 4px rgba(167, 139, 250, 0.8),
      0 0 24px 6px rgba(139, 92, 246, 0.4),
      0 2px 8px rgba(0, 0, 0, 0.3);
  }
}

@keyframes filterActiveGlow {

  0%,
  100% {
    box-shadow:
      0 0 12px 4px rgba(245, 158, 11, 0.7),
      0 2px 8px rgba(0, 0, 0, 0.3);
  }

  50% {
    box-shadow:
      0 0 20px 6px rgba(251, 191, 36, 0.9),
      0 0 30px 8px rgba(245, 158, 11, 0.5),
      0 2px 8px rgba(0, 0, 0, 0.3);
  }
}

/* Tile filtering animations */
.tile.filter-out {
  animation: tileFilterOut 0.4s ease-out forwards;
}

.tile.filter-in {
  animation: tileFilterIn 0.5s ease-out forwards;
}

@keyframes tileFilterOut {
  0% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }

  100% {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
  }
}

@keyframes tileFilterIn {
  0% {
    opacity: 0;
    transform: scale(0.8) translateY(-20px);
  }

  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* =========================== */
/* Genre Filter Radial Menu    */
/* =========================== */

.genre-menu.radial-menu {
  bottom: 200px;
  /* Above the prefix filter menu */
}

.genre-menu .genre-toggle.radial-toggle {
  background: #10b981;
  /* Teal/green color */
  box-shadow:
    0 0 8px 2px rgba(16, 185, 129, 0.6),
    0 2px 8px rgba(0, 0, 0, 0.3);
  opacity: 0;
  animation: genreSpinIn 0.6s ease-out 1.5s forwards, genreGlow 2.5s ease-in-out 2.1s infinite;
}

.genre-menu .genre-toggle.radial-toggle:hover {
  background: #34d399;
}

.genre-menu .genre-toggle.filter-active {
  background: #f59e0b;
  opacity: 1;
  box-shadow:
    0 0 12px 4px rgba(245, 158, 11, 0.7),
    0 2px 8px rgba(0, 0, 0, 0.3);
  animation: filterActiveGlow 1.5s ease-in-out infinite;
}

.genre-menu.open .genre-toggle {
  background: #f59e0b;
  opacity: 1;
}

@keyframes genreSpinIn {
  0% {
    transform: translateX(100px) rotate(-360deg);
    opacity: 0;
  }

  100% {
    transform: translateX(0) rotate(0deg);
    opacity: 1;
  }
}

@keyframes genreGlow {

  0%,
  100% {
    box-shadow:
      0 0 8px 2px rgba(16, 185, 129, 0.6),
      0 2px 8px rgba(0, 0, 0, 0.3);
  }

  50% {
    box-shadow:
      0 0 16px 4px rgba(52, 211, 153, 0.8),
      0 0 24px 6px rgba(16, 185, 129, 0.4),
      0 2px 8px rgba(0, 0, 0, 0.3);
  }
}

.genre-menu .genre-item {
  background: #059669;
  /* Darker teal */
}

.genre-menu .genre-item:hover {
  background: #34d399;
}

/* =========================== */
/* Radial Filter Menu          */
/* =========================== */

.radial-menu {
  position: fixed;
  right: 20px;
  bottom: 140px;
  z-index: 2000;
}

/* Main toggle button */
.radial-toggle {
  width: 50px;
  height: 50px;
  border: none;
  border-radius: 50%;
  background: #8b5cf6;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow:
    0 0 8px 2px rgba(139, 92, 246, 0.6),
    0 2px 8px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, background 0.3s ease;
  position: relative;
  z-index: 10;

  /* Entrance animation */
  animation: filterSpinIn 0.6s ease-out 1.3s forwards, filterGlow 2.5s ease-in-out 1.9s infinite;
  opacity: 0;
}

.radial-toggle:hover {
  background: #a78bfa;
  transform: scale(1.1);
}

/* Toggle stays orange when a filter is active */
.radial-toggle.filter-active {
  background: #f59e0b;
  opacity: 1;
  box-shadow:
    0 0 12px 4px rgba(245, 158, 11, 0.7),
    0 2px 8px rgba(0, 0, 0, 0.3);
  animation: filterActiveGlow 1.5s ease-in-out infinite;
}

/* When open, toggle stays in place but changes color and rotates */
.radial-menu.open .radial-toggle {
  background: #f59e0b;
  transform: rotate(180deg);
  opacity: 1;
  animation: none;
}

/* Container for the filter items - positioned to the left */
.radial-items-container {
  position: absolute;
  right: 60px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 10px;
}

/* Radial items - pop out to the left */
.radial-item {
  width: 46px;
  height: 46px;
  border: none;
  border-radius: 50%;
  background: #6366f1;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  opacity: 0;
  transform: scale(0) translateX(30px);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.3s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  pointer-events: none;
}

.radial-item:hover {
  background: #818cf8;
  transform: scale(1.15) translateX(0) !important;
}

.radial-item.active {
  background: #f59e0b;
  box-shadow: 0 0 12px 4px rgba(245, 158, 11, 0.7);
}

/* Staggered one-by-one pop out to the left */
.radial-menu.open .radial-item:nth-child(1) {
  transform: scale(1) translateX(0);
  opacity: 1;
  pointer-events: auto;
  transition-delay: 0.05s;
}

.radial-menu.open .radial-item:nth-child(2) {
  transform: scale(1) translateX(0);
  opacity: 1;
  pointer-events: auto;
  transition-delay: 0.1s;
}

.radial-menu.open .radial-item:nth-child(3) {
  transform: scale(1) translateX(0);
  opacity: 1;
  pointer-events: auto;
  transition-delay: 0.15s;
}

.radial-menu.open .radial-item:nth-child(4) {
  transform: scale(1) translateX(0);
  opacity: 1;
  pointer-events: auto;
  transition-delay: 0.2s;
}

.radial-menu.open .radial-item:nth-child(5) {
  transform: scale(1) translateX(0);
  opacity: 1;
  pointer-events: auto;
  transition-delay: 0.25s;
}

.radial-menu.open .radial-item:nth-child(6) {
  transform: scale(1) translateX(0);
  opacity: 1;
  pointer-events: auto;
  transition-delay: 0.3s;
}

.radial-menu.open .radial-item:nth-child(7) {
  transform: scale(1) translateX(0);
  opacity: 1;
  pointer-events: auto;
  transition-delay: 0.35s;
}

.radial-menu.open .radial-item:nth-child(8) {
  transform: scale(1) translateX(0);
  opacity: 1;
  pointer-events: auto;
  transition-delay: 0.4s;
}

.radial-menu.open .radial-item:nth-child(9) {
  transform: scale(1) translateX(0);
  opacity: 1;
  pointer-events: auto;
  transition-delay: 0.45s;
}

/* Hover glow effect for open items */
.radial-menu.open .radial-item:hover {
  background: #a5b4fc;
  box-shadow: 0 0 15px 5px rgba(165, 180, 252, 0.6);
}