/* midicreator.css — MIDI Pattern Generator */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: #0a0a0f;
  color: #e0e0e0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  overflow-x: hidden;
}

.header {
  padding: 16px 24px;
  background: linear-gradient(180deg, #141420 0%, transparent 100%);
  border-bottom: 1px solid #222;
  display: flex;
  align-items: center;
  gap: 16px;
}

.header a {
  color: #6af;
  text-decoration: none;
  font-size: 14px;
}

.header a:hover { color: #8cf; }

.header h1 {
  font-size: 20px;
  font-weight: 600;
  color: #fff;
}

.toolbar {
  padding: 12px 24px;
  background: #0e0e16;
  border-bottom: 1px solid #1a1a2a;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.toolbar label {
  font-size: 12px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.toolbar select, .toolbar input[type=number] {
  background: #1a1a2e;
  border: 1px solid #333;
  color: #e0e0e0;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 13px;
}

.toolbar input[type=number] { width: 60px; }

.toolbar button {
  background: #2a2a44;
  border: 1px solid #444;
  color: #e0e0e0;
  padding: 7px 14px;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
}

.toolbar button:hover { background: #3a3a58; }

.toolbar button.primary {
  background: #4a6cf7;
  border-color: #5a7cff;
  color: #fff;
}

.toolbar button.primary:hover { background: #5a7cff; }

.toolbar button.success {
  background: #2a8a4a;
  border-color: #3aaa5a;
  color: #fff;
}

.toolbar button.success:hover { background: #3aaa5a; }

.toolbar .group {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-right: 12px;
  border-right: 1px solid #222;
}

.toolbar .group:last-child { border-right: none; }

.track-tabs {
  display: flex;
  gap: 2px;
  padding: 8px 24px 0;
  background: #0e0e16;
}

.track-tab {
  padding: 8px 16px;
  background: #141420;
  border: 1px solid #222;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  font-size: 12px;
  cursor: pointer;
  color: #888;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.track-tab:hover { color: #ccc; background: #1a1a2e; }

.track-tab.active {
  color: #fff;
  background: #1a1a2e;
  border-color: #4a6cf7;
  border-bottom-color: #1a1a2e;
}

.track-tab .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.editor-area {
  padding: 0 24px 24px;
  background: #0a0a0f;
}

.piano-roll-container {
  background: #12121c;
  border: 1px solid #222;
  border-radius: 0 8px 8px 8px;
  overflow: hidden;
  position: relative;
}

.piano-roll-scroll {
  overflow: auto;
  max-height: 65vh;
  position: relative;
}

.piano-roll {
  display: grid;
  position: relative;
}

.note-grid {
  display: grid;
  position: relative;
}

.note-cell {
  width: 100%;
  height: 100%;
  border-right: 1px solid #1a1a2a;
  border-bottom: 1px solid #1a1a2a;
  cursor: pointer;
  transition: background 0.05s;
  position: relative;
}

.note-cell:hover {
  background: rgba(255, 255, 255, 0.05) !important;
}

.note-cell.active {
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: inset 0 0 8px rgba(255, 255, 255, 0.1);
}

.note-cell.beat-line {
  border-left: 1px solid #2a2a44;
}

.piano-keys {
  position: sticky;
  left: 0;
  z-index: 10;
  background: #0e0e18;
  border-right: 2px solid #333;
}

.piano-key {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 6px;
  font-size: 9px;
  color: #555;
  border-bottom: 1px solid #1a1a2a;
  user-select: none;
}

.piano-key.white-key { background: #1a1a28; }
.piano-key.black-key { background: #101018; color: #444; }
.piano-key.c-note { border-top: 1px solid #333; color: #777; }

.beat-labels {
  display: flex;
  height: 20px;
  background: #0e0e18;
  border-bottom: 1px solid #222;
  font-size: 10px;
  color: #555;
}

.beat-label {
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid #1a1a2a;
  flex-shrink: 0;
}

.beat-label.bar-start {
  border-left: 1px solid #3a3a5a;
  color: #888;
}

.playhead {
  position: absolute;
  top: 0;
  width: 2px;
  height: 100%;
  background: #f44;
  pointer-events: none;
  z-index: 20;
  transition: left 0.05s linear;
  box-shadow: 0 0 6px rgba(255, 68, 68, 0.5);
}

.accompaniment-panel {
  margin-top: 16px;
  background: #12121c;
  border: 1px solid #222;
  border-radius: 8px;
  padding: 16px;
}

.accompaniment-panel h3 {
  font-size: 14px;
  color: #aaa;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.accordion-track {
  background: #0e0e18;
  border: 1px solid #1a1a2a;
  border-radius: 6px;
  margin-bottom: 8px;
  overflow: hidden;
}

.accordion-header {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: background 0.15s;
}

.accordion-header:hover { background: #141420; }

.accordion-header .title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #ccc;
}

.accordion-header .toggle-icon {
  color: #666;
  font-size: 10px;
  transition: transform 0.2s;
}

.accordion-header.open .toggle-icon { transform: rotate(90deg); }

.accordion-body {
  padding: 0 14px;
  display: none;
}

.accordion-header.open + .accordion-body { display: block; }

.accordion-body .mini-grid {
  display: grid;
  gap: 1px;
  padding: 10px 0;
}

.mini-cell {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.08s;
}

.mini-cell:hover { transform: scale(1.1); }

.info-bar {
  padding: 8px 24px;
  background: #0e0e16;
  border-top: 1px solid #1a1a2a;
  font-size: 11px;
  color: #555;
  display: flex;
  justify-content: space-between;
}

.version-overlay {
  position: fixed;
  bottom: 8px;
  right: 12px;
  font-size: 10px;
  color: #333;
  pointer-events: none;
}
