@import url("https://fonts.cdnfonts.com/css/starcruiser");

:root {
  --max-width: 90%;
  --text-color: #fff;
  --accent-color: #f0f;
  --hover-color: #0f0;
  --bg-color: #000;
  --button-color: #888484;
  --button-border-color: #505050;
  --slider-bg: #444;
  --slider-active: #666;
  --speed-slider-height: 150px;
  --speed-slider-width: 150px;
  --mixer-min-width: 100px;
  --deck-min-width: 100px;
  --timestamp-text-color: #00eeff;
}

body {
  background-color: var(--bg-color);
  background-image: url(https://pub-4334c60a11ca4d1a88f2b0c12d405630.r2.dev/purplestars.gif);
  margin: 0;
  padding: 0;
}

a img {
  border: 0;
}
.crate {
  padding: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  align-items: center;
}
.crate > * {
  flex: 0 1 auto;
  max-width: 100%;
}
.crate img {
  display: block;
  margin: 0 auto;
}
.crate-title {
  color: var(--timestamp-text-color);
  font-weight: bold;
  text-transform: uppercase;
  text-align: center;
  width: 100%;
}
.selector {
  margin-top: 1rem;
}

.selector-title {
  color: var(--timestamp-text-color);
  font-weight: bold;
  text-transform: uppercase;
  text-align: center;
  width: 100%;
}

.selector input {
  width: 350px;
  font-size: 1.25rem;
  padding: 0.5rem;
}
#crossfader {
  margin-top: 0; /* Reset the top margin */
  height: 30px; /* Make slider taller for better grip */
}

input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  background: transparent;
}

input[type="range"]::-webkit-slider-runnable-track {
  width: 100%;
  height: 16px;
  background: var(--slider-bg);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 32px;
  width: 32px;
  background: var(--text-color);
  border: 3px solid var(--slider-bg);
  margin-top: -8px;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb::after {
  content: attr(data-display-value);
  position: absolute;
  background: var(--bg-color);
  font-size: 10px;
  padding: 2px;
}

input[type="range"]::-moz-range-track {
  width: 100%;
  height: 16px;
  background: var(--slider-bg);
  border: none;
}

input[type="range"]::-moz-range-thumb {
  height: 32px;
  width: 32px;
  background: var(--text-color);
  border: 3px solid var(--slider-bg);
  cursor: pointer;
}

header h1 {
  color: var(--timestamp-text-color);
  font-size: 7rem;
  margin: 0;
  text-align: center;
  font-family: "Starcruiser Semi-Italic", sans-serif;
}

.main-container {
  background: linear-gradient(to top, #7f001b, rgb(81, 45, 240));
  /* max-width: var(--max-width); */
  /* margin: 5rem auto; */
  padding: 1rem;
}

.slider-container {
  width: 100%;
  max-width: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.player-container {
  width: 50%;
}

.play-button-container {
  align-items: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .5rem;
  padding: 1rem;
}

.play-button {
  min-width: 5rem;
  min-height: 5rem;
  background: var(--button-color);
  border: 3px solid var(--bg-color);
  padding: 0.5rem;
  font-size: 0.875rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
}

.play-button:active {
  transform: scale(0.85);
}

.videos {
  display: flex;
  justify-content: center;
}

.videos .speed-control {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.dj-console {
  display: flex;
  flex-direction: row;
  align-items: center;
  background-image: url(https://pub-4334c60a11ca4d1a88f2b0c12d405630.r2.dev/metalBg.png);
  background-repeat: repeat;
  background-size: cover;
  padding: 0.5rem;
}

.crates-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 75rem;
}

.search-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.mixer {
  flex: 6;
  min-width: var(--mixer-min-width);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between; /* Change to space-between from center */
  height: 300px; /* Add fixed height to ensure consistent spacing */
}

/* Add specific styling for SVG containers */
.mixer svg {
  margin: 10px 0; /* Add vertical margin */
}

.controls-footer {
  width: 95%;
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
}

.deck-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.deck,
.mixer {
  width: 100%;
  min-width: 0;
  max-width: 800px; /* Added max-width for better scaling */
}

.speed-control {
  display: flex;
  flex-direction: column; /* Changed from row to column for vertical layout */
  align-items: center; /* Center items horizontally */
  max-width: var(--speed-slider-width);
}

.speed-slider {
  transform: rotate(270deg);
  height: var(--speed-slider-height); /* Use height for vertical slider */
  width: 15px; /* Narrow width for vertical orientation */
  writing-mode: bt-lr; /* Standard syntax */
}

.speed-label {
  color: var(--text-color);
  font-size: 1rem;

  text-align: center;
}

.speed-value {
  color: var(--text-color);
  font-size: 1rem;
  font-family: monospace;
  text-align: center;
  /* margin-bottom: 1rem; */
}

.nudge-controls {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  align-items: center;
  padding: 0.5rem 1rem;
}

.nudge-button {
  min-width: 2rem;
  min-height: 2rem;
  background: var(--button-color);
  border: 2px solid var(--bg-color);
  padding: 0.5rem;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nudge-button:active,
.nudge-button.nudge-active {
  transform: scale(0.85);
  background-color: var(--accent-color);
  color: var(--bg-color);
}

.current-time {
  color: #00eeff;
  font-family: monospace;
  font-size: 1.5rem;
  font-weight: bold;
  text-align: center;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 4px;
  margin-bottom: 0.75rem;
  width: 100%;
  box-sizing: border-box;
  text-shadow: 0 0 5px rgba(0, 238, 255, 0.7);
}

/* Add hover effect for better UI feedback */
.current-time:hover {
  background: rgba(0, 0, 0, 0.8);
}

.timestamp-controls {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  padding: 0.5rem 1rem;
}

.timestamp-controls + .timestamp-controls {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--accent-color);
}

.timestamp-button {
  min-width: 5rem;
  min-height: 1.5rem;
  background: var(--button-color);
  border: 3px solid var(--bg-color);
  padding: 0.5rem;
  font-size: 0.875rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
}

.timestamp-button:active {
  transform: scale(0.85);
}

.timestamp-display {
  color: var(--timestamp-text-color);
  font-family: monospace;
  font-size: 1.25rem;
  min-width: 15rem;
  text-align: center;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.567);
  gap: 0.5rem;
  align-items: center;
  white-space: nowrap;
}

.timestamp-display span[data-type] {
  font-family: monospace;
  min-width: 7ch; /* Accommodate MM:SS.XX format */
  display: inline-block;
  text-align: center;
  padding: 2px 4px;
  cursor: ns-resize; /* Show up/down cursor to indicate adjustability */
  transition: background-color 0.2s ease;
}

.trigger-button {
  background: var(--button-color);
  border: 3px solid var(--bg-color);
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  cursor: pointer;
  user-select: none;
  text-transform: uppercase;
  min-width: 5rem;
  min-height: 1.5rem;
}

.trigger-button:active {
  transform: scale(0.85);
}

.trigger-button.playing {
  background-color: #4caf50;
  color: white;
  border-color: #4caf50;
}

.clear-button {
  min-width: 3rem;
  min-height: 1.5rem;
  background: var(--bg-color);
  color: var(--text-color);
  border: 2px solid #ff4444;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  text-transform: uppercase;
}

.clear-button:hover {
  background: #ff4444;
  color: var(--bg-color);
}

.clear-button:active {
  transform: scale(0.85);
}

/* Remove all other media queries and keep only one at 600px */
@media (max-width: 600px) {
  header h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
  }

  .deck-controls {
    gap: 0;
    flex-direction: row;
    align-items: center;
    background-image: url(https://pub-4334c60a11ca4d1a88f2b0c12d405630.r2.dev/metalBg.png);
    background-repeat: repeat;
    background-size: cover;
  }

  .crates-container {
    gap: 2rem;
    flex-direction: column;
  }

  .player-container {
    width: 90%;
  }

  #crossfader {
    width: 100%;
    max-width: 400px;
  }

  .dj-console {
    flex-direction: column;
    padding: none;
    gap: .5rem;
    background-image: none;
  }

  .mixer {
    height: 100px;
    flex: unset;
    padding: 0%;
    flex-direction: row;
    justify-content: center;
    gap: 2rem;
    /* background-image: url("images/m12.png");
    background-position: center center; */
    /* background-repeat: repeat; */
    /* background-size: cover; */
    background-image: url(https://pub-4334c60a11ca4d1a88f2b0c12d405630.r2.dev/metalBg.png);
  }

  .mixer svg {
    width: 20%;
    height: auto;
  }

  .slider-container {
    width: 50%;
  }

  .selector input {
    width: 100%;
    max-width: 300px;
  }

  .speed-slider {
    transform: rotate(270deg);
  }

  .timestamp-button,
  .trigger-button,
  .clear-button {
    min-width: auto;
    padding: 0.5rem;
    font-size: 0.75rem;
  }

  .current-time {
    font-size: 1rem;
    padding: 0.375rem;
    width: fit-content;
    margin: 0;
  }

  .timestamp-display {
    font-size: 0.875rem;
    min-width: auto;
    width: 100%;
    order: -1;
    margin-bottom: 0.5rem;
  }

  .timestamp-controls {
    padding: 0 0.75rem 0 0;
    gap: 0.25rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  .nudge-controls {
    gap: 0.5rem;
  }

  /* Make YouTube player responsive */
  .player-container iframe {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16/9;
  }
}
