.webcam-recorder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  padding: 20px;
  background-color: #1a1a1a;
  border-radius: 12px;
  width: 100%;
  max-width: 500px;
}

.webcam-title {
  font-size: 1.2rem;
  color: #fff;
  margin: 0;
  font-weight: 500;
}

.webcam-error {
  color: #e63946;
  font-size: 0.9rem;
  margin: 0;
  text-align: center;
}

.webcam-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background-color: #000;
  border-radius: 8px;
  overflow: hidden;
}

.webcam-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* Mirror the live video */
}

.webcam-video.preview-video {
  transform: scaleX(1); /* Don't mirror the preview playback */
}

.recording-indicator {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: rgba(0, 0, 0, 0.7);
  padding: 6px 12px;
  border-radius: 20px;
}

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

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.recording-time {
  color: #fff;
  font-size: 14px;
  font-family: monospace;
}

.webcam-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.webcam-btn {
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.webcam-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.record-btn {
  background-color: #e63946;
  color: #fff;
}

.record-btn:hover:not(:disabled) {
  background-color: #f25c69;
}

.stop-btn {
  background-color: #3b3b3b;
  color: #fff;
}

.stop-btn:hover:not(:disabled) {
  background-color: #4a4a4a;
}

.recording-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

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

.recording-ready {
  color: #4ade80;
  font-size: 14px;
  margin: 0;
}

.recording-actions .webcam-btn {
  min-width: 140px;
}

.discard-btn {
  background-color: #6b7280;
  color: #fff;
}

.discard-btn:hover:not(:disabled) {
  background-color: #7c8591;
}

.rerecord-btn {
  background-color: #2563eb;
  color: #fff;
}

.rerecord-btn:hover:not(:disabled) {
  background-color: #3b82f6;
}

@media (max-width: 600px) {
  .webcam-recorder {
    max-width: 100%;
  }

  .webcam-btn {
    padding: 10px 18px;
    font-size: 14px;
  }
}
