html {
  height: 100%;
  background: linear-gradient(180deg, #3a3938 0%, #282727 100%);
  background-attachment: fixed;
}

body {
  box-shadow: inset 0 0 25px 10px rgba(0, 0, 0, 0.4);
  min-height: 100vh;
  margin: 0;
  font-family: Helvetica, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
}

h1 {
  color: #D4CABF;
  font-family: 'Orbitron', sans-serif;
  font-size: 40px;
  margin-bottom: -10px;
}

h2 {
  color: #D4CABF;
  font-family: 'Orbitron', sans-serif;
  font-size: 37px;
  margin-top: 0;
  margin-bottom: 0;
}

h3 {
  color: #D4CABF;
  text-align: center;
}

label {
  color: #ebe1d7;
  font-size: 10px;
}

p {
  color: #ebe1d7;
}

.side-nav a.linkText {
    font-family: Helvetica, sans-serif;
    color: #aaa;
    font-size: 16px;
    /* font-weight: ; */
}

/* ********** FOOTER DISCLAIMER STYLING ********** */
#footer-disclaimer {
    position: relative;
  background-color: rgba(20, 20, 20, 0.7);
    padding: 12px 28px 12px 20px;
  border-radius: 8px;
  max-width: 90%;
  text-align: center;
  left: 50%;
  transform: translateX(-50%);
}

#footer-disclaimer-close {
    position: absolute;
    top: 4px;
    right: 8px;
    border: none;
    background: transparent;
    color: #b7c0d3;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
}

#footer-disclaimer-close:hover {
    color: #EBA85B;
}

#footer-disclaimer p {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.5px;
  font-family: 'Orbitron', sans-serif;
  color: #b7c0d3;
}

#footer-disclaimer a {
    color: #EBA85B;
    text-decoration: none;
}

#version-number {
  position: fixed;
    bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Helvetica', sans-serif;
  font-size: 12px;
  color: #4d4f53;
  cursor: pointer;
  z-index: 998;
}

#version-number:hover {
  color: #EBA85B;
}

#version-number a {
    color: #b7c0d3;
    text-decoration: none;
}

#version-number a:hover {
    color: #b7c0d3;
    text-decoration: underline;
}

#about-modal {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
}

#about-modal.modal-hidden {
    display: none;
}

#about-modal-content {
    position: relative;
    background-color: rgba(20, 20, 20, 0.95);
    border: 1px solid #EBA85B;
    border-radius: 8px;
    padding: 18px 24px 14px;
    min-width: 240px;
    text-align: center;
}

#about-modal-content p {
    margin: 6px 0;
    font-family: 'Orbitron', sans-serif;
    font-size: 12px;
    color: #b7c0d3;
}

#about-modal-content a {
    color: #EBA85B;
    text-decoration: none;
}

#about-modal-content a:hover {
    text-decoration: underline;
}

#about-modal-close {
    position: absolute;
    top: 6px;
    right: 8px;
    border: none;
    background: transparent;
    color: #b7c0d3;
    font-size: 14px;
    cursor: pointer;
}

#about-modal-close:hover {
    color: #EBA85B;
}

#controls a {
    color: #EBA85B;
    text-decoration: none;
}

#controls a:hover {
    text-decoration: underline;
}

@media (max-width: 1200px) {
  #footer-disclaimer {
    position: relative;
    margin: 10px auto 0;
    margin-bottom: 5px;
        margin-left: 8px;
        margin-right: 8px;
    transform: none;
    left: auto;
        max-width: none;
  }
  #version-number {
    position: fixed;
        bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
  }
}

@media (min-width: 1201px) {
    #footer-disclaimer p {
        white-space: nowrap;
    }
}

@media (min-width: 768px) {
  #footer-disclaimer {
    position: fixed;
    bottom: 20px;
    z-index: 999;
  }
}
/* ********** END OF FOOTER DISCLAIMER STYLING ********** */

.guideNote {
  color: #b7c0d3 !important;
}

.nav-note {
    padding: 10px;
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    color: #aaa;
    line-height: 1.5;
    justify-content: space-between;
    /* border-top: 1px solid #333; */
    /* margin-top: 20px; */
}

.side-nav .nav-note a {
    display: inline;
    padding: 0;
    margin: 0;
    border: 0;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    text-align: inherit;
    text-decoration: underline;
}

.side-nav .nav-note a:hover {
    color: inherit;
}

/* ********** HAMBURGER STYLING ******* */
/* Hamburger Button */
.hamburger-menu {
    position: fixed;
    top: 20px;
    right: 15px;
    cursor: pointer;
    z-index: 1001; /* Above everything, except for the slide nav*/
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.bar {
    width: 30px;
    height: 4px;
    background-color: #f4f4f4;
    border-radius: 2px;
    transition: background-color 0.3s ease;
}

.hamburger-menu:hover .bar {
    background-color: #FE5A2D;
    cursor: pointer;
}

/* Slide-out Panel */
.side-nav {
    height: 100%;
    width: 0; /* Hidden by default */
    position: fixed;
    z-index: 1002;
    top: 0;
    right: 0;
    background-color: #262B30;
    overflow-x: hidden;
    transition: 0.2s; /* Smooth slide effect */
    padding-top: 60px;
    box-shadow: -5px 0 15px rgba(0,0,0,0.5);
    color: white;
}

.side-nav a {
    padding: 15px 10px 15px 15px; /* top right bottom left */
    text-decoration: none;
    font-size: 18px;
    color: #aaa;
    display: block;
    font-family: 'Orbitron', sans-serif;
    transition: 0.3s;
    text-align: left;
}

.side-nav a:hover {
    color: #FE5A2D;
}

.side-nav .close-btn {
    position: absolute;
    top: 0px;
    right: 20px;
    font-size: 36px;
}

.side-nav hr {
    border: 0;
    border-top: 1px solid #333;
    margin: 20px;
}

.HambText {
    text-align: center;
    margin-bottom: 10px;
}

/* ********** END OF HAMBURGER STYLING ******* */


/* ********** Start OF ACCORDION STYLING ********** */
.accordion-header {

    background-color: transparent;
    color: #aaa;
    cursor: pointer;
    padding: 15px 25px;
    width: 100%;
    text-align: left;
    border: none;
    outline: none;
    transition: 0.4s;
    font-family: 'Orbitron', sans-serif;
    font-size: 18px;
    border-bottom: 1px solid #333;
}

.accordion-header:hover, .active {
    color: #FE5A2D; /* Highlight color */
}

/* plus/minus icon */
.accordion-header:after {
    content: '\002B'; /* Plus sign */
    float: right;
    margin-left: 5px;
}

.active:after {
    content: "\2212"; /* Minus sign */
}

.accordion-content {
    padding: 0 10px;
    background-color: #222;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out; /* Smooth slide */
}

.accordion-content p {
    font-size: 14px;
    color: #eee;
    line-height: 1.6;
}

/* ********** END OF ACCORDION STYLING ********** */

#main-header {
    display: flex;
    justify-content: space-around;
    align-items: center; 
    max-width: 936px;
    width: 100%;
    margin-bottom: 10px;
    padding: 0 10px;
    box-sizing: border-box;
}

#header-block {  /* The main title */
    text-align: left;
    margin-left: 10px;
}

#header-block, #header-spacer {
    width: 300px;
    flex-shrink: 0;
}

#controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 1280px;
    padding: 10px;
}

.control-box {
    background-color: #353433;
    border: 1px solid #ebebf0;
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2), inset 0 0 10px 1px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    margin: 10px;
}

.control-box h3 {
    margin-top: 0;
    margin-bottom: 12px;
    background-color: #FE5A2D;
}

.privacy-page #controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 320px));
    justify-content: center;
    gap: 20px;
}

.privacy-page .control-box {
    width: 320px;
    min-height: 240px;
    margin: 0;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

@media (max-width: 700px) {
    .privacy-page #controls {
        grid-template-columns: 1fr;
    }

    .privacy-page .control-box {
        width: 100%;
        min-height: auto;
    }

    #version-number {
        position: static;
        transform: none;
        left: auto;
        margin: 10px auto;
        text-align: center;
    }
}

.parameter-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.vertical-sliders {
    display: flex;
    flex-direction: row;
    gap: 10px;
    justify-content: center;
    align-items: flex-end;
}

.vertical-sliders .parameter-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.vertical-sliders input[type="range"] {
    width: 10px;
    height: 90px;
    writing-mode: bt-lr;
    -webkit-appearance: slider-vertical;
    appearance: slider-vertical;
}

/* SLIDER STYLING */
input[type="range"] {
    width: 90px; 
    accent-color: #fc6d41; 
}

/* SLIDER INDICATORS */
.slider-visual {
    position: relative;
    display: inline-block;
}

.slider-tick {
    position: absolute;
    left: -3px;
    width: 4px;
    height: 1px;
    background-color: #e4e4e4;
    pointer-events: none;
}

.slider-tickRight {
    position: absolute;
    left: 13px;
    width: 4px;
    height: 1px;
    background-color: #e4e4e4;
    pointer-events: none;
}

/* POT STYLING */
.pot-container {
    position: relative;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pot-input {
    position: absolute;
    width: 25px;
    height: 25px;
    opacity: 0;
    cursor: pointer;
    margin: 0;
}

.pot-visual {
    position: absolute;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #4a4440, #2a2420);
    border: 2px solid #fc6d41;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.6), 0 2px 5px rgba(0, 0, 0, 0.4);
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pot-parameter-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.pot-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    justify-items: center;
    align-items: start;
}

.pot-parameter-row .tooltip {
    padding: 2px 2px;
    /* border: 1px solid #555; */
    border-radius: 4px;
    /* background-color: rgba(0, 0, 0, 0.3); */
}

.pot-indicator {
    position: absolute;
    width: 1px;
    height: 6px;
    background-color: #fc6d41;
    border-radius: 1px;
    top: 2px;
    transform-origin: center 10.5px;
    transition: transform 0.05s ease-out;
}

.pot-tick {
    position: absolute;
    width: 2px;
    height: 2px;
    background-color: #e4e4e4;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    margin: -1px 0 0 -1px;
}

.octave-label {
    position: absolute;
    top: 50%;
    left: 50%;
    font-size: 7px;
    color: #e9e8e8;
    font-weight: bold;
    white-space: nowrap;
    margin-top: -2px;
    margin-left: -4px;
}

.global-box {
    min-width: 0;
    max-width: px !important;
} 

.lfo-box {
    min-width: 0;
    max-width: px !important;
} 

.vco-box {
    min-width: 0;
    max-width: px !important;
} 

.vcf-box {
    min-width: 0;
    max-width: px !important;
} 

.voice-box {
    min-width: 0;
    max-width: px !important;
} 

/* --- Tooltip Styling --- */
.tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width:max-content;
    background-color: #201c13;
    color: #fff;
    text-align: left;
    border-radius: 6px;
    padding: 5px 5px;
    position: absolute;
    z-index: 10;
    bottom: 100%;
    right: 100%;
    margin-left: 10px;
    opacity: 0;
    transition: opacity 0.3s;
}


.tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    bottom: 0%;
    left: -10%;
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent transparent #201c1300;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* --- End of Tooltip Styling --- */

/* Styling for the MIDI output selection box */
#midi-output-select {
    width: 250px;
    background-color: #380105;
    color: #fa1c27;
    font-family: 'VT323', monospace;
    font-size: 1.2em;
    border: 1px solid #ffffff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2), inset 0 0 10px 1px rgba(0, 0, 0, 0.1);
    padding: 5px;
    border-radius: 5px;
}

/* Centering the MIDI device selection */
#midi-status {
    display: flex;
    flex-direction: column; /* Stack the label and select box vertically */
    align-items: center; /* Center the stacked items horizontally */
    margin-top: 20px;
}

/* Add space below the label within the MIDI status block */
#midi-status label {
    margin-bottom: 8px;
}

#patch-controls {
    display: flex;
    gap: 15px;
    margin-right: 10px;
    flex-shrink: 0;
}

.patch-button-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-left: 40px;
}

.patch-button-left {
    /* display: flex;
    flex-direction: column;
    align-items: center; */
    margin-left: 80px;
}

.patch-button-group label {
    margin-bottom: 8px;
}

/* Style for the buttons themselves */
#init-patch-button, #random-patch-button {
    background-color: #FE5A2D;
    color: #ebe1d7;
    font-family: 'VT323', monospace;
    font-size: 1.2em;
    border: 2px solid #fcfcfc; 
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2), inset 0 0 10px 1px rgba(0, 0, 0, 0.1);
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.1s;
}

#init-patch-button:hover, #random-patch-button:hover {
    background-color: #a63a1c; 
}

/* New style to highlight the active OSC2 PWM control */
.active-control {
    /* Apply underline */
    text-decoration: underline;
    /* You might also want to change the color for emphasis */
    color: #f3f3f3 !important; 
}

.wavs-diagram {
    display: block;      /* Required for margin: auto to work */
    margin-left: auto;
    margin-right: auto;
    width: 100%;        /* Makes the image span the width of the control box */
    height: auto;       /* Maintains aspect ratio */
    margin-bottom: 10px; /* Space between image and the "VCA EG" text */
    border-radius: 4px; /* Optional: matches your box styling */
    opacity: 0.9;       /* Optional: softens the image to match the UI */
}

.side-nav .wavs-diagram {
    width: 70%;
    margin-top: 10px;
    margin-bottom: 10px;
}

/* --- NEW MEDIA QUERY FOR MOBILE VIEW --- */
@media (max-width: 850px) {
    #version-number {
        position: static;
        transform: none;
        left: auto;
        margin: 10px auto;
        text-align: center;
    }

    /* Floating Screen bar */
    #midi-status {
        position: fixed; /* Makes it float relative to the viewport */
        top: 0;
        left: 0;
        width: 100%;
        z-index: 1000; 
        
        /* Compact/Horizontal layout */
        display: flex; 
        flex-direction: row; 
        justify-content: center;
        gap: 20px;
        align-items: center;
        
        /* Appearance */
        background-color: #FE5A2D;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
        padding: 10px 0; 
        margin: 0;
    }

    /* Hide the MIDI device label on mobile to save space on the floating bar */
    #midi-status label {
        display: none;
    }

    body {
        padding-top: 40px;
    }
    
    /* 1. Stack the three main header sections vertically */
    #main-header {
        flex-direction: column;
        /* Remove space-around and use flex-start for a tight stack, 
           then center the content within the header */
        justify-content: flex-start; 
        align-items: center; /* Center the entire header block */
        padding: 10px 0; /* Add some vertical padding */
    }

    /* 2. Ensure each block is full width (or nearly full) and centered */
    #header-block,
    /* #midi-status, */
    #patch-controls {
        width: 90%; /* Take up the full width of the main-header */
        margin: 10px 0; /* Add vertical spacing between stacked elements */
        text-align: center; /* Center text inside the header block */
        
        /* Optional: Center the button groups horizontally within their block */
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    /* 3. Adjust specific inner elements to ensure they stack/center correctly */
    
    /* Center the buttons within the patch-controls group */
    #patch-controls {
        flex-direction: row;
        gap: 15px; /* Remove horizontal gap when stacked */
        justify-content: center; /* <<< THIS IS THE CRITICAL ADDITION */
        width: 100%;
    }
    
    /* Center the individual button groups and add vertical margin */
    .patch-button-group {
        margin: 0; 
        width: auto; /* Allow content to dictate width */
    }
}

/* --- TOGGLE SWITCH STYLING --- */
.toggle-switch-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.toggle-switch-label {
    color: #ebe1d7;
    font-size: 10px;
}

.toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 50px;
    height: 20px;
    background-color: #2a2420;
    border: 2px solid #fc6d41;
    border-radius: 10px;
    cursor: pointer;
}

.toggle-checkbox {
    display: none;
    width: 100%;
    height: 100%;
    cursor: pointer;
    position: absolute;
    margin: 0;
    opacity: 0;
    z-index: 3;
}

.toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background-color: #fc6d41;
    border-radius: 50%;
    transition: left 0.3s ease;
    cursor: pointer;
    z-index: 2;
}

.toggle-checkbox:checked + .toggle-slider {
    left: 32px;
}

.toggle-label {
    position: absolute;
    font-size: 8px;
    font-weight: bold;
    color: #ebe1d7;
    text-align: center;
    user-select: none;
    z-index: 1;
    top: 100%;
    margin-top: 4px;
    width: 40px;
}

.toggle-label.poly {
    right: 50%;
    margin-right: 4px;
    text-align: right;
}

.toggle-label.unison {
    left: 50%;
    margin-left: 4px;
    text-align: left;
}

.toggle-checkbox:checked ~ .toggle-label.poly {
    color: #888;
}

.toggle-checkbox:not(:checked) ~ .toggle-label.unison {
    color: #888;
}

.switch-parameter-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
