.mad-music-mixer {
  margin: 0 auto !important;
  padding: 20px;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  color: #333;
  display: flex;
  justify-content: center;
  align-items: center;
  background-image: url("../svgs/Desktop.svg");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: bottom;
  padding-bottom: 15rem;
}

@media screen and (max-width: 768px) {
  .mad-music-mixer {
    flex-direction: column;
  }
}

.mixer-wrapper {
  max-width: 400px;
}

/* Genre selector */
.genre-selector {
  margin-bottom: 20px;
}

.genre-selector h3 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 18px;
  color: #222;
}

#content .genre-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style-type: none;
  padding: 0;
  margin: 0;
}

.genre-item button {
  padding: 8px 16px;
  background-color: #e8e8e8;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

.genre-item button:hover {
  background-color: #d8d8d8;
}

.genre-item.active button {
  background-color: #0078d7;
  color: white;
}

/* Tracks container */
.tracks-container {
  display: flex;
  gap: 40px;
  align-items: flex-start;
  justify-content: center;
  height: fit-content;
  padding: 0 24px;
  overflow-x: hidden;
}

.track {
  width: 89px;
  min-width: 89px;
  max-width: 89px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: none;
  box-shadow: none;
  padding: 0;
  border-radius: 0;
  position: relative;
}

.track-error {
  border: 1px solid #e74c3c;
  background-color: #fadbd8;
}

.error-message {
  color: #e74c3c;
  font-size: 12px;
  margin-top: 8px;
}

.track-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.track-name {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
}

/* Loading indicators */
.mixer-loading,
.loading-indicator {
  position: absolute;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: auto;
  height: 100%;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
}

.mixer-content {
  position: relative;
}

.mixer-content
.loading-indicator {
  display: none;
}

.mixer-content
.loading-indicator
span {
  margin: 0;
}

.loading-indicator span {
  display: inline-block;
  margin: 80px;
  position: relative;
}

.loading-spinner {
  border: 4px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  border-top: 4px solid #0078d7;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin-bottom: 15px;
}

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

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

/* Track toggle switch */
.track-toggle {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
}

.track-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 20px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked+.slider {
  background-color: #0078d7;
}

input:checked+.slider:before {
  transform: translateX(20px);
}

/* Advanced controls */
.advanced-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 10rem;
  padding: 15px;
}

.tempo-control,
.pitch-control {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 120px;
}

.tempo-control label,
.pitch-control label {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 5px;
}

.tempo-value,
.pitch-value {
  font-size: 12px;
  margin-top: 5px;
  color: #666;
  text-align: center;
}

.mobile-notice {
  display: none;
}

/* Volume sliders */
.volume-slider,
.tempo-slider,
.pitch-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 5px;
  border-radius: 5px;
  background: #d3d3d3;
  outline: none;
}

.volume-slider::-webkit-slider-thumb,
.tempo-slider::-webkit-slider-thumb,
.pitch-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #0078d7;
  cursor: pointer;
}

.volume-slider::-moz-range-thumb,
.tempo-slider::-moz-range-thumb,
.pitch-slider::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #0078d7;
  cursor: pointer;
}

/* Controls */
.mixer-controls {
  /* display: flex;
  align-items: center;
  gap: 15px;
  padding-top: 10px;
  border-top: 1px solid #eee; */
}

.play-btn,
.stop-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.2s;
}

.play-btn {
  background-color: #44c767;
  color: white;
}

.play-btn:hover {
  background-color: #ddd;
}

.stop-btn {
  background-color: #e74c3c;
  color: white;
}

.stop-btn:hover {
  background-color: #c0392b;
}

.master-volume {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.master-volume label {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}


/* Playing state */
.mad-music-mixer.playing .play-btn {
  background-color: #ddd;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .tracks-container {
    grid-template-columns: 1fr 1fr;
  }

  .advanced-controls {
    flex-direction: column;
    gap: 15px;
  }

  .mixer-controls {
    flex-wrap: wrap;
  }

  .master-volume {
    margin-left: 0;
    width: 100%;
    margin-top: 10px;
  }

  .master-slider {
    width: 100%;
  }
}

/* --- HEADER & SUBHEADING --- */
.mixer-header {
  text-align: left;
  margin-bottom: 24px;
}

.mixer-header h2 {
  position: relative;
  font-family: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
  font-size: 2rem;
  text-transform: uppercase;
  font-weight: bold;
  letter-spacing: 2px;
  white-space: nowrap;
}

.beat-highlight {
  color: #004e4e;
  position: absolute;
  top: -19px;
  left: 42px;
}

.beat-script {
  font-family: "Briston", serif;
  color: #ff5a36;
  font-size: 7.5rem;
  vertical-align: middle;
  text-transform: capitalize;
  font-weight: 500;
  letter-spacing: 0;
}

.mixer-subheading {
  font-size: 1.8rem;
  color: #2d3a3a;
  margin: 10px 0 24px 0;
  max-width: 350px;
}

/* --- GENRE BUTTON BOXES --- */
.genre-btn-box {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  min-height: 28px;
  margin: 0;
  padding: 0;
  background: #fff;
  border: 1px solid #20505a;
  border-radius: 2px;
  color: #20505a;
  font-family: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  cursor: pointer;
}

.genre-btn-box span {
  width: 100%;
  text-align: center;
}

.genre-btn-box.active,
.genre-btn-box:focus,
.genre-btn-box:hover {
  background: #20505a;
  color: #eaf3e0;
  border-color: #20505a;
}

.genre-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px 8px;
  max-width: 540px;
}

/* --- MIXER BUTTONS (PLAY/VOLUME) --- */
.mixer-controls-row {
  display: flex;
  gap: 16px;
  margin: 16px 0 32px 0;
}

.mixer-btn {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  border: none;
  background: #f4f7f7;
  box-shadow: -5px -5px 9px rgba(255, 255, 255, 0.7), 5px 5px 9px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
  padding: 0;
}

.mixer-btn:focus,
.mixer-btn:hover {
  background: #e0eaea;
  /* box-shadow: 0 6px 24px rgba(0,0,0,0.13); */
}

.play-btn .icon-play,
.volume-btn .icon-volume {
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-play::before {
  content: '\25B6';
  /* Unicode play symbol */
  font-size: 2.5rem;
  color: black;
  text-shadow: inset 2px 0px 2px 0px rgba(0, 0, 0, 0.3);
  border-radius: 8px;
}

.icon-volume::before {
  content: '\1F50A';
  /* Unicode speaker symbol */
  font-size: 2.5rem;
  color: #8a9297;
}

.mixer-btn:focus .icon-play::before,
.mixer-btn:hover .icon-play::before,
.mixer-btn:focus .icon-volume::before,
.mixer-btn:hover .icon-volume::before {
  color: black;
  text-shadow: inset 2px 0px 2px 0px rgba(0, 0, 0, 0.3);
  border-radius: 8px;
}

/* Remove old genre/play/stop button styles if needed */
.genre-btn,
.play-btn:not(.mixer-btn),
.stop-btn:not(.mixer-btn) {
  display: none !important;
}

/* --- SLIDERS AREA --- */
.sliders-area {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  min-height: 260px;
  margin-top: 18px;
}

.track {
  background: none;
  box-shadow: none;
  padding: 0;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* .track-header {
  display: none;
} */
.track-controls {
  display: flex;
}

.track-volume {
  writing-mode: bt-lr;
  /* vertical-rl is not well supported, bt-lr works for vertical sliders */
  -webkit-appearance: slider-vertical;
  width: 24px;
  height: 280px;
  background: transparent;
  margin-bottom: 12px;
}

.track-volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ff5a36 0%, #ffb36b 100%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.10);
  border: 3px solid #fff;
  cursor: pointer;
  margin-top: -8px;
}

.track-volume::-ms-thumb,
.track-volume::-moz-range-thumb {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ff5a36 0%, #ffb36b 100%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.10);
  border: 3px solid #fff;
  cursor: pointer;
}

.track-volume::-webkit-slider-runnable-track {
  width: 16px;
  height: 160px;
  background: linear-gradient(180deg, #b41c46 0%, #ffa051 20%, #b19e65 40%, green 60%, #5c7d67 80%, #04586b 100%);
  border-radius: 16px;
}

.track-volume::-moz-range-track {
  width: 16px;
  height: 160px;
  background: linear-gradient(180deg, #b41c46 0%, #ffa051 20%, #b19e65 40%, green 60%, #5c7d67 80%, #04586b 100%);
  border-radius: 16px;
}

.track-volume::-ms-fill-lower {
  background: #004e4e;
}

.track-volume::-ms-fill-upper {
  background: #ff5a36;
}

.track-volume:focus {
  outline: none;
}

.track-name {
  font-family: 'Briston';
  font-size: 2.2rem;
  color: #004e4e;
  margin-top: 12px;
  text-align: center;
  text-transform: capitalize;
}

.track .gradient {
  width: 5px;
  height: 280px;
  margin-right: 60px;
  top: 17px;
  background: linear-gradient(to bottom, #b41c46 0%, #ffa051 66%, #5c7d67 80%, #04586b 100%);
  mask-image: repeating-radial-gradient(circle, black 0px, black 2px, transparent 3px, transparent 14px);
  mask-size: 5px 24px;
  mask-repeat: repeat-y;
  border-radius: 5px;
  position: absolute;
}

.track span:nth-child(1) {
  position: absolute;
  top: 22px;
  margin-right: 90px;
  font-size: 1rem;
  color: #b41c46;
  margin-top: 0;
}

.track span {
  position: absolute;
  top: 22px;
  margin-right: 90px;
  font-size: 1rem;
  color: #04586b;
  font-weight: bold;
  margin-top: 265px;
}

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
  .tracks-container {
    gap: 24px;
  }
}

@media (max-width: 600px) {
  .mixer-header h2 {
    font-size: 1.5rem;
  }

  .beat-script {
    font-size: 6.5rem;
  }
  
  .genre-grid {
    grid-template-columns: repeat(2, 1fr);
    max-width: 85%;
  }

  .tracks-container {
    gap: 12px;
  }

  .sliders-area {
    min-height: 180px;
  }
}

.icon-pause::before {
  content: '\23F8';
  /* Unicode pause symbol */
  font-size: 2.5rem;
  color: #8a9297;
}

.play-btn.playing .icon-play {
  display: none;
}

.play-btn.playing .icon-pause {
  display: flex !important;
}

.play-btn .icon-pause {
  display: none;
}

.custom-slider {
  width: 48px;
  min-width: 48px;
  max-width: 48px;
  height: 300px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.custom-slider-track {
  width: 16px;
  height: 280px;
  background: #c9c9c9;
  box-shadow: inset 2px 0px 2px 0px rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  position: absolute;
  left: 50%;
  top: 20px;
  transform: translateX(-50%);
}

.custom-slider-knob {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(128deg, #c9c9c9 10%, #f4f4f4 90%);
  box-shadow: 2px 4px 5px rgba(0, 0, 0, 0.10);
  border: 2px solid #d4d4d4;
  position: absolute;
  left: 50%;
  transform: translate(-50%, 0);
  cursor: pointer;
  transition: box-shadow 0.2s;
  z-index: 2;
}

.custom-slider-knob:active {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}


@media screen and (max-width: 1485px) {
  .mad-music-mixer {
    gap: 2rem;
  }

  .tracks-container {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    width: 300px;
    align-items: center;
    justify-content: center;
    padding: 0;
    gap: 24px;
  }

  .track {
    width: 100%;
    max-width: 100%;
    min-width: 100%;
    margin-bottom: 2rem;
  }

  .track-controls {
    width: 100%;
    max-width: 100%;
  }

  .custom-slider {
    width: 100%;
    max-width: 100%;
    min-width: 100%;
    height: 40px;
  }

  .custom-slider-track {
    width: 100%;
    max-width: 100%;
    height: 20px;
    /* background: linear-gradient(90deg, #b41c46 0%, #ffa051 20%, #b19e65 40%, green 60%, #5c7d67 80%, #04586b 100%); */
    top: 50%;
    left: 0;
    transform: translateY(-50%);
  }

  .custom-slider-knob {
    top: 50%;
    transform: translateY(-50%);
  }

  .track-header {
    width: 100%;
    max-width: 100%;
    min-width: 100%;
    margin-top: 0;
    margin-bottom: 0;
    position: absolute;
    top: -6rem;
  }

  .track-name {
    font-size: 2.5rem;
  }

  .track .gradient {
    background: linear-gradient(to left, #b41c46 0%, #ffa051 66%, #5c7d67 80%, #04586b 100%);
    mask-size: 25px 5px;
    margin-right: 0;
    position: static;
    width: 100%;
    height: 5px;
    mask-repeat: repeat-x;
  }

  .track span:nth-child(1) {
    margin: 0;
    top: -15px;
    text-align: end;
    right: 0;
  }

  .track span {
    margin: 0;
    top: -15px;
    left: 0;
  }

  .advanced-controls {
    margin-bottom: 25rem;
  }
}

@media screen and (max-width: 768px) {
  .mad-music-mixer {
    background: url("../svgs/Mobile.svg");
    background-repeat: no-repeat;
    background-size: contain;
    background-position: bottom;
    padding-bottom: 12rem;
  }

  .mobile-notice {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #004854;
    text-align: center;
  }

  .advanced-controls {
    margin-bottom: 2rem;
    max-width: 85%;
  }

  .mixer-content
  .loading-indicator {
    position: initial;
    display: block;
  }
  
  .mixer-header {
    letter-spacing: 1px;
    font-size: 1.8rem;
  }
}