/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;700&display=swap');

:root {
  /* Color palette with red theme */
  --primary-color: #d32f2f;
  --secondary-color: #b71c1c;
  --accent-color: #ff6659;
  --success-color: #4caf50;
  --warning-color: #ff9800;
  --light-color: #f8f9fa;
  --dark-color: #212529;
  --gray-color: #6c757d;
  --border-color: #dee2e6;
  
  /* Typography */
  --font-family: 'Noto Sans SC', sans-serif;
  --font-size-base: 1rem;
  --font-size-lg: 1.25rem;
  --font-size-sm: 0.875rem;
  
  /* Spacing */
  --spacer: 1rem;
  --spacer-sm: calc(var(--spacer) * 0.5);
  --spacer-lg: calc(var(--spacer) * 1.5);
  --spacer-xl: calc(var(--spacer) * 3);
  
  /* Borders */
  --border-radius: 8px;
  --border-radius-lg: 12px;
  --border-radius-sm: 4px;
  
  /* Shadows */
  --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --box-shadow-lg: 0 10px 15px rgba(211, 47, 47, 0.2);
  
  /* Transitions */
  --transition: all 0.3s ease-in-out;
}

/* TTS Container */
.tts-container {
  max-width: 800px;
  margin: 2rem auto;
  padding: 2rem;
  background: linear-gradient(135deg, #fff5f5 0%, #ffebee 100%);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--box-shadow-lg);
  animation: fadeIn 0.5s ease-out;
}

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

/* Title Styles */
.tts-title {
  text-align: center;
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  font-weight: 700;
  position: relative;
  font-size: 2rem;
}

.tts-title::after {
  content: '';
  display: block;
  width: 80px;
  height: 4px;
  background: linear-gradient(to right, var(--primary-color), var(--accent-color));
  margin: 0.5rem auto;
  border-radius: 2px;
  animation: expandLine 1s ease-out forwards;
}

@keyframes expandLine {
  0% { width: 0; }
  100% { width: 80px; }
}

/* Description */
.tts-description {
  text-align: center;
  color: var(--gray-color);
  margin-bottom: 2rem;
  font-size: var(--font-size-base);
  line-height: 1.6;
}

/* Input Section */
.input-section {
  margin-bottom: 2rem;
  animation: slideInUp 0.5s ease-out;
}

@keyframes slideInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.input-section label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--dark-color);
  font-size: var(--font-size-lg);
}

.text-input {
  width: 100%;
  min-height: 150px;
  padding: 1rem;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  resize: vertical;
  transition: var(--transition);
  background-color: white;
  box-sizing: border-box;
}

.text-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.2);
}

.text-input::placeholder {
  color: #adb5bd;
  font-style: italic;
}

/* Options Section */
.options-section {
  background: white;
  padding: 1.5rem;
  border-radius: var(--border-radius);
  margin-bottom: 2rem;
  box-shadow: var(--box-shadow);
  animation: slideInUp 0.7s ease-out;
}

.options-section h2 {
  margin-top: 0;
  margin-bottom: 1.5rem;
  color: var(--primary-color);
  text-align: center;
  font-weight: 600;
}

.option-group {
  margin-bottom: 1.5rem;
}

.option-group:last-child {
  margin-bottom: 0;
}

.option-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--dark-color);
  font-size: var(--font-size-base);
}

.option-group select {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  background-color: white;
  transition: var(--transition);
  cursor: pointer;
}

.option-group select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.2);
}

.speed-info {
  margin-top: 0.5rem;
  padding: 0.5rem;
  background-color: #ffebee;
  border-radius: var(--border-radius-sm);
  font-size: var(--font-size-sm);
  color: var(--gray-color);
  border-left: 3px solid var(--primary-color);
}

/* Generate Button */
#generate-btn {
  display: block;
  width: 100%;
  padding: 1rem;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  font-family: var(--font-family);
  font-size: var(--font-size-lg);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--box-shadow);
  position: relative;
  overflow: hidden;
  margin-bottom: 2rem;
}

#generate-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--box-shadow-lg);
  background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
}

#generate-btn:active {
  transform: translateY(0);
}

#generate-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: 0.5s;
}

#generate-btn:hover::before {
  left: 100%;
}

#generate-btn:disabled {
  background: #cccccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

#generate-btn:disabled:hover {
  transform: none;
  box-shadow: none;
}

/* Output Section */
.output-section {
  background: white;
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  text-align: center;
  display: none;
  animation: fadeIn 0.5s ease-out;
}

.output-section.active {
  display: block;
}

.output-section h3 {
  margin-top: 0;
  margin-bottom: 1.5rem;
  color: var(--primary-color);
  font-weight: 600;
}

.audio-player {
  width: 100%;
  margin-bottom: 1.5rem;
  border-radius: var(--border-radius);
}

.download-btn {
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, var(--primary-color) 0%, #e53935 100%);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--box-shadow);
}

.download-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--box-shadow-lg);
  background: linear-gradient(135deg, #e53935 0%, var(--primary-color) 100%);
}

.download-btn:active {
  transform: translateY(0);
}

/* Status Message */
.status-message {
  padding: 1rem;
  margin-bottom: 1.5rem;
  border-radius: var(--border-radius);
  text-align: center;
  font-weight: 500;
  display: none;
  animation: fadeIn 0.3s ease-out;
}

.status-message.show {
  display: block;
}

.status-message.success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.status-message.error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.status-message.processing {
  background-color: #ffebee;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Responsive Design */

/* Large screens */
@media (max-width: 1024px) {
  .tts-container {
    margin: 1.5rem;
    padding: 1.5rem;
  }
  
  .tts-title {
    font-size: 1.8rem;
    margin-bottom: 1.25rem;
  }
  
  .tts-description {
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
  }
  
  .input-section {
    margin-bottom: 1.5rem;
  }
  
  .text-input {
    min-height: 130px;
    padding: 0.875rem;
  }
  
  .options-section {
    padding: 1.25rem;
    margin-bottom: 1.5rem;
  }
  
  .options-section h2 {
    font-size: 1.3rem;
    margin-bottom: 1.25rem;
  }
  
  .option-group {
    margin-bottom: 1.25rem;
  }
  
  .option-group select {
    padding: 0.875rem;
  }
  
  .speed-info {
    font-size: 0.8rem;
    padding: 0.4rem;
  }
  
  #generate-btn {
    padding: 0.875rem;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
  }
  
  .output-section {
    padding: 1.5rem;
  }
  
  .output-section h3 {
    font-size: 1.3rem;
    margin-bottom: 1.25rem;
  }
  
  .audio-player {
    margin-bottom: 1.25rem;
  }
  
  .download-btn {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
  }
  
  .status-message {
    padding: 0.875rem;
    font-size: 0.95rem;
  }
}

/* Medium screens */
@media (max-width: 768px) {
  .tts-container {
    margin: 1rem;
    padding: 1.25rem;
  }
  
  .tts-title {
    font-size: 1.6rem;
    margin-bottom: 1rem;
  }
  
  .tts-description {
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
  }
  
  .input-section {
    margin-bottom: 1.25rem;
  }
  
  .input-section label {
    font-size: 1rem;
  }
  
  .text-input {
    min-height: 120px;
    padding: 0.75rem;
    font-size: 0.95rem;
  }
  
  .options-section {
    padding: 1rem;
    margin-bottom: 1.25rem;
  }
  
  .options-section h2 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
  }
  
  .option-group {
    margin-bottom: 1rem;
  }
  
  .option-group label {
    font-size: 0.95rem;
    margin-bottom: 0.4rem;
  }
  
  .option-group select {
    padding: 0.75rem;
    font-size: 0.95rem;
  }
  
  .speed-info {
    font-size: 0.75rem;
    padding: 0.3rem;
  }
  
  #generate-btn {
    padding: 0.75rem;
    font-size: 1rem;
    margin-bottom: 1.25rem;
  }
  
  .output-section {
    padding: 1.25rem;
  }
  
  .output-section h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
  }
  
  .audio-player {
    margin-bottom: 1rem;
  }
  
  .download-btn {
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
  }
  
  .status-message {
    padding: 0.75rem;
    font-size: 0.9rem;
  }
}

/* Small screens */
@media (max-width: 480px) {
  .tts-container {
    margin: 0.75rem;
    padding: 1rem;
  }
  
  .tts-title {
    font-size: 1.4rem;
    margin-bottom: 0.875rem;
  }
  
  .tts-description {
    font-size: 0.85rem;
    margin-bottom: 1rem;
  }
  
  .input-section {
    margin-bottom: 1rem;
  }
  
  .input-section label {
    font-size: 0.95rem;
  }
  
  .text-input {
    min-height: 100px;
    padding: 0.625rem;
    font-size: 0.9rem;
  }
  
  .options-section {
    padding: 0.875rem;
    margin-bottom: 1rem;
  }
  
  .options-section h2 {
    font-size: 1.1rem;
    margin-bottom: 0.875rem;
  }
  
  .option-group {
    margin-bottom: 0.875rem;
  }
  
  .option-group label {
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
  }
  
  .option-group select {
    padding: 0.625rem;
    font-size: 0.9rem;
  }
  
  .speed-info {
    font-size: 0.7rem;
    padding: 0.25rem;
  }
  
  #generate-btn {
    padding: 0.625rem;
    font-size: 0.95rem;
    margin-bottom: 1rem;
  }
  
  .output-section {
    padding: 1rem;
  }
  
  .output-section h3 {
    font-size: 1.1rem;
    margin-bottom: 0.875rem;
  }
  
  .audio-player {
    margin-bottom: 0.875rem;
  }
  
  .download-btn {
    padding: 0.625rem 1rem;
    font-size: 0.9rem;
  }
  
  .status-message {
    padding: 0.625rem;
    font-size: 0.85rem;
  }
}

/* Critical: Override generic button styles that might affect the hamburger menu */
/* Ensure .menu-toggle won't be affected by generic button styles */
.menu-toggle {
  background: none !important;
  color: inherit !important;
  font-weight: normal !important;
  margin-top: 0 !important;
  padding: 0 !important;
  border: none !important;
}