* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f4f4f4;
  padding: 20px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  background-color: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

h1 {
  text-align: center;
  margin-bottom: 20px;
  color: #2c3e50;
}

.settings-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
  margin-bottom: 30px;
  padding: 15px;
  background-color: #f9f9f9;
  border-radius: 5px;
}

.setting-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 10px;
}

label {
  font-weight: bold;
  margin-bottom: 5px;
  color: #2c3e50;
}

select, input[type="range"], input[type="number"] {
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  width: 100%;
}

input[type="number"] {
  width: 80px;
}

input[type="range"] {
  margin-bottom: 5px;
}

#tempo-value {
  font-size: 14px;
  color: #666;
}

.transport-controls, .pattern-controls {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 20px;
}

button {
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.3s;
}

#play-button {
  background-color: #27ae60;
  color: white;
}

#stop-button {
  background-color: #e74c3c;
  color: white;
}

#clear-button {
  background-color: #3498db;
  color: white;
}

#shift-left-button, #shift-right-button {
  background-color: #9b59b6;
  color: white;
}

button:hover {
  opacity: 0.9;
}

.sequencer-grid {
  display: grid;
  gap: 5px;
  margin-top: 20px;
  overflow-x: auto;
}

.row {
  display: grid;
  gap: 5px;
  margin-bottom: 5px;
}

.row-label {
  display: flex;
  flex-direction: column;
  background-color: #34495e;
  color: white;
  border-radius: 4px;
  font-weight: bold;
  position: relative;
  width: 220px;
}

.main-row-content {
  display: flex;
  align-items: center;
  padding: 8px;
  gap: 8px;
}

.row-name-container {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.essential-controls {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.expanded-content {
  padding: 6px 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background-color: rgba(0, 0, 0, 0.1);
}

.additional-controls {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}

.expanded-controls {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}

.random-vel-btn {
  background-color: #8e44ad !important;
  opacity: 0.8;
}

.random-vel-btn:hover {
  opacity: 1;
}

.expand-btn {
  background-color: rgba(255, 255, 255, 0.1) !important;
  font-size: 8px !important;
  transition: transform 0.2s ease;
}

.expand-btn.expanded {
  transform: rotate(180deg);
}

.row-label.expanded {
  margin-bottom: 4px;
}

.row-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
  font-size: 12px;
}

.note-container {
  display: flex;
  align-items: center;
  gap: 1px;
  flex-shrink: 0;
}

.note-input {
  width: 40px !important; /* Force very narrow width */
  max-width: 40px !important;
  height: 18px;
  padding: 1px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 10px;
  text-align: center;
  box-sizing: border-box !important;
  min-width: unset !important;
  -webkit-appearance: textfield !important;
  -moz-appearance: textfield !important;
  appearance: textfield !important;
}

.note-controls {
  display: flex;
  flex-direction: column;
  gap: 0;
  height: 18px;
}

.note-btn {
  width: 10px; /* Make buttons even smaller */
  height: 8px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background-color: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
  font-size: 6px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.1s ease;
  user-select: none;
}

.note-btn:hover {
  background-color: rgba(255, 255, 255, 0.2);
  color: white;
}

.note-btn:active {
  background-color: rgba(255, 255, 255, 0.25);
  transform: scale(0.95);
}

.note-up {
  border-radius: 2px 2px 0 0;
}

.note-down {
  border-radius: 0 0 2px 2px;
}

.note-input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.4);
  background-color: rgba(255, 255, 255, 0.15);
}

/* Override any browser defaults */
.note-input::-webkit-outer-spin-button,
.note-input::-webkit-inner-spin-button {
  -webkit-appearance: none !important;
  margin: 0 !important;
  display: none !important;
}

.note-input[type=number] {
  -moz-appearance: textfield;
}

.row-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.main-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.row-control-btn {
  width: 24px;
  height: 24px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 10px;
  font-weight: bold;
  color: white;
  user-select: none;
  transition: all 0.2s ease;
}

.mute-btn {
  background-color: rgba(231, 76, 60, 0.4);
  opacity: 0.7;
}

.solo-btn {
  background-color: rgba(243, 156, 18, 0.4);
  opacity: 0.7;
}

.random-btn {
  background-color: #9b59b6;
}

.clear-btn {
  background-color: #3498db;
}

.mute-btn.active {
  background-color: #e74c3c;
  opacity: 1;
  box-shadow: 0 0 5px rgba(231, 76, 60, 0.7);
}

.solo-btn.active {
  background-color: #f39c12;
  opacity: 1;
  box-shadow: 0 0 5px rgba(243, 156, 18, 0.7);
}

.row-control-btn:hover {
  filter: brightness(1.1);
}

.row-control-btn:active {
  transform: scale(0.95);
}

.step {
  position: relative;
  height: 40px;
  background-color: #ecf0f1;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
  min-width: 25px; /* Slightly smaller steps */
  overflow: hidden;
}

.step.active {
  /* Background color will be set dynamically via JavaScript */
}

.step.current {
  border: 2px solid #e74c3c;
}

.velocity-indicator {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: rgba(255, 255, 255, 0.3);
  pointer-events: none;
}

.step:hover {
  opacity: 0.9;
}

.step.active:hover {
  cursor: ns-resize;
}

.version-info {
  text-align: center;
  margin-top: 20px;
  color: #666;
  font-size: 12px;
}

.scale-vel-btn {
  background-color: #2980b9 !important;
  opacity: 0.8;
  font-size: 14px !important;
}

.scale-vel-btn:hover {
  opacity: 1;
}

.scale-up-btn {
  background-color: #27ae60 !important;
}

.scale-down-btn {
  background-color: #c0392b !important;
}

.velocity-btn {
  background-color: #8e44ad !important;
  opacity: 0.8;
  cursor: pointer;
}

.velocity-btn:hover {
  opacity: 1;
}

.velocity-btn.dragging {
  cursor: ns-resize;
  background-color: #9b59b6 !important;
  transform: scale(1.1);
}

#help-button {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: #34495e;
  color: white;
  border: none;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  margin-left: auto;
}

#help-button:hover {
  background-color: #2c3e50;
  transform: scale(1.1);
}

.help-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.help-content {
  background-color: white;
  padding: 30px;
  border-radius: 8px;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  margin: 20px;
}

.help-content h2 {
  margin-top: 0;
  color: #2c3e50;
  font-size: 24px;
  margin-bottom: 20px;
}

.help-content h3 {
  color: #34495e;
  font-size: 18px;
  margin: 20px 0 10px;
}

.help-content ul {
  padding-left: 20px;
  margin: 10px 0;
}

.help-content li {
  margin: 8px 0;
  line-height: 1.4;
}

.help-content ul ul {
  margin: 5px 0;
}

.close-help {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: #e74c3c;
  color: white;
  border: none;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.close-help:hover {
  background-color: #c0392b;
  transform: scale(1.1);
}

/* Custom scrollbar for help content */
.help-content::-webkit-scrollbar {
  width: 8px;
}

.help-content::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.help-content::-webkit-scrollbar-thumb {
  background: #bdc3c7;
  border-radius: 4px;
}

.help-content::-webkit-scrollbar-thumb:hover {
  background: #95a5a6;
}

@media (max-width: 768px) {
  .settings-panel {
    grid-template-columns: 1fr;
  }
  
  .row {
    grid-template-columns: 190px repeat(16, 1fr);
  }
  
  .step {
    height: 30px;
  }
} 