:root {
  --rw-unit-1: calc(100vw/24);

  --palette-bg: #1A1D20;
  --palette-1: #E0E0E0;
  --palette-2: #9498a2;
  --palette-3: #838790;
  --palette-4: #6c6f77;
  --palette-5: #5a5d66;
  --palette-active: #FF6332;
  --palette-white: #ffffff;
  --palette-text: #ffffff;

  --border-1: #393f45;
}



.load-modal {
  position: fixed;
  width: 800px;
  height: 800px;
  background-color: color-mix(in srgb, var(--palette-bg), transparent 5%);
  z-index: 100;
display: flex;
align-items: center;
justify-content: center;
padding: 100px;
}

.modal-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
  color: var(--palette-text);
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.2;
}






.color-swap-controls {
  display: flex;
  gap: 20px;
}

.color-swap-circle {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  cursor: pointer;
}

.color-swap-circle:hover {
  outline: 2px solid var(--palette-active);
}

/* Specific palette indicators */
.default-palette {
  background-color: #898989; /* Default palette-3 */
}

.blue-palette {
  background-color: #318790; /* Blue palette-3 */
}


.sofia-sans-font {
  font-family: "Sofia Sans", serif;
  font-optical-sizing: auto;
  font-weight: 800;
  font-style: normal;
}




body {
  box-sizing: border-box;
  font-family: "Sofia Sans", serif;
  font-optical-sizing: auto;
  font-weight: 600;
  font-style: normal;
  text-transform: lowercase;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: var( --palette-bg);
  width: 800px;
    margin: auto;
  padding: 0px;
  height: 800px;
margin-top: 100px;
align-items: flex-start;
 /* background-size: 30px 30px; */
  /* background-image: radial-gradient(circle, var(--palette-1) 1px, rgba(0, 0, 0, 0) 1px); */

    background-position: center;

  }
  
  h1{
    font-family: "Sofia Sans", serif;
    font-optical-sizing: auto;
    font-weight: 650;
    font-style: normal;
    text-transform: lowercase;
    font-size: 2rem;
    color: var(--palette-text);
  }

  h2{
    font-family: "Sofia Sans", serif;
    font-optical-sizing: auto;
    font-weight: 600;
    font-style: normal;
    text-transform: lowercase;
    font-size: 1.2rem;
    color: var(--palette-text);
  }

  #headline-1 {
    position: relative;
    width: 100%;
    text-align: center;
  }

  .headline-elements-wrapper{
    display: flex;
    flex-direction: row;
    width: 100%;
    height: 100%;
    align-items: center;
    border: 1px solid var(--border-1);
    box-sizing: border-box;
    padding: 16px 8px 16px 9px;
    background-color: #1A1D20;
  }

  #audio-input {
margin-top: 20px;
  }

    /* playhead direction buttons */

#column-controls {
  width: 100%;
   display: flex;
   flex-direction: column;
   justify-content: space-between;
   margin-top: -1px;
   margin-bottom: -113px;
   gap: 0px;
   box-sizing: border-box;
 }

 
 .column-control-container {
  box-sizing: border-box;
 display: flex;
   flex-direction: row;
justify-content: space-between;
   text-align: left;
   width: 100%;
   overflow: clip;
   gap: 0px;
   padding: 4px 8px 4px 8px;
 }

 .column-label {
font-size: 0.8rem;
text-align: left;
color: var(--palette-text);
  }
 
 .column-buttons-layout {
   display: flex;
   flex-direction: row;
   gap: 4px;
   align-items: center;
   box-sizing: border-box;
 }


 button {
  background: none; /* Green */
  border: none;
  color: var(--palette-text);
  padding: 2px 4px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
}

button#start {
  color: var(--palette-active);
}
button#pause {
  color: var(--palette-5);
}
button#stop {
  color: var(--palette-4);
}




 #column-1-buttons {
  box-sizing: border-box;
margin-left: 0%;
width: calc(100% + 2px);
border: 1px solid var(--border-1);
transform: translate(-1px, 0px);

 }
 #column-2-buttons {
  width: calc(75% + 2px);
  box-sizing: border-box;
  margin-left: 25%;
  border: 1px solid var(--border-1);
  transform: translate(-1px, -1px);

 }
 #column-3-buttons {
  width: calc(50% + 2px);
  box-sizing: border-box;
margin-left: 50%;
border: 1px solid var(--border-1);
  transform: translate(-1px, -2px);
  
 }
#column-4-buttons {
  width: calc(25% + 1px);
  box-sizing: border-box;
  margin-left: 75%;
  border: 1px solid var(--border-1);
  transform: translate(0px, -3px); 

 }







 .direction-button svg {
  fill: none;
  stroke: var(--palette-2); 
  transition: fill 0.3s ease, stroke 0.3s ease;
  cursor: pointer;
  stroke-width: 1.5;
}
 
   .direction-button.active {
    background-color: none;
   }

   .direction-button.active svg {
    fill: var(--palette-5);
    stroke: var(--palette-1);
  
  }
   
  #grid-container {
    box-sizing: border-box;
    display: flex;
    width: 100%; /* Fixed container width */
    height: 196px; /* Fixed container height */
    border-radius: 12px;
    margin-bottom: 110px;
 gap: 2px;
  }
  
  .grid-column {
    box-sizing: border-box;
    border-radius: 8px;
    display: grid;
    gap: 2px;
    width: 100%; /* Fixed width for primary column */
    height: 196px; /* Fixed height for primary column */
  }

  
  
  .grid-cell {
    background: var(--palette-1);
    border-radius:10px;
    width: 100%;
  }
  
  
  .grid-cell.active {
    background-color: var(--palette-2);
  
  }
  
  .grid-cell.inactive {
    background-color: var(--palette-2);
    transform: scale(1);
    opacity: 0.2;
  border-radius: 100px;
  }


.mode-skip .grid-cell.inactive {
  opacity: 0.2;
  transform: scale(0.5);
  border-radius: 100px;
}
  
  .grid-cell.playing {
    transform: scale(1);
    background-color: var(--palette-active);
  }
  
  .grid-column:nth-child(2) .grid-cell.active {
    margin-top: 0px;
    background-color: var(--palette-3);
  }

  .grid-column:nth-child(2) .grid-cell.playing {
    transform: scale(1);
    background-color: var(--palette-active);
  }
  .grid-column:nth-child(2) .grid-cell.inactive {
    background-color: var(--palette-3);
    transform: scale(1);
    opacity: 0.2;
    border-radius: 100px;
  }
  .mode-skip .grid-column:nth-child(2) .grid-cell.inactive {
    opacity: 0.2;
  transform: scale(0.5);
  border-radius: 0px;
  }



  .grid-column:nth-child(3) .grid-cell.active {
    margin-top: 0px;
    transform: scale(1);
    background-color: var(--palette-4);
  }

  .grid-column:nth-child(3) .grid-cell.playing {
    transform: scale(1);
    background-color: var(--palette-active);
  }

  .grid-column:nth-child(3) .grid-cell.inactive {
    background-color: var(--palette-4);
    transform: scale(1);
    opacity: 0.2;
    border-radius: 100px;
  }
  .mode-skip .grid-column:nth-child(3) .grid-cell.inactive {
    opacity: 0.2;
  transform: scale(0.5);
  border-radius: 0px;
  }



  .grid-column:nth-child(4) .grid-cell.active {
    margin-top: 0px;
    background-color: var(--palette-5);
  }
  .grid-column:nth-child(4) .grid-cell.playing {
    transform: scale(1);
    background-color: var(--palette-active);
  }
  .grid-column:nth-child(4) .grid-cell.inactive {
    background-color: var(--palette-5);
    transform: scale(1);
    opacity: 0.2;
    border-radius: 100px;
  }
  .mode-skip .grid-column:nth-child(4) .grid-cell.inactive {
    opacity: 0.2;
  transform: scale(0.5);
  border-radius: 0px;
  }
  
  #waveform {
    width: 1000px;
  }
  
  
  

  .grid-column:nth-child(2) {
    margin-top: 36px;
  }
  .grid-column:nth-child(3) {
    margin-top: 73px;
  }
  .grid-column:nth-child(4) {
    margin-top: 110px;
  }



  /* ----------------- CONTROLS STYLING ---------------- */


  #play-pause-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    

    color: var(--palette-text);
    width: 100%;
    border: 1px solid var(--border-1);
    padding: 24px 0 24px 0;
  }


.bpm-wrapper{
  display: flex;
  flex-direction: column;
  gap: 2px;
}

  .mode-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }


  #play-pause-controls .play-pause-wrappers {
 width: 25%;
 display: flex;
 justify-content: space-around;
 padding: 0 16px 0 16px;
 align-items: center;
  }

  #play-pause-controls button {
    background: none; /* Remove default button background */
    border: none; /* Remove default button border */
    padding: 0;
    cursor: pointer;
  }
  
  #play-pause-controls button img {
    width: 32px; /* Adjust as needed */
    height: 32px; /* Adjust as needed */
  }
  
  #reset {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-left: 10px;
  }
  
  #reset img {
    width: 32px; /* Match size with other buttons */
    height: 32px;
  }
  

  
  #bpm-input {
    width: 60px;
    padding: 5px;
    border-radius: 8px;
    border: none;
    background-color: var(--border-1);
    color: var(--palette-text);
  }


  #additional-controls {
    display: flex;
    gap: 0px;
    width: 100%;
    height: 100%;
    align-items: center;
    border: 1px solid var(--border-1);
 margin-top: -1px;
    }




.slider-controllers-layout {
  display: flex;
  flex-direction: row;
  gap: 40px;
  width: 50%;
  height: 100%;
  padding: 16px;
  background-color: var(--palette-bg);
}
  

  #adsr-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  #adsr-controls.h2 {
    margin-bottom: 16px;
  }


  #adsr-wrapper {
display: flex;
align-items: flex-start;
justify-content: space-between;
width: 25%;
padding: 16px;

  }



  .control {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .controls-text {
    color: var(--palette-text)

  }


  .recording-controls{
    display: flex;
    flex-direction: column;
    padding: 16px;
    width: 25%;
    gap: 8px;
  }

  #recording-timer-wrapper {
position: relative;
width: 100%;
height: 10px;
background-color: var(--border-1);
margin-top: 10px;
  }

  .start-stop-rec-layout {
    display: flex;
    width: 100%;
    gap: 8px;
  }


  .control-button {
    background-color: var(--palette-active);
    color: var(--palette-white);
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;;
    width: 100%;
  }
  
  .control-button:disabled {
    background-color: var(--border-1);
    cursor: not-allowed;
  }

  #download-btn.control-button:disabled {
    background-color: var(--border-1);
    cursor: not-allowed;
  }



  .control-label {
  
    font-weight: bold;
    font-size: 1rem;
    color: var(--palette-text);
    width: 20px; 
    display: inline-block;
    text-align: left;
  }
  
  
  .slider-container {
    display: flex;
    align-items: center;
    gap: 10px;
    background: none;
    border-radius: 8px;
    padding: 5px 10px;
  }
  
  input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 16px;
    background: var(--border-1);
    border-radius: 1px;
    outline: none;
    margin: 0px;
    width: 90px;
  }
  
  input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--palette-5);
    cursor: pointer;
  }
  
  input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--palette-5);
    cursor: pointer;
  }
  
  #adsr-visual {
    width: 100%;
    height: 100%;
    display: block;
    background: transparent;
  }

  #adsr-container {
    background: var(--border-1);
    border-radius: 4px;
    padding: 0px;
    width: 200px;
    height: 100px;
    position: relative;
    margin-bottom: 8px;
  }




.dynamic-slider {
    position: relative;
    width: 200px;
    height: 40px;
    color: var(--palette-text);
  }

  
    /* General styling for dynamic sliders */
.dynamic-slider-container {
    display: flex;
    align-items: center;
    gap: 10px;
    background: none;
    border-radius: 8px;
    margin-top: 8px;
    color: var(--palette-text);
  }
  
  

/* Hide the native file input */
input[type="file"] {
  display: none;
}

/* Custom label for the file input */
.custom-file-label {
  display: inline-block;
  padding: 6px 16px;
  background-color: var(--border-1);
  color: var(--palette-text);
  font-size: 0.9rem;
  border-radius: 4px;
  cursor: pointer;
  text-align: center;
  font-weight: 500;
  transition: background-color 0.3s ease;
  user-select: none;
  white-space: nowrap;
  width: 23.7%;
}

.custom-file-label:hover {
  background-color: var(--palette-1);
  color: var(--palette-white);
}

.custom-file-label:active {
  background-color: var(--palette-1);
}

.custom-file-text {
  display: inline-block;
  pointer-events: none;
}


.audio-dropdown {
  font-size: 0.9rem;
  margin-left: 10px;
  padding: 4px 8px;
  border-radius: 5px;
  font-family: "Sofia Sans", serif;
  border: none;
  outline: none;
  cursor: pointer;
  font-weight: 500;
  background-color: var(--border-1);
  color: var(--palette-text);
  width: 31.7%;
}

.audio-dropdown:hover {
  border-color: #888;
}

.audio-dropdown:focus {


}



.bg-wrapper {
  position: absolute;
  top: 0px;
  width: 800px;
  height: 800px;
  margin-left: auto;
  margin-right: auto;
  margin-top: 100px;
  z-index: -3;
  background-color: #1A1D20;
}

.vertical-divider {
width: 1px; background-color: var(--border-1); position: absolute; height: 100%;
}

#vertical-1 {
  margin: 0 100% 0 0;
  transform: translate(-1px, 0px);
}
#vertical-2 {
  margin: 0 75% 0 25%;
  transform: translate(-1px, 0px);
}
#vertical-3 {
  margin: 0 50% 0 50%;
  transform: translate(-0.5px, 0px);
}
#vertical-4 {
  margin: 0 25% 0 75%;
  transform: translate(0px, 0px);
}
#vertical-5 {
  margin: 0 0 0 100%;
}






/* NEW SQUARE CONTROLLER STYLING */





/* Controllers Container: Flex Layout */
.controllers-container {
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between; 
  align-items: start;
  gap: 4px; /* Space between items */
  width: 316px;
}

/* General layout for individual controls */
.dynamic-control {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  max-width: 120px;
  box-sizing: border-box;
}

/* Text styling */
.controls-text {
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--palette-text);
  margin-bottom: 16px;
  text-align: center;
}

/* Drag-control container */
.drag-control {
  position: relative;
  width: 120px;
 height: 120px;
  border: 0px solid var(--palette-2);
  border-radius: 8px;
  background-color: var(--border-1);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Draggable handle */
.drag-handle {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 20px;
  height: 20px;
  background-color: var(--palette-2);
  border-radius: 4px;
  cursor: grab;
  transition: background-color 0.2s ease;
  
}

.drag-handle:active {
  cursor: grabbing;
  background-color: var(--palette-active);
}

/* Value label styling */
.value-label {
  margin-top: 8px;
  font-size: 0.9rem;
  color: var(--palette-text);
  font-weight: 500;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .controllers-container {
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    justify-content: center;
  }

  .dynamic-control {
    max-width: 150px; /* Smaller size for mobile */
  }

  .drag-control {
    padding-bottom: 100%; /* Maintain square shape */
  }

  .drag-handle {
    width: 16px;
    height: 16px;
  }

  .controls-text {
    font-size: 1rem;
  }

  .value-label {
    font-size: 0.8rem;
  }
}

