/* static/css/styles.css */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f8f9fa;
}

.app-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

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

header h1 {
  font-size: 2.5rem;
  color: #2c3e50;
}

main {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
}

@media (min-width: 992px) {
  main {
      grid-template-columns: 3fr 2fr;
  }
}

.editor-section, .player-section {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 25px;
}

h2 {
  margin-bottom: 20px;
  color: #2c3e50;
  font-size: 1.5rem;
}

.participants-section, .script-section {
  margin-bottom: 30px;
}

.participant-item, .dialogue-item {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 15px;
  margin-bottom: 15px;
  background-color: #f8f9fa;
  border-radius: 6px;
  border-left: 4px solid #3498db;
}

.input-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 5px;
  flex: 1 1 200px;
}

.text-input {
  flex: 1 1 100%;
}

label {
  font-weight: 600;
  margin-bottom: 5px;
  color: #555;
}

input, select, textarea {
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.9rem;
}

textarea {
  resize: vertical;
  min-height: 60px;
}

button {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.3s;
}

.remove-btn {
  background-color: #e74c3c;
  color: white;
  align-self: flex-start;
}

.remove-btn:hover {
  background-color: #c0392b;
}

.remove-btn:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

.add-btn {
  background-color: #2ecc71;
  color: white;
  padding: 10px 20px;
  margin-top: 10px;
}

.add-btn:hover {
  background-color: #27ae60;
}

.generate-section {
  text-align: center;
  margin-top: 20px;
}

.user-id-container {
  margin-bottom: 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.user-id-container label {
  margin-bottom: 8px;
}

.user-id-container input {
  width: 100%;
  max-width: 300px;
  margin-bottom: 15px;
}

.generate-btn {
  background-color: #3498db;
  color: white;
  padding: 12px 30px;
  font-size: 1rem;
}

.generate-btn:hover {
  background-color: #2980b9;
}

.generate-btn:disabled {
  background-color: #95a5a6;
  cursor: not-allowed;
}

.player-section {
  display: flex;
  flex-direction: column;
}

.status-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  text-align: center;
  color: #7f8c8d;
}

.error-message {
  background-color: #ffebee;
  border-left: 4px solid #e74c3c;
  padding: 15px;
  border-radius: 4px;
  margin-top: 20px;
  color: #c0392b;
}

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

.player-info {
  background-color: #f1f8ff;
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 10px;
  border-left: 3px solid #3498db;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 10px;
}

.play-btn {
  background-color: #3498db;
  color: white;
  padding: 10px 25px;
}

.play-btn:hover {
  background-color: #2980b9;
}

.player-status {
  color: #7f8c8d;
  font-style: italic;
}

audio {
  width: 100%;
  margin: 10px 0;
}

.download-btn {
  background-color: #9b59b6;
  color: white;
  padding: 10px 20px;
  margin-top: 10px;
  align-self: center;
}

.download-btn:hover {
  background-color: #8e44ad;
}

.loading-spinner {
  border: 4px solid rgba(0, 0, 0, 0.1);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border-left-color: #3498db;
  animation: spin 1s linear infinite;
  margin-bottom: 15px;
}

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

.hidden {
  display: none !important;
}