/* Reset and Base Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: #111111;
  color: #ffffff;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Main Content Area */
main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

/* Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Welcome Section */
.welcome {
  text-align: center;
}

.welcome h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  white-space: nowrap;
}

/* Audio Controls */
.audio-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}

.mic-button {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: none;
  background-color: #333;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s, transform 0.1s;
}

.mic-button:hover {
  background-color: #444;
}

.mic-button:active {
  transform: scale(0.95);
}

.mic-button.preparing {
  background-color: #f59e0b;
  animation: pulse 0.8s infinite;
}

.mic-button.recording {
  background-color: #dc2626;
  animation: pulse 1.5s infinite;
}

.mic-button svg {
  width: 32px;
  height: 32px;
}

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

.status-text {
  font-size: 0.875rem;
  color: #ffffff;
  min-height: 1.25rem;
}

.status-text.error {
  color: #dc2626;
}

.status-text.success {
  color: #16a34a;
}

/* Audio Playback */
.audio-playback {
  margin-top: 1rem;
  display: none;
}

.audio-playback.visible {
  display: block;
}

.audio-playback audio {
  width: 100%;
  max-width: 300px;
}

/* Results Container */
.results-container {
  display: none;
  margin-top: 1.5rem;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

/* Transcription Result (textarea) */
.transcription-result {
  width: 100%;
  padding: 1rem;
  background-color: #1a1a1a;
  border: 2px solid #444;
  border-radius: 8px;
  font-size: 1.125rem;
  line-height: 1.6;
  text-align: left;
  color: #f0f0f0;
  font-family: inherit;
  resize: vertical;
  min-height: 100px;
  -webkit-text-size-adjust: 100%;
}

.transcription-result:focus {
  outline: none;
  border-color: #4a9eff;
}

.transcription-result::placeholder {
  color: #888;
}

/* Translate Button */
.translate-button {
  width: 100%;
  padding: 0.75rem 1rem;
  margin-top: 0.5rem;
  background-color: #2563eb;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
}

.translate-button:hover {
  background-color: #1d4ed8;
}

.translate-button:disabled {
  background-color: #555;
  cursor: not-allowed;
}

.translate-button.highlight {
  background-color: #f59e0b;
  animation: pulse-highlight 1s infinite;
}

@keyframes pulse-highlight {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

/* Translation Result */
.translation-result {
  display: none;
  padding: 1rem;
  margin-top: 0.5rem;
  background-color: #1a2a1a;
  border: 2px solid #3a5a3a;
  border-radius: 8px;
  font-size: 1.5rem;
  line-height: 1.6;
  text-align: left;
  color: #f0f0f0;
}

/* Save Button */
.save-button {
  width: 100%;
  padding: 0.75rem 1rem;
  margin-top: 1rem;
  background-color: #16a34a;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
}

.save-button:hover {
  background-color: #15803d;
}

.save-button:disabled {
  background-color: #555;
  cursor: not-allowed;
}

/* New Recording Button */
.new-recording-button {
  width: 100%;
  padding: 0.75rem 1rem;
  margin-top: 0.5rem;
  background-color: #333;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
}

.new-recording-button:hover {
  background-color: #444;
}

/* Clear Button */
.clear-button {
  width: 100%;
  padding: 0.75rem 1rem;
  margin-top: 0.5rem;
  background-color: #dc2626;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
}

.clear-button:hover {
  background-color: #b91c1c;
}

/* Pending Badge */
.pending-badge {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.25rem 0.75rem;
  background-color: #f59e0b;
  color: #000;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Sync Notification */
.sync-notification {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background-color: #16a34a;
  color: #fff;
  border-radius: 8px;
  font-size: 0.875rem;
  animation: fadeIn 0.3s ease;
}

.sync-notification.syncing {
  background-color: #2563eb;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Version Info */
.version-info {
  margin-top: 2rem;
  font-size: 0.75rem;
  color: #ffffff;
}

/* Back Button */
.back-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  margin-bottom: 1rem;
  background: #333;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.2s;
}

.back-button:hover {
  background: #444;
}

.back-button::before {
  content: '←';
}
