:root {
  --primary-color: #4a90e2;
  --secondary-color: #2c3e50;
  --background-color: #f5f6fa;
  --text-color: #2c3e50;
  --border-radius: 8px;
}

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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
  line-height: 1.6;
}

.container {
  max-width: 1000px;
  margin: 2rem auto;
  padding: 2rem;
}

h1 {
  text-align: center;
  color: var(--secondary-color);
  margin-bottom: 2rem;
}

.translation-area {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.5rem;
}

.input-section, .output-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

select {
  padding: 0.5rem;
  border-radius: var(--border-radius);
  border: 1px solid #ddd;
  background-color: white;
  font-size: 1rem;
}

textarea {
  height: 200px;
  padding: 1rem;
  border-radius: var(--border-radius);
  border: 1px solid #ddd;
  resize: none;
  font-size: 1rem;
  background-color: white;
}

textarea:focus {
  outline: 2px solid var(--primary-color);
  border-color: transparent;
}

.swap-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
  transform: rotate(90deg);
}

.swap-btn:hover {
  transform: rotate(90deg) scale(1.1);
}

.swap-btn svg {
  color: var(--primary-color);
}

.translate-btn {
  display: block;
  width: 100%;
  padding: 1rem;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  font-size: 1.1rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.translate-btn:hover {
  background-color: #357abd;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.translate-btn:active {
  animation: pulse 0.3s ease-in-out;
}

.voice-controls {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.voice-btn {
  background: var(--primary-color);
  border: none;
  border-radius: var(--border-radius);
  padding: 0.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: white;
  font-size: 0.9rem;
}

.voice-btn:hover {
  background-color: #357abd;
}

.voice-btn svg {
  width: 20px;
  height: 20px;
}

.voice-btn.recording {
  background-color: #e74c3c;
  animation: pulse 1s infinite;
}

.voice-btn:disabled {
  background-color: #bdc3c7;
  cursor: not-allowed;
}

@media (max-width: 768px) {
  .translation-area {
    flex-direction: column;
  }
  
  .swap-btn {
    transform: rotate(180deg);
  }

  .swap-btn:hover {
    transform: rotate(180deg) scale(1.1);
  }
  .voice-controls {
    flex-direction: column;
  }
}