:root {
  --primary-color: #a855f7;
  --primary-hover-color: #9333ea;
  --background-color: #000000;
  --text-color: #d8b4fe;
  --error-color: #dc2626;
}


#waveform {
height: 50px;
}

#playback-time {
width: 100%;
color: yellow;
font-size: 30px;
text-align: center;
}

#play-pause-button,
#trim-button {
width: 100px;
text-align: center;
}

.audio-trimmer {
  width: 90%;
  max-width: 800px;
  background-color: #111;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0px 20px rgb(183, 0, 250, 0.4);
}

.audio-trimmer-content {
  padding: 20px;
}

.error-message {
  background-color: var(--error-color);
  color: white;
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 20px;
}

.upload-area {
  border: 2px dashed #444;
  border-radius: 8px;
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.upload-area:hover, .upload-area.dragging {
  border-color: var(--primary-color);
  background-color: rgba(168, 85, 247, 0.1);
}

.upload-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 10px;
  color: var(--primary-color);
}

.upload-text {
  font-size: 14px;
}

.control-buttons {
  display: flex;
  justify-content: center;
  flex-wrap: nowrap;
  margin-top: 20px;
  gap: 8px;
  width: 100%;
  min-width: 0;
  overflow-x: auto;
}

.control-button {
  background-color: transparent;
  border: none;
  color: var(--primary-color);
  cursor: pointer;
  padding: 10px;
  margin: 0 5px;
  border-radius: 50%;
  transition: background-color 0.3s ease;
}

.control-button:hover {
  background-color: rgba(168, 85, 247, 0.1);
}

.control-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.waveform-container {
  position: relative;
  margin-top: 20px;
  touch-action: none;
}

.trim-handle {
  position: absolute;
  top: 0;
  width: 10px;
  height: 100%;
  background-color: white;
  cursor: ew-resize;
  touch-action: none;
}

.trim-start-handle {
  left: 0;
}

.trim-end-handle {
  right: 0;
}

.trim-region {
  position: absolute;
  top: 0;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

.waveform-canvas {
  width: 100%;
  height: 100px;
  background-color: #222;
}

.trim-marker {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  color: #ffd700;
}

.slider-container {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
}

.slider {
  width: 48%;
}

.trim-info {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-top: 10px;
}

.playback-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
}

.playback-button, .trim-button {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 3px 6px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  font-size: 11px;
  transition: background-color 0.3s ease;
  min-width: 35px;
  margin: 0 3px;
}

.playback-button:hover, .trim-button:hover {
  background-color: var(--primary-hover-color);
}

.playback-button svg, .trim-button svg {
  margin-right: 5px;
}

.playback-time {
  font-size: 14px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

footer {
  position: fixed;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  width: 100%;
}

footer p {
  font-size: 14px;
  color: white;
}

@media (max-width: 640px) {
  .audio-trimmer {
      width: 95vw;
  }

  .control-buttons {
      flex-wrap: nowrap;
      gap: 5px;
  }

  .control-button {
      padding: 8px;
  }

  .playback-controls {
      flex-direction: column;
      align-items: stretch;
  }

  .playback-button, .trim-button {
      margin-bottom: 10px;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
      --background-color: #1a1a1a;
      --text-color: #e2e8f0;
  }
}

/* Style for the h1 */
h1 {
    position: relative;
    text-align: center;
    font-size: 3em;
    color: #a855f7; /* Purple color for text */
    margin: 20px 0;
    padding: 20px 40px;
    background-color: transparent; /* Semi-transparent white background */
    border-radius: 50px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1; /* Ensure h1 is above the clouds */
}



/* Style for the Font Awesome icon */
.fa-icon {
    margin-right: 10px; /* Space between the icon and text */
    color: #a855f7; /* Match h1 text color */
    vertical-align: middle; /* Align icon vertically with text */
}

/* Responsive Adjustments */
@media (max-width: 600px) {
    h1 {
        font-size: 2em;
        padding: 15px 30px;
    }

    h1::before,
    h1::after {
        width: 80px;
        height: 50px;
    }
}


/* Processing Modal Styling */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: hidden; /* Disable scroll */
    background-color: rgba(0, 0, 0, 0.5); /* Black w/ opacity */
    align-items: center; /* Vertically center */
    justify-content: center; /* Horizontally center */
}

/* Modal Content */
.modal-content {
    background-color: black;
    padding: 30px 50px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 0px 20px rgb(238, 0, 255, 0.6);
}

/* Spinner Styling */
.spinner {
    border: 8px solid #f3f3f3; /* Light gray */
    border-top: 8px solid #a855f7; /* Purple */
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px auto; /* Center the spinner and add bottom margin */
}

/* Spinner Animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Optional: Prevent Text Selection During Processing */
body.modal-active {
    user-select: none;
}
.extension-result {
    margin-top: 10px;
}

.upload-notice ul {
    margin: 0;
    padding-left: 20px;
}

.config-panel {
    background: #2a2a2a;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.config-item {
    margin-bottom: 15px;
}

.config-item label {
    display: block;
    margin-bottom: 5px;
    color: #a855f7;
}

.text-input, .config-item select {
    width: 100%;
    padding: 8px;
    border: 1px solid #444;
    border-radius: 4px;
    background: #1a1a1a;
    color: #fff;
    margin-top: 5px;
}

.text-input:focus, .config-item select:focus {
    border-color: #a855f7;
    outline: none;
}

textarea.text-input {
    min-height: 80px;
    resize: vertical;
}

.range-value {
    margin-left: 10px;
    color: #888;
}

.extend-btn {
    background: #a855f7;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.2s;
}

.extend-btn:hover {
    background: #9333ea;
}

.extension-parameters {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #1a1a1a;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.extension-parameters h3 {
    color: #a855f7;
    margin-bottom: 1.5rem;
    text-align: center;
}

.extension-parameters .form-group {
    margin-bottom: 1rem;
}

.extension-parameters label {
    display: block;
    margin-bottom: 0.5rem;
    color: #e2e8f0;
}

.extension-parameters input[type="text"],
.extension-parameters input[type="number"],
.extension-parameters select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #4a5568;
    border-radius: 4px;
    background: #2d3748;
    color: #e2e8f0;
}

.extension-parameters input[type="range"] {
    width: 100%;
    margin: 0.5rem 0;
}

.extension-parameters .submit-button {
    width: 100%;
    padding: 0.75rem;
    background: #a855f7;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 1rem;
}

.extension-parameters .submit-button:hover {
    background: #9333ea;
}