/* --- Core Configurations & App Viewport Constraints --- */
body {
  overflow: hidden;
}

/* --- Hardware Accelerated Ambient Glow Engine --- */
.neon-glow-cyan {
  box-shadow: 0 0 40px -5px rgba(27, 229, 229, 0.2);
}
.neon-glow-magenta {
  box-shadow: 0 0 40px -5px rgba(244, 34, 153, 0.2);
}
.neon-glow-cyan,
.neon-glow-magenta {
  will-change: box-shadow;
}
.neon-text-glow {
  text-shadow: 0 0 12px rgba(27, 229, 229, 0.4);
}
.active-cyan-border {
  border: 1px solid #1be5e5;
  box-shadow: 0 0 30px -10px rgba(27, 229, 229, 0.15);
}

/* --- App Custom Scrollbars --- */
.custom-scrollbar::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}
.custom-scrollbar::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.01);
}
.custom-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #1be5e5;
}

/* --- Glassmorphism & Overlays --- */
.glass-panel {
  background: rgba(14, 14, 18, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.03);
}

/* --- Modal Card: minimal, high-end contrast treatment against the blurred
   backdrop. A faint cyan→magenta gradient hairline ring plus a soft layered
   shadow (deep drop shadow + a whisper of color glow) gives modals a subtle
   sense of elevation without looking flashy. --- */
.modal-card {
  position: relative;
  background-clip: padding-box;
  box-shadow:
    0 1px 0 0 rgba(255, 255, 255, 0.06) inset,
    0 30px 70px -25px rgba(0, 0, 0, 0.75),
    0 0 90px -35px rgba(27, 229, 229, 0.18),
    0 0 90px -45px rgba(254, 1, 154, 0.14);
}
.modal-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(
    150deg,
    rgba(27, 229, 229, 0.45),
    rgba(255, 255, 255, 0.06) 45%,
    rgba(254, 1, 154, 0.35)
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.55;
}

/* Constrained Overlay to keep Header/Footer visible */
.modal-overlay-blur {
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(5, 5, 7, 0.55);
  overflow-y: auto;
  position: fixed;
  top: 5rem;
  bottom: 7rem;
  left: 0;
  right: 0;
  z-index: 39; /* below header/footer which are z-40 */
}

/* --- Interactive Licensing Tiers --- */
.tier-card-interactive {
  transition: all 0.25s ease;
}
.tier-card-interactive:hover {
  border-color: rgba(27, 229, 229, 0.4) !important;
  box-shadow: 0 0 25px -5px rgba(27, 229, 229, 0.08);
  background-color: rgba(255, 255, 255, 0.02) !important;
  transform: translateY(-2px);
}
.tier-card-interactive.tier-card-selected {
  border-color: #1be5e5 !important;
  background-color: rgba(27, 229, 229, 0.05) !important;
  box-shadow:
    0 0 40px -8px rgba(27, 229, 229, 0.25),
    inset 0 0 20px rgba(27, 229, 229, 0.04);
  z-index: 1;
}
@media (min-width: 1025px) {
  .tier-card-interactive.tier-card-selected {
    transform: scale(1.03) translateY(-2px);
  }
}
.tier-pick-btn.tier-pick-default {
  box-shadow: 0 0 18px -6px rgba(27, 229, 229, 0.25);
}

/* --- Inline Beat Card Tier Pick Buttons --- */
.tier-pick-btn {
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}
.tier-pick-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: #1be5e5;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.tier-pick-btn:hover {
  border-color: rgba(27, 229, 229, 0.7) !important;
  background-color: rgba(27, 229, 229, 0.08) !important;
  box-shadow:
    0 0 20px -4px rgba(27, 229, 229, 0.25),
    inset 0 0 12px rgba(27, 229, 229, 0.05);
  transform: translateY(-1px);
  color: #1be5e5;
}
.tier-pick-btn:hover::before {
  opacity: 1;
}
.tier-pick-btn:active {
  transform: scale(0.96);
}
/* Exclusive tier pick button hover — magenta instead of cyan */
.tier-pick-btn[data-tier-pick="tier3"]:hover {
  border-color: rgba(254, 1, 154, 0.7) !important;
  background-color: rgba(254, 1, 154, 0.08) !important;
  box-shadow:
    0 0 20px -4px rgba(254, 1, 154, 0.25),
    inset 0 0 12px rgba(254, 1, 154, 0.05);
  color: #fe019a;
}
.tier-pick-btn[data-tier-pick="tier3"]::before {
  background: linear-gradient(90deg, #fe019a, #d44aec);
}

/* --- Tier Card Top Color Strip --- */
.tier-card-top-strip {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 0;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.tier-card-top-strip--mp3 {
  background: #1be5e5;
}
.tier-card-top-strip--wav {
  background: linear-gradient(90deg, #00f2fe, #1be5e5 50%, #00f2fe);
}
.tier-card-top-strip--exclusive {
  background: linear-gradient(90deg, #fe019a, #d44aec);
}
.tier-card-interactive.tier-card-selected .tier-card-top-strip {
  opacity: 1;
  box-shadow: 0 0 14px rgba(27, 229, 229, 0.7);
}
.tier-card-interactive.tier-card-selected .tier-card-top-strip--exclusive {
  box-shadow: 0 0 14px rgba(254, 1, 154, 0.6);
}

/* --- Unselected card dimming (only when a sibling is selected) --- */
#mobileLicenseStep:has(.tier-card-selected)
  .tier-card-interactive:not(.tier-card-selected) {
  opacity: 0.45;
  transform: scale(0.985);
}
#mobileLicenseStep:has(.tier-card-selected)
  .tier-card-interactive:not(.tier-card-selected):hover {
  opacity: 0.85;
  transform: translateY(-2px);
}

/* --- Selected card: restore full brightness on all text --- */
#tier1.tier-card-selected h3,
#tier2.tier-card-selected h3 {
  color: #1be5e5 !important;
  text-shadow: 0 0 12px rgba(27, 229, 229, 0.4);
}
#tier3.tier-card-selected h3 {
  color: #fe019a !important;
  text-shadow: 0 0 12px rgba(254, 1, 154, 0.4);
}
.tier-card-interactive.tier-card-selected .tier-accordion-content ul li {
  color: #ffffff;
}
.tier-card-interactive.tier-card-selected .tier-price-display .text-neutral-400,
.tier-card-interactive.tier-card-selected .tier-price-display span {
  color: rgba(255, 255, 255, 0.6);
}
.tier-card-interactive.tier-card-selected .tier-price-display .text-5xl {
  color: #ffffff;
}

#tier3.tier-card-interactive:hover {
  border-color: rgba(254, 1, 154, 0.4) !important;
  box-shadow: 0 0 25px -5px rgba(254, 1, 154, 0.08);
  background-color: rgba(255, 255, 255, 0.02) !important;
}
#tier3.tier-card-interactive.tier-card-selected {
  border-color: #fe019a !important;
  background-color: rgba(254, 1, 154, 0.04) !important;
  box-shadow:
    0 0 40px -8px rgba(254, 1, 154, 0.2),
    inset 0 0 20px rgba(254, 1, 154, 0.03);
}
#tier3.tier-card-interactive.tier-card-selected .tier-card-top-strip {
  box-shadow: 0 0 14px rgba(254, 1, 154, 0.6);
}

/* --- Tier Card "Most Popular" Badge --- */
.tier-card-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 800;
  font-family: inherit;
  padding: 3px 9px;
  border-radius: 20px;
  background: rgba(27, 229, 229, 0.12);
  border: 1px solid rgba(27, 229, 229, 0.3);
  color: #1be5e5;
  pointer-events: none;
}

/* --- Keyframe Sequences (GPU Optimized) --- */
@keyframes tierPickSuccess {
  0%,
  100% {
    transform: scale3d(1, 1, 1);
    background-color: rgba(27, 229, 229, 0.15);
    border-color: #1be5e5;
  }
  50% {
    transform: scale3d(0.93, 0.93, 1);
    background-color: rgba(27, 229, 229, 0.35);
    border-color: #1be5e5;
  }
}
.tier-pick-success {
  will-change: transform;
  animation: tierPickSuccess 0.22s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes beatCardFlash {
  0% {
    border-color: rgba(27, 229, 229, 0.8);
    box-shadow: 0 0 20px -4px rgba(27, 229, 229, 0.4);
  }
  100% {
    border-color: rgba(255, 255, 255, 0.02);
    box-shadow: none;
  }
}
.beat-card-flash {
  will-change: border-color, box-shadow;
  animation: beatCardFlash 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* --- Active Audio Playback Flair Engine --- */
@keyframes audioPulseCyan {
  0% {
    box-shadow:
      0 0 12px 0px rgba(27, 229, 229, 0.3),
      inset 0 0 8px 0px rgba(27, 229, 229, 0.1);
    border-color: rgba(27, 229, 229, 0.6);
  }
  50% {
    box-shadow:
      0 0 24px 4px rgba(27, 229, 229, 0.5),
      inset 0 0 14px 2px rgba(27, 229, 229, 0.2);
    border-color: rgba(27, 229, 229, 1);
  }
  100% {
    box-shadow:
      0 0 12px 0px rgba(27, 229, 229, 0.3),
      inset 0 0 8px 0px rgba(27, 229, 229, 0.1);
    border-color: rgba(27, 229, 229, 0.6);
  }
}

@keyframes equalizerBarBounce {
  0%,
  100% {
    transform: scaleY(0.3);
  }
  50% {
    transform: scaleY(1);
  }
}

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

/* Core Playing State Selector for standard catalog lists */
.is-playing {
  will-change: box-shadow, border-color;
  animation: audioPulseCyan 2s infinite cubic-bezier(0.4, 0, 0.2, 1) !important;
  background-color: rgba(27, 229, 229, 0.1) !important;
  color: #1be5e5 !important;
}

/* Targeted Fix: Valid multi-animation syntax execution for the modal popup */
#productModal .is-playing,
#productModal button.is-playing,
#productModal [role="button"].is-playing {
  will-change: box-shadow, border-color, transform;
  animation:
    audioPulseCyan 2s infinite cubic-bezier(0.4, 0, 0.2, 1),
    modalPlaySpin 4s infinite linear !important;
  border: 1px solid #1be5e5 !important;
  border-radius: 50% !important;
  background-color: rgba(27, 229, 229, 0.15) !important;
  color: #1be5e5 !important;
}

/* Seamless audio indicator lines if matching structural elements are present */
.is-playing .eq-bar {
  display: inline-block;
  width: 2px;
  height: 12px;
  background-color: #1be5e5;
  margin: 0 1px;
  transform-origin: bottom;
  animation: equalizerBarBounce 0.8s infinite ease-in-out;
}
.is-playing .eq-bar:nth-child(2) {
  animation-delay: 0.15s;
}
.is-playing .eq-bar:nth-child(3) {
  animation-delay: 0.3s;
}
.is-playing .eq-bar:nth-child(4) {
  animation-delay: 0.45s;
}

/* --- Hybrid Layout Route Mappings (FIXED FOR HASH ROUTING) --- */
body.is-landing-route #productModal {
  background-color: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  overflow-y: hidden !important;
  padding: 0 !important;
  display: flex !important;
  pointer-events: none !important;
  /* FIX: Explicitly constrain wrapper dimensions and lower layout hierarchy */
  position: fixed !important;
  top: 5rem !important;
  bottom: 7rem !important;
  left: 0;
  right: 0;
  height: calc(100vh - 12rem) !important;
  z-index: 40 !important;
}
body.is-landing-route #productModal > div {
  pointer-events: auto;
  border: none !important;
  border-radius: 0px !important;
  background-color: #050507 !important;
  position: fixed !important;
  top: 5rem !important; /* Anchored perfectly right under header */
  bottom: 7rem !important; /* Anchored perfectly right above audio player */
  left: 0;
  width: 100% !important;
  max-width: 100% !important;
  overflow-y: auto !important;
  padding: 2rem 0 4rem 0 !important;
  box-shadow: none !important;
  height: calc(100vh - 12rem) !important;
  z-index: 41 !important;
}
body.is-landing-route #productModal button[onclick="closeProductHub()"] {
  display: none !important;
}
body.is-landing-route #mobileLicenseStep {
  display: grid !important;
}
#productModal,
#productModal > div {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Cart Item Rows --- */
.cart-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 0.625rem;
}
.cart-item-row:last-child {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.cart-item-name {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #ffffff;
  line-height: 1.2;
}
.cart-item-tier {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin-top: 3px;
}
.cart-item-tier--mp3 {
  color: rgba(27, 229, 229, 0.6);
}
.cart-item-tier--wav {
  color: #1be5e5;
}
.cart-item-tier--exclusive {
  color: #fe019a;
}
.cart-item-price {
  font-size: 0.8125rem;
  font-weight: 800;
  font-family: monospace;
  color: #ffffff;
  white-space: nowrap;
}
.cart-item-remove {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
  font-size: 0.55rem;
  line-height: 1;
}
.cart-item-remove:hover {
  background: rgba(254, 1, 154, 0.12);
  border-color: rgba(254, 1, 154, 0.45);
  color: #fe019a;
}

@media (max-width: 1024px) {
  body {
    overflow-y: auto;
  }
  .modal-overlay-blur {
    background: rgba(5, 5, 7, 0.6);
    align-items: flex-start;
    padding-top: 1rem;
    top: 5rem;
    bottom: 7rem;
  }
  /* Fix mobile behavior for hash routing too */
  body.is-landing-route #productModal,
  body.is-landing-route #productModal > div {
    top: 5rem !important;
    bottom: 7rem !important;
    height: calc(100vh - 12rem) !important;
  }
  .custom-scrollbar::-webkit-scrollbar {
    width: 0;
    height: 0;
  }
}

/* --- Tier Pick Success Animation --- */
@keyframes tierPickSuccessFlash {
  0% {
    transform: scale(1);
    background-color: rgba(27, 229, 229, 0.08);
    border-color: rgba(27, 229, 229, 0.7);
  }
  40% {
    transform: scale(0.92);
    background-color: rgba(27, 229, 229, 0.35);
    border-color: #1be5e5;
    box-shadow: 0 0 20px -2px rgba(27, 229, 229, 0.5);
    color: #1be5e5;
  }
  100% {
    transform: scale(1);
    background-color: rgba(27, 229, 229, 0.12);
    border-color: #1be5e5;
  }
}
@keyframes tierPickSuccessFlashExcl {
  0% {
    transform: scale(1);
    background-color: rgba(254, 1, 154, 0.08);
    border-color: rgba(254, 1, 154, 0.7);
  }
  40% {
    transform: scale(0.92);
    background-color: rgba(254, 1, 154, 0.35);
    border-color: #fe019a;
    box-shadow: 0 0 20px -2px rgba(254, 1, 154, 0.5);
    color: #fe019a;
  }
  100% {
    transform: scale(1);
    background-color: rgba(254, 1, 154, 0.12);
    border-color: #fe019a;
  }
}
.tier-pick-success-flash {
  animation: tierPickSuccessFlash 0.18s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}
.tier-pick-success-flash[data-tier-pick="tier3"] {
  animation: tierPickSuccessFlashExcl 0.18s cubic-bezier(0.25, 1, 0.5, 1)
    forwards;
}

@keyframes tierPickerExit {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(4px) scale(0.97);
  }
}
.tier-picker-exit {
  animation: tierPickerExit 0.28s cubic-bezier(0.4, 0, 1, 1) forwards;
  pointer-events: none;
}

@keyframes tierLabelEnter {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.tier-label-enter {
  animation: tierLabelEnter 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes cartBtnBounce {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(1.22);
    box-shadow: 0 0 16px -2px rgba(27, 229, 229, 0.5);
  }
  65% {
    transform: scale(0.93);
  }
  100% {
    transform: scale(1);
  }
}
.cart-btn-success-bounce {
  animation: cartBtnBounce 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* --- Beat row hover lock during tier pick animation --- */
[data-beat-row-container].beat-row-animating,
[data-beat-row-container].beat-row-animating:hover {
  border-color: rgba(255, 255, 255, 0.02) !important;
  background-color: transparent !important;
  pointer-events: none;
}

/* --- Beat row added state: suppress hover border flicker --- */
[data-beat-row-container].beat-row-is-added:hover {
  border-color: rgba(27, 229, 229, 0.15) !important;
  box-shadow: none !important;
}
[data-beat-row-container].beat-row-animating,
[data-beat-row-container].beat-row-animating:hover {
  border-color: rgba(255, 255, 255, 0.02) !important;
  box-shadow: none !important;
  pointer-events: none;
}
