body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #0c0c0c 0%, #1a1a1a 100%);
    color: #fff;
    min-height: 100vh;
    overflow: hidden;
}

.app-container {
  display: flex;
  height: 100vh;
  width: 100vw;
}

.sidebar {
  width: 300px;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(15px);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  box-shadow: 2px 0 20px rgba(0, 0, 0, 0.5);
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
}

.sidebar-header h2 {
  margin: 0;
  font-size: 1.4em;
  font-weight: 600;
  color: #fff;
}

.control-section {
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.control-section h3 {
  margin: 0 0 15px 0;
  font-size: 1.1em;
  font-weight: 500;
  color: #ccc;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
}

.control-group {
  display: flex;
  gap: 15px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 15px;
}

.control-group:last-child {
  margin-bottom: 0;
}

.sensitivity-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.slider-group {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.slider-group label {
  min-width: 45px;
  font-size: 0.9em;
  color: #ccc;
  font-size: 12px;
  color: #fff;
}

.slider-group input[type="range"] {
  flex: 1;
  position: relative;
  background: #000;
  overflow: hidden;
  width: 100%;
  height: 100%;
}

.slider-group input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  background: #4CAF50;
  border-radius: 50%;
  cursor: pointer;
}

.slider-group span {
  min-width: 30px;
  font-size: 11px;
  color: #ccc;
  text-align: right;
}

.status-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9em;
}

.status-label {
  min-width: 50px;
  color: #999;
  font-size: 0.85em;
}

.status-item span:not(.status-label) {
  color: #fff;
  font-weight: 500;
}

.beat-indicator {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #333;
  border: 2px solid #666;
  transition: all 0.1s ease;
  margin-left: 10px;
}

.beat-indicator.flash {
  background: #ff4444;
  border-color: #ff8888;
  box-shadow: 0 0 20px #ff4444;
  transform: scale(1.2);
}

/* Help Overlay Styles */
.help-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.help-content {
  background: #222;
  border: 2px solid #444;
  border-radius: 10px;
  padding: 30px;
  max-width: 600px;
  color: #fff;
}

.help-content h3 {
  margin-top: 0;
  color: #4CAF50;
  text-align: center;
}

.help-content h4 {
  color: #2196F3;
  margin-bottom: 10px;
}

.help-section {
  margin-bottom: 25px;
}

.help-content kbd {
  background: #333;
  border: 1px solid #555;
  border-radius: 3px;
  padding: 2px 6px;
  font-family: monospace;
  color: #fff;
}

.help-close {
  text-align: center;
  margin-top: 20px;
  color: #888;
  font-style: italic;
}

.visualizer-container {
    flex: 1;
    background-color: #000;
    overflow: hidden;
    position: relative;
    width: 100%;
    height: 100%;
}

#spectrum-visualizer {
    position: absolute;
    display: flex;
    align-items: end;
    height: 100%;
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
    z-index: 1;
}

#spectrum-visualizer div {
    width: 4px;
    margin: 0 1px;
    transition: height 0.1s ease-in-out;
}

/* Frequency-based spectrum bar colors */
#spectrum-visualizer div:nth-child(3n+1) {
    background: linear-gradient(180deg, rgba(255, 80, 80, 0.8), rgba(255, 80, 80, 1));
}

#spectrum-visualizer div:nth-child(3n+2) {
    background: linear-gradient(180deg, rgba(80, 255, 120, 0.8), rgba(80, 255, 120, 1));
}

#spectrum-visualizer div:nth-child(3n+3) {
    background: linear-gradient(180deg, rgba(80, 160, 255, 0.8), rgba(80, 160, 255, 1));
}

#p5-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
}

.frequency-info {
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.freq-ranges {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    margin-top: 8px;
}

.freq-ranges .freq-range {
    flex: 1;
    text-align: center;
}

.freq-band {
    flex: 1;
    text-align: center;
    padding: 10px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    position: relative;
    height: 80px;
    justify-content: space-between;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.color-indicator {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    margin-bottom: 5px;
}

.bass-color {
    background-color: rgb(255, 80, 80);
    box-shadow: 0 0 10px rgba(255, 80, 80, 0.5);
}

.mid-color {
    background-color: rgb(80, 255, 120);
    box-shadow: 0 0 10px rgba(80, 255, 120, 0.5);
}

.high-color {
    background-color: rgb(80, 160, 255);
    box-shadow: 0 0 10px rgba(80, 160, 255, 0.5);
}

.freq-band.bass {
    border-left: 4px solid rgb(255, 80, 80);
}

.freq-band.mid {
    border-left: 4px solid rgb(80, 255, 120);
}

.freq-band.high {
    border-left: 4px solid rgb(80, 160, 255);
}

.freq-band .label {
    display: block;
    font-weight: bold;
    font-size: 18px;
    margin-bottom: 5px;
}

.freq-band .range {
    display: block;
    font-size: 12px;
    opacity: 0.7;
    margin-bottom: 10px;
}

.freq-fill {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 0%;
    border-radius: 4px 4px 0 0;
    transition: height 0.1s ease-out;
}

.bass-fill {
    background: linear-gradient(180deg, #ff3c28, #ff6040);
    box-shadow: 0 0 15px rgba(255, 60, 40, 0.5);
}

.mid-fill {
    background: linear-gradient(180deg, #28ff50, #40ff68);
    box-shadow: 0 0 15px rgba(40, 255, 80, 0.5);
}

.high-fill {
    background: linear-gradient(180deg, #2878ff, #4088ff);
    box-shadow: 0 0 15px rgba(40, 120, 255, 0.5);
}

.freq-label {
    font-size: 10px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 3px;
}

.freq-range {
    font-size: 8px;
    color: #888;
    margin-top: 3px;
}

button {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 25px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
  min-width: 80px;
  margin: 10px 0 5px 0;
}

#fullscreen {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  box-shadow: 0 2px 8px rgba(245, 87, 108, 0.4);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

button:active {
    transform: translateY(0);
}

select {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 10px 15px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  min-width: 160px;
  margin: 5px 0;
  transition: all 0.3s ease;
}

select:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.3);
}

label {
  color: white;
  font-size: 12px;
  font-weight: 500;
}

select option {
    background: #1a1a1a;
    color: #fff;
}

input[type="file"] {
  color: #ccc;
  font-size: 12px;
  max-width: 100%;
}

input[type="file"]::file-selector-button {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  margin-right: 10px;
}

.custom-media-status {
  font-size: 0.85em;
  color: #999;
}

canvas {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}
