.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100%;
    width: 250px;
    background-color: #1a1a1a;
    transition: transform 0.3s ease-in-out;
    box-shadow: 2px 0 15px rgba(138, 43, 226, 0.2);
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.sidebar.collapsed {
    transform: translateX(-250px);
}

.collapse-btn {
    position: absolute;
    right: 10px;
    top: 10px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    color: #fff;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 240px; /* Space for input-setup */
}

.sidebar-content ul {
    list-style: none;
    padding: 0;
}

.sidebar-content li {
    position: relative;
    overflow: hidden;
    width: 100%;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    border-bottom: 2px solid;
    border-image: linear-gradient(to right, #8A2BE2, transparent) 1;
}

.sidebar-content li span {
    display: block;
    width: 100%;
    font-size: 0.8em;
    font-style: italic;
    color: #888;
}

.sidebar-content li p {
    display: block;
    width: 100%;
    margin: 0;
    font-size: 1.2em;
    font-weight: bold;
    color: #8A2BE2;
}

.sidebar-content li::after {
    content: '➔';
    font-size: 1em;
    color: #8A2BE2;
    position: absolute;
    top: 10px;
    right: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-content li:hover::after {
    opacity: 1;
}

.sidebar-content a {
    text-decoration: none;
    color: #8A2BE2; /* Bright purple color for the text */
    position: relative;
    display: block;
    padding: 8px;
    transition: all 0.3s ease;
}

.sidebar-content li:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent,
        rgba(138, 43, 226, 0.4),
        transparent
    );
    transition: 0.5s;
}

.sidebar-content li:hover, .magic-hover:hover {
    color: #bf9fff;
    text-shadow: 0 0 5px rgba(138, 43, 226, 0.5);
}

.sidebar-content li:hover:before, .magic-hover:hover:before {
    left: 100%;
}

.sidebar h1 {
  font-size: 4em;
  text-align: center;
}

.sidebar h2 {
  font-size: 2.5em;
  font-weight: bold;
  text-align: center;
  background: linear-gradient(90deg, #00ff00, #006400);
  -webkit-background-clip: text;
  color: transparent;
  text-shadow: 0 0 10px rgba(0, 255, 0, 0.7);
}

.sidebar h3 {
  font-size: 1.2em;
  color: #888;
  text-align: center;
  font-style: italic;
}

.input-setup {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 15px;
  background: #111;
  border-top: 1px solid #333;
}

.input-setup > div {
  margin-bottom: 15px;
}

.input-setup label {
  display: block;
  color: #8A2BE2;
  font-size: 0.9em;
  margin-bottom: 5px;
  font-weight: bold;
  text-transform: uppercase;
}

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

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}

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

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

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

input:checked + .slider {
  background-color: #8A2BE2;
}

input:checked + .slider:before {
  transform: translateX(18px);
  background-color: #fff;
}

.audio-status {
  color: #666;
  font-size: 0.85em;
}

.audio-status.ready {
  color: #0f0;
}

.test-chord-btn {
  padding: 3px 8px;
  background: #8A2BE2;
  border: none;
  border-radius: 3px;
  color: white;
  font-size: 0.8em;
  cursor: pointer;
  transition: background 0.2s;
}

.test-chord-btn:hover {
  background: #a040ff;
}

.midi-toggle, .layout-toggle {
  display: flex;
  gap: 5px;
  margin-bottom: 8px;
}

.input-mode, .layout-btn {
  flex: 1;
  padding: 5px;
  background: #222;
  border: 1px solid #444;
  color: #888;
  cursor: pointer;
  font-size: 0.8em;
  transition: all 0.2s;
}

.input-mode.active, .layout-btn.active {
  background: #8A2BE2;
  color: white;
  border-color: #8A2BE2;
}

.input-mode:hover, .layout-btn:hover {
  border-color: #8A2BE2;
}

.midi-device-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px;
  background: #222;
  border-radius: 3px;
  font-size: 0.85em;
}

#midi-status {
  color: #888;
  font-style: italic;
}

#midi-status.listening {
  color: #8A2BE2;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.forget-btn {
  background: none;
  border: none;
  color: #f66;
  cursor: pointer;
  font-size: 1.2em;
  padding: 0 5px;
  transition: color 0.2s;
}

.forget-btn:hover {
  color: #ff0000;
}

.keyboard-options {
  padding: 8px;
  background: #1a1a1a;
  border-radius: 3px;
}

.keyboard-map {
  margin-top: 10px;
  padding: 10px 5px;
  background: #0a0a0a;
  border-radius: 4px;
  display: block;
}

.keyboard-visual {
  position: relative;
  height: 50px;
  overflow: hidden;
}

.key-row {
  display: flex;
  justify-content: center;
  width: 100%;
}

.key-row.white-keys {
  gap: 2px;
}

.key-row.black-keys {
  gap: 2px;
  margin-bottom: -10px;
}

.key {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: bold;
  border-radius: 2px;
}

.key.white {
  width: 24px;
  height: 35px;
  background: #f0f0f0;
  color: #000;
  border: 1px solid #999;
}

.key.black {
  width: 16px;
  height: 26px;
  background: #1a1a1a;
  color: #fff;
  border: 1px solid #666;
  font-size: 11px;
  position: relative;
  z-index: 2;
  margin: 0 4px;
}

.key-spacer {
  width: 24px;
}

