/* Audio Tools - Enhanced UI */

.audio-tool-container {
  max-width: 1100px;
  margin: 32px auto;
  padding: 0 20px;
}

.audio-tool-panel {
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  padding: 40px;
  margin-bottom: 20px;
}

.audio-header {
  text-align: center;
  margin-bottom: 32px;
}

.audio-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.audio-header p {
  color: #6b7280;
  font-size: 1.1rem;
}

.tabs-container {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  border-bottom: 2px solid #e5e7eb;
  padding-bottom: 0;
}

.tab-btn {
  flex: 1;
  padding: 14px 24px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  font-size: 1rem;
  font-weight: 600;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  bottom: -2px;
}

.tab-btn:hover {
  color: #111827;
  background: #f9fafb;
}

.tab-btn.active {
  color: #667eea;
  border-bottom-color: #667eea;
  background: transparent;
}

.tab-panel {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.audio-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.info-box {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-left: 4px solid #f59e0b;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
}

.info-box p {
  margin: 0;
  color: #92400e;
  font-size: 14px;
  font-weight: 600;
}

.drop-zone {
  border: 2px dashed #d1d5db;
  border-radius: 12px;
  padding: 40px 24px;
  text-align: center;
  background: #f9fafb;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

.drop-zone::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(102, 126, 234, 0.1) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.drop-zone:hover::before {
  opacity: 1;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: #667eea;
  background: #eef2ff;
  transform: scale(1.01);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.drop-zone.drag-over {
  border-style: solid;
  border-width: 3px;
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1.01); }
  50% { transform: scale(1.03); }
}

.drop-zone-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  color: #9ca3af;
  transition: all 0.3s ease;
}

.drop-zone:hover .drop-zone-icon,
.drop-zone.drag-over .drop-zone-icon {
  color: #667eea;
  transform: scale(1.2);
}

.drop-zone-text {
  font-size: 1.1rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
  transition: color 0.3s ease;
}

.drop-zone:hover .drop-zone-text,
.drop-zone.drag-over .drop-zone-text {
  color: #667eea;
}

.drop-zone-hint {
  font-size: 0.9rem;
  color: #6b7280;
}

.waveform-container {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  display: none;
}

.waveform-container.active {
  display: block;
}

#waveform {
  border-radius: 8px;
  overflow: hidden;
}

.waveform-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
  flex-wrap: wrap;
}

.waveform-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  background: #667eea;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.waveform-btn:hover {
  background: #5568d3;
  transform: translateY(-1px);
}

.waveform-btn.secondary {
  background: #e5e7eb;
  color: #374151;
}

.waveform-btn.secondary:hover {
  background: #d1d5db;
}

.time-inputs {
  display: flex;
  gap: 16px;
  align-items: center;
  flex: 1;
}

.time-input-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.time-input-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #6b7280;
}

.time-input-group input {
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  width: 100px;
  font-size: 0.9rem;
}

.format-selector {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.format-selector label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #6b7280;
}

.format-selector select {
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: white;
  cursor: pointer;
  font-size: 0.9rem;
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
  counter-reset: file-counter;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  transition: all 0.2s ease;
  position: relative;
  counter-increment: file-counter;
}

.file-item::before {
  content: counter(file-counter);
  position: absolute;
  left: -10px;
  top: -10px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
  z-index: 1;
}

.file-item:hover {
  background: #f3f4f6;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.file-item.dragging {
  opacity: 0.4;
  transform: scale(0.95);
}

.file-item.drag-over {
  border: 2px dashed #667eea;
  background: #eef2ff;
  transform: scale(1.02);
}

.file-item.drag-over::before {
  content: "↓ Drop here";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #667eea;
  color: white;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  pointer-events: none;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.file-drag-handle {
  cursor: grab;
  color: #9ca3af;
  font-size: 1.2rem;
  transition: all 0.2s ease;
  padding: 4px;
}

.file-drag-handle:hover {
  color: #667eea;
  transform: scale(1.1);
}

.file-drag-handle:active {
  cursor: grabbing;
}

.file-icon {
  font-size: 2rem;
}

.file-info {
  flex: 1;
}

.file-name {
  font-weight: 600;
  color: #111827;
  margin-bottom: 2px;
}

.file-meta {
  font-size: 0.85rem;
  color: #6b7280;
}

.file-preview-btn {
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  background: #667eea;
  color: white;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.file-preview-btn:hover {
  background: #5568d3;
}

.file-remove-btn {
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  background: #ef4444;
  color: white;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.file-remove-btn:hover {
  background: #dc2626;
}

.merge-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.export-btn {
  flex: 1;
  min-width: 200px;
  padding: 14px 28px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 14px rgba(102, 126, 234, 0.4);
}

.export-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.export-btn:disabled {
  background: #d1d5db;
  color: #9ca3af;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.preview-player {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
  display: none;
}

.preview-player.active {
  display: block;
}

.preview-player audio {
  width: 100%;
  border-radius: 8px;
}

.notice {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  display: none;
}

.notice.active {
  display: block;
}

.notice.info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}

.notice.error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.notice.success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.loading-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Extract Audio Specific Styles */
.video-info {
  background: #f3f4f6;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #e5e7eb;
}

.info-row:last-child {
  border-bottom: none;
}

.extract-settings {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
  padding: 20px;
  background: #f9fafb;
  border-radius: 12px;
}

.quality-selector {
  display: flex;
  flex-direction: column;
}

.quality-selector label {
  margin-bottom: 8px;
  font-weight: 600;
  color: #374151;
}

.quality-selector select {
  padding: 10px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  background: white;
  cursor: pointer;
  transition: all 0.3s ease;
}

.quality-selector select:hover {
  border-color: #667eea;
}

.quality-selector select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.extract-settings button {
  grid-column: 1 / -1;
}

/* Responsive */
@media (max-width: 768px) {
  .audio-header h1 {
    font-size: 2rem;
  }

  .tabs-container {
    flex-direction: column;
  }

  .tab-btn {
    border-bottom: none;
    border-left: 3px solid transparent;
  }

  .tab-btn.active {
    border-left-color: #667eea;
    border-bottom-color: transparent;
  }

  .waveform-controls,
  .merge-actions {
    flex-direction: column;
  }

  .time-inputs {
    flex-direction: column;
    width: 100%;
  }

  .time-input-group input,
  .format-selector select {
    width: 100%;
  }

  .export-btn {
    width: 100%;
  }

  .extract-settings {
    grid-template-columns: 1fr;
  }
}
