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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 40px 30px;
  text-align: center;
}

.header h1 {
  font-size: 2.5em;
  margin-bottom: 10px;
  font-weight: 700;
}

.header p {
  font-size: 1.1em;
  opacity: 0.95;
}

.content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  padding: 40px;
}

@media (max-width: 768px) {
  .content {
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 20px;
  }
}

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

.section h2 {
  font-size: 1.3em;
  color: #333;
  border-bottom: 2px solid #667eea;
  padding-bottom: 10px;
}

.input-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.textarea {
  width: 100%;
  min-height: 150px;
  padding: 15px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 1em;
  resize: vertical;
  transition: border-color 0.3s ease;
}

.textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.output-textarea {
  background-color: #f5f5f5;
  cursor: not-allowed;
}

.char-count {
  font-size: 0.85em;
  color: #999;
  text-align: right;
}

.button-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-size: 1em;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}

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

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

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

.btn-secondary {
  background-color: #4CAF50;
  color: white;
  flex: 1;
}

.btn-secondary:hover:not(:disabled) {
  background-color: #45a049;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4);
}

.btn-tertiary {
  background-color: #f44336;
  color: white;
  flex: 1;
}

.btn-tertiary:hover:not(:disabled) {
  background-color: #da190b;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(244, 67, 54, 0.4);
}

.btn span {
  pointer-events: none;
}

.status-message {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 15px;
  background-color: #e3f2fd;
  border-left: 4px solid #2196F3;
  border-radius: 4px;
  color: #1976d2;
  font-weight: 500;
}

.recording-indicator {
  display: inline-block;
  width: 10px;
  height: 10px;
  background-color: #f44336;
  border-radius: 50%;
  animation: pulse 1s infinite;
}

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

.output-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.output-status {
  font-size: 0.9em;
  color: #999;
  min-height: 20px;
}

.output-status.success {
  color: #4CAF50;
  font-weight: 500;
}

.output-status.error {
  color: #f44336;
  font-weight: 500;
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 20px;
  z-index: 1000;
}

.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #667eea;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-overlay p {
  color: white;
  font-size: 1.1em;
  font-weight: 500;
}