/* style.css */
:root {
  --bg-color: #121212;
  --panel-bg: #1e1e1e;
  --text-main: #e0e0e0;
  --accent: #00d4ff;
  --track-height: 100px;
  /* Increased height */
  --step-width: 80px;
  /* Much wider for swipe */
  --step-gap: 8px;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: 'Courier New', Courier, monospace;
  overflow: hidden;
  user-select: none;
  touch-action: none;
  /* Prevent scroll on drag areas */
}

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

header {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 15px;
  background-color: var(--panel-bg);
  border-bottom: 1px solid #333;
}

.header-left h1 {
  font-size: 16px;
  margin: 0;
  letter-spacing: 1px;
}

.header-left #status {
  font-size: 10px;
  color: #666;
}

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

.bpm-ctrl input {
  width: 50px;
  background: #333;
  border: 1px solid #555;
  color: white;
  padding: 5px;
  text-align: center;
  font-size: 16px;
}

.bpm-ctrl label {
  font-size: 12px;
  color: #aaa;
}

#sequencer-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: auto;
  /* Allow horizontal scroll */
  padding: 20px 0;
}

.track {
  display: flex;
  height: var(--track-height);
  margin-bottom: 15px;
  background-color: #1a1a1a;
  padding-right: 20px;
}

.track-controls {
  width: 80px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: #222;
  border-right: 1px solid #333;
  z-index: 10;
  position: sticky;
  left: 0;
}

.rec-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #333;
  border: 2px solid #555;
  color: #f00;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rec-btn.recording {
  background: #f00;
  color: white;
  animation: pulse 1s infinite;
}

.steps-container {
  display: flex;
  align-items: center;
  padding: 0 10px;
  margin-left: 10px;
}

/* Steps */
.step {
  width: var(--step-width);
  height: 70px;
  background-color: #2a2a2a;
  margin-right: var(--step-gap);
  border-radius: 4px;
  position: relative;
  flex-shrink: 0;
  overflow: hidden;
  /* Contains the inner sliding part */
  border: 1px solid #333;
  cursor: grab;
}

/* The visible block inside/ontop of the step slot */
.step-inner {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background-color: #444;
  /* Inactive color */
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
  /* Transform will be applied for offset */
}

.step.active .step-inner {
  background-color: var(--active-color);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.step-inner::after {
  /* Center line marker */
  content: '';
  position: absolute;
  height: 50%;
  width: 2px;
  background: rgba(0, 0, 0, 0.2);
  top: 25%;
  left: 50%;
  transform: translateX(-50%);
}

.step-offset-val {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.8);
  pointer-events: none;
  font-weight: bold;
}

.step.current {
  border: 2px solid white;
}

/* Overlay */
#overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  flex-direction: column;
  color: white;
  text-align: center;
}

#play-btn-large {
  font-size: 24px;
  padding: 20px 40px;
  margin-top: 20px;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }

  100% {
    transform: scale(1);
  }
}