/* Spirograph - CRT Aesthetic */

:root {
  --sp-bg: #0c0c10;
  --sp-surface: #141418;
  --sp-text: #c8d8c8;
  --sp-text-dim: #707878;
  --sp-accent: #cc66ff;
  --sp-cyan: #00ffcc;
  --sp-green: #00ff88;
  --sp-border: rgba(255, 255, 255, 0.15);
}

.spirograph-container {
  position: fixed;
  top: 48px;
  left: 0;
  width: 100vw;
  height: calc(100vh - 48px);
  background: var(--sp-bg);
  overflow: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Subtle scanlines - lighter for canvas-heavy page */
.spirograph-container::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.05) 2px,
    rgba(0, 0, 0, 0.05) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

.main-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Left Control Panel */
.control-panel {
  position: fixed;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  padding: 14px 16px;
  background: var(--sp-surface);
  border: 2px solid var(--sp-border);
  border-radius: 4px;
  z-index: 100;
  max-height: 90vh;
  overflow-y: auto;
  gap: 4px;
}

.panel-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 0;
  min-width: 0;
}

.panel-section.presets-section {
  padding-top: 0;
}

.panel-section.actions-section {
  padding-bottom: 0;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.panel-divider {
  height: 2px;
  background: var(--sp-border);
  margin: 2px 0;
}

.section-label {
  color: var(--sp-text-dim);
  font-size: 8px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 3px;
}

/* Control panel scrollbar */
.control-panel::-webkit-scrollbar {
  width: 4px;
}

.control-panel::-webkit-scrollbar-track {
  background: transparent;
}

.control-panel::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
}

.preset-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.preset-btn {
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 2px solid var(--sp-border);
  border-radius: 2px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.1s;
  white-space: nowrap;
}

.preset-btn:hover {
  background: rgba(204, 102, 255, 0.15);
  border-color: rgba(204, 102, 255, 0.3);
  color: #fff;
}

.control-row {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 20px;
}

.control-row label {
  color: var(--sp-text-dim);
  font-size: 9px;
  font-weight: 500;
  min-width: 32px;
}

.control-row input[type="range"] {
  width: 60px;
  height: 3px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  outline: none;
}

.control-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 10px;
  background: var(--sp-accent);
  border-radius: 2px;
  cursor: pointer;
  transition: transform 0.1s;
  box-shadow: 0 0 8px rgba(204, 102, 255, 0.4);
}

.control-row input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.control-row select {
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid var(--sp-border);
  border-radius: 2px;
  color: rgba(255, 255, 255, 0.85);
  padding: 2px 4px;
  font-size: 9px;
  font-weight: 500;
  cursor: pointer;
  min-width: 60px;
}

.control-row select:focus {
  outline: none;
  border-color: rgba(204, 102, 255, 0.5);
}

.control-row .val {
  color: var(--sp-text-dim);
  font-size: 9px;
  font-weight: 500;
  min-width: 24px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.num-input {
  width: 40px;
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid var(--sp-border);
  border-radius: 2px;
  color: rgba(255, 255, 255, 0.85);
  padding: 2px 4px;
  font-size: 9px;
  font-weight: 500;
  text-align: center;
}

.num-input:focus {
  outline: none;
  border-color: rgba(204, 102, 255, 0.5);
}

.arm-controls {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 2px solid var(--sp-border);
}

.action-btn {
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid var(--sp-border);
  border-radius: 2px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.1s;
  white-space: nowrap;
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
}

.action-btn.play {
  background: rgba(0, 255, 136, 0.12);
  border-color: rgba(0, 255, 136, 0.25);
  color: var(--sp-green);
}

.action-btn.play:hover {
  background: rgba(0, 255, 136, 0.2);
  box-shadow: 0 0 10px rgba(0, 255, 136, 0.2);
}

.action-btn.play.playing {
  background: rgba(255, 51, 51, 0.12);
  border-color: rgba(255, 51, 51, 0.25);
  color: #ff5555;
}

.action-btn.share {
  background: rgba(0, 255, 204, 0.12);
  border-color: rgba(0, 255, 204, 0.25);
  color: var(--sp-cyan);
}

.action-btn.share:hover {
  background: rgba(0, 255, 204, 0.2);
  box-shadow: 0 0 10px rgba(0, 255, 204, 0.2);
}

/* Ring Notes Panel */
.ring-notes-panel {
  position: fixed;
  top: 50%;
  right: 20px;
  transform: translateY(-50%);
  background: var(--sp-surface);
  border: 2px solid var(--sp-border);
  border-radius: 4px;
  z-index: 100;
  padding: 12px 14px;
  max-height: 400px;
  overflow-y: auto;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.ring-notes-header {
  color: var(--sp-text-dim);
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--sp-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.ring-count-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ring-count-btn {
  width: 20px;
  height: 20px;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid var(--sp-border);
  border-radius: 2px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}

.ring-count-btn:hover:not(:disabled) {
  background: rgba(204, 102, 255, 0.2);
  border-color: rgba(204, 102, 255, 0.4);
  color: #fff;
}

.ring-count-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.ring-count {
  color: rgba(255, 255, 255, 0.8);
  font-size: 11px;
  font-weight: 600;
  min-width: 18px;
  text-align: center;
}

.ring-notes-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ring-note-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ring-note-item .ring-num {
  color: var(--sp-text-dim);
  font-size: 10px;
  font-weight: 600;
  width: 16px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.ring-note-item select {
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid var(--sp-border);
  border-radius: 2px;
  color: rgba(255, 255, 255, 0.9);
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  min-width: 56px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.ring-note-item select:focus {
  outline: none;
  border-color: rgba(204, 102, 255, 0.5);
}

.ring-note-item select:hover {
  background: rgba(255, 255, 255, 0.1);
}

.toy-top-bar {
  z-index: 200;
}

/* Scrollbar styling */
.ring-notes-panel::-webkit-scrollbar {
  width: 4px;
}

.ring-notes-panel::-webkit-scrollbar-track {
  background: transparent;
}

.ring-notes-panel::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
}
