body {
  font-family: Arial, sans-serif;
  margin: 2rem;
  text-align: center;
}

#status {
  margin-bottom: 1rem;
  font-weight: bold;
}

/* Container and panel styles */
.container {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.left-panel,
.right-panel {
  width: 48%;
}

/* Results area */
#results {
  width: 100%;
  max-height: 600px;
  border: 1px solid #ccc;
  padding: 1rem;
  background: #f9f9f9;
  overflow-y: auto;
  overflow-x: hidden;
  line-height: 1.5; /* Default line height for larger screens */
}

/* Chart container */
#chartContainer {
  width: 100%;
  margin-top: 2rem;
}

/* Controls and button group */
.controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.button-group {
  display: flex;
  gap: 1rem;
}

/* Button and input styles */
button,
input {
  margin: 0.5rem;
  padding: 10px 20px;
  font-size: 16px;
  border: none;
  cursor: pointer;
  border-radius: 5px;
}

#startBtn {
  background-color: #28a745;
  color: white;
}

#stopBtn {
  background-color: #dc3545;
  color: white;
}

button:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

/* Canvas and audio spectrum styling */
canvas {
  width: 100%;
  height: 200px;
  margin-top: 1rem;
}

#audio-spectrum-label {
  font-size: 18px;
  margin-top: 15px;
  font-weight: bold;
}

#visualization-container {
  width: 80%;
  margin: 20px auto;
}

#realTimeSpectrum {
  height: 150px;
  background: #111;
}

#waveform {
  height: 100px;
  background: #111;
}

#spectrum-container {
  display: flex;
  overflow-x: auto;
  padding: 10px;
  background: #111;
  scroll-behavior: smooth;
}

.segment {
  text-align: center;
  margin-right: 15px;
  cursor: pointer;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.segment:hover {
  transform: scale(1.05);
}

.active {
  box-shadow: 0 0 10px yellow;
}

.timestamp {
  font-size: 12px;
  color: #aaa;
  margin-top: 5px;
}

input[type="file"] {
  margin: 20px;
  color: white;
}

audio {
  width: 40%;
  margin: 10px auto;
}

/* Responsive adjustments for small screens */
@media (max-width: 768px) {
  body {
    margin: 1rem;
  }

  .container {
    flex-direction: column;
  }

  .left-panel,
  .right-panel {
    width: 100%;
  }

  #results {
    max-height: 200px; /* Reduced height for small screens */
    padding: 0.5rem; /* Reduced padding */
    line-height: 1.3; /* Tighter line spacing */
  }

  #results > * {
    margin-bottom: 0.5rem; /* Reduced space between child elements */
  }

  canvas {
    height: 150px;
  }

  audio {
    width: 100%;
  }

  h1 {
    font-size: 1.5rem;
  }

  .button-group {
    gap: 0.5rem; /* Reduced gap to keep buttons in one row */
  }

  button {
    padding: 8px 16px; /* Smaller padding for buttons */
    font-size: 14px; /* Smaller font size */
  }
}
