* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
  color: #333;
}

.container {
  max-width: 800px;
  margin: 0 auto;
}

header {
  text-align: center;
  color: white;
  margin-bottom: 30px;
}

header h1 {
  font-size: 3rem;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
  font-size: 1.2rem;
  opacity: 0.9;
}

.tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
  background: rgba(255, 255, 255, 0.1);
  padding: 10px;
  border-radius: 10px;
  backdrop-filter: blur(10px);
}

.tab-btn {
  flex: 1;
  padding: 12px 20px;
  background: transparent;
  border: 2px solid transparent;
  color: white;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.tab-btn.active {
  background: white;
  color: #667eea;
  border-color: white;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.mode-selector {
  display: flex;
  gap: 10px;
  margin-bottom: 25px;
  background: #f8f9ff;
  padding: 5px;
  border-radius: 10px;
}

.mode-btn {
  flex: 1;
  padding: 12px 20px;
  background: transparent;
  border: 2px solid transparent;
  color: #667eea;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.mode-btn:hover {
  background: rgba(102, 126, 234, 0.1);
}

.mode-btn.active {
  background: white;
  color: #667eea;
  border-color: #667eea;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.mode-content {
  margin-top: 20px;
}

.card {
  background: white;
  border-radius: 15px;
  padding: 30px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.card h2 {
  margin-bottom: 10px;
  color: #667eea;
}

.info {
  color: #666;
  margin-bottom: 25px;
  font-size: 0.95rem;
}

.file-upload-area {
  position: relative;
  margin-bottom: 20px;
}

.file-upload-area input[type="file"] {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  border: 3px dashed #667eea;
  border-radius: 10px;
  background: #f8f9ff;
  cursor: pointer;
  transition: all 0.3s ease;
}

.upload-label:hover {
  background: #f0f2ff;
  border-color: #764ba2;
}

.upload-icon {
  font-size: 3rem;
  margin-bottom: 10px;
}

.upload-text {
  font-size: 1.1rem;
  color: #667eea;
  font-weight: 500;
  margin-bottom: 5px;
}

.upload-hint {
  font-size: 0.9rem;
  color: #999;
}

.file-info {
  background: #f0f2ff;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.file-info p {
  margin: 5px 0;
  color: #555;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: #555;
  font-weight: 500;
}

.form-group input[type="number"],
.form-group input[type="text"],
.form-group select {
  width: 100%;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #667eea;
}

.btn {
  padding: 14px 30px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.status-message {
  margin-top: 20px;
  padding: 15px;
  border-radius: 8px;
  font-weight: 500;
}

.status-message.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.status-message.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.status-message.info {
  background: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

.jobs-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.job-item {
  background: #f8f9ff;
  padding: 20px;
  border-radius: 10px;
  border-left: 4px solid #667eea;
}

.job-item.completed {
  border-left-color: #28a745;
}

.job-item.failed {
  border-left-color: #dc3545;
}

.job-item.processing {
  border-left-color: #ffc107;
}

.job-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.job-id {
  font-weight: 600;
  color: #667eea;
  font-family: monospace;
}

.job-status {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

.job-status.processing {
  background: #fff3cd;
  color: #856404;
}

.job-status.completed {
  background: #d4edda;
  color: #155724;
}

.job-status.failed {
  background: #f8d7da;
  color: #721c24;
}

.job-details {
  color: #666;
  font-size: 0.9rem;
}

.job-details p {
  margin: 5px 0;
}

.empty-state {
  text-align: center;
  color: #999;
  padding: 40px;
  font-style: italic;
}

.loading {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
  margin-right: 8px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.lyrics-container {
  background: #f8f9ff;
  padding: 20px;
  border-radius: 10px;
  margin: 20px 0;
  max-height: 400px;
  overflow-y: auto;
}

.lyrics-text {
  font-size: 1.1rem;
  line-height: 1.8;
  color: #555;
  white-space: pre-line;
  font-family: 'Georgia', serif;
}

.song-select {
  width: 100%;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  margin-bottom: 20px;
}

.recording-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 20px 0;
}

.btn-record {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
}

.btn-record:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(245, 87, 108, 0.4);
}

.btn-stop {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
  color: white;
}

.btn-play {
  background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
  color: white;
}

.recording-status {
  margin: 20px 0;
  padding: 15px;
  background: #fff3cd;
  border-radius: 8px;
  border: 2px solid #ffc107;
}

.recording-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: #856404;
}

.pulse {
  width: 12px;
  height: 12px;
  background: #ff0000;
  border-radius: 50%;
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(1.2);
  }
}

#recording-time {
  margin-left: auto;
  font-family: monospace;
  font-size: 1.2rem;
}

@media (max-width: 600px) {
  header h1 {
    font-size: 2rem;
  }

  .card {
    padding: 20px;
  }

  .tabs {
    flex-direction: column;
  }

  .recording-controls {
    flex-direction: column;
  }

  .recording-controls .btn {
    width: 100%;
  }
}

.saved-recordings-section {
  margin-top: 30px;
  padding-top: 30px;
  border-top: 2px solid #e0e0e0;
}

.saved-recordings-section h3 {
  color: #667eea;
  margin-bottom: 10px;
}

.recordings-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 20px;
}

.recording-item {
  background: #f8f9ff;
  padding: 20px;
  border-radius: 10px;
  border-left: 4px solid #667eea;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.recording-info {
  flex: 1;
  min-width: 200px;
}

.recording-info h4 {
  color: #667eea;
  margin-bottom: 10px;
}

.recording-info p {
  margin: 5px 0;
  color: #666;
  font-size: 0.9rem;
}

.recording-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-play-small,
.btn-primary-small,
.btn-danger-small {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-play-small {
  background: #4ecdc4;
  color: white;
}

.btn-primary-small {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.btn-danger-small {
  background: #ff6b6b;
  color: white;
}

.btn-play-small:hover,
.btn-primary-small:hover,
.btn-danger-small:hover {
  transform: translateY(-2px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

@media (max-width: 600px) {
  .recording-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .recording-actions {
    width: 100%;
  }

  .recording-actions .btn {
    flex: 1;
  }
}

