/* Audio Editor Modal Styles */
.audio-editor-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 10006;
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: #3683c28a;
  border-radius: 12px;
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #333;
  background: #2a2a2a;
}

.modal-header h2 {
  margin: 0;
  color: white;
  font-size: 18px;
}

.close-btn {
  background: none;
  border: none;
  color: #ccc;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.close-btn:hover {
  background: #444;
  color: white;
}

.modal-body {
  padding: 20px;
  max-height: calc(90vh - 80px);
  overflow-y: auto;
}

/* Waveform container in modal */
.modal-body .waveform-container {
  position: relative;
  background: linear-gradient(to right, #444, #666);
  height: 200px;
  margin-bottom: 16px;
  border-radius: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  cursor: pointer;
  scrollbar-width: thin;
  scrollbar-color: #666 #333;
}

.modal-body .waveform-container::-webkit-scrollbar {
  height: 8px;
}

.modal-body .waveform-container::-webkit-scrollbar-track {
  background: #333;
  border-radius: 4px;
}

.modal-body .waveform-container::-webkit-scrollbar-thumb {
  background: #666;
  border-radius: 4px;
}

.modal-body .waveform-container::-webkit-scrollbar-thumb:hover {
  background: #888;
}

.modal-body #waveform {
  background: none;
  cursor: pointer;
  border-radius: 6px;
  width: 100%;
  height: 100%;
  position: relative;
}

.modal-body #wave-timeline {
  background: none;
  height: 20px;
  margin-top: 4px;
}

/* Controls in modal */
.modal-body .controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.modal-body .controls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.modal-body .playback-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.modal-body .playback-controls button {
  background: #4a4a4a;
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s;
  white-space: nowrap;
}

.modal-body .playback-controls button:hover {
  background: #5a5a5a;
}

.modal-body .playback-controls span {
  color: white;
  font-size: 14px;
  white-space: nowrap;
}

.modal-body .zoom-controls {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.modal-body .zoom-controls button {
  background: #4a4a4a;
  color: white;
  border: none;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: background-color 0.2s;
  white-space: nowrap;
  min-width: 40px;
}

.modal-body .zoom-controls button:hover {
  background: #5a5a5a;
}

.modal-body .region-controls {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}

.modal-body .region-controls button {
  background: #4a4a4a;
  color: white;
  border: none;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: background-color 0.2s;
  white-space: nowrap;
  flex: 0 0 auto;
}

.modal-body .region-controls button:hover {
  background: #5a5a5a;
}

.modal-body .region-controls .save-btn {
  background: #4caf50;
  color: white;
  font-weight: 600;
}

.modal-body .region-controls .save-btn:hover {
  background: #45a049;
}

/* Responsive design */
@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    max-height: 95vh;
  }

  .modal-body .controls-row {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  .modal-body .playback-controls,
  .modal-body .zoom-controls {
    justify-content: center;
  }

  .modal-body .region-controls {
    justify-content: center;
    gap: 6px;
  }

  .modal-body .region-controls button {
    font-size: 11px;
    padding: 5px 8px;
  }
}

@media (max-width: 480px) {
  .modal-content {
    width: 98%;
    max-height: 98vh;
  }

  .modal-body {
    padding: 15px;
  }

  .modal-body .region-controls {
    flex-direction: column;
    align-items: center;
  }

  .modal-body .region-controls button {
    width: 100%;
    max-width: 200px;
  }
}
