
/* ------------------ Form Section ------------------ */

.voice-form {
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  text-align: center;
}
.form-section {
  display: flex;
  justify-content: center;
  align-items: flex-start;
}
.voice-form h2 {
  font-size: 2rem;
  margin-bottom: 5px;
  margin-top: 20px;
}

.voice-form .note {
  font-size: 0.95rem;
  color: #666;
  margin-bottom: 10px;
}

/* ------------------ Buttons ------------------ */
/* Button Row Adjustment */
.button-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px; /* reduced gap for closer spacing */
  margin: 20px 0;
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.btn-shared {
  padding: 14px 36px;
  font-size: 1rem;
  font-weight: 500;
  border: none;
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  transition: all 0.3s;
  min-width: 220px;
  text-align: center;
}

.custom-file-label {
  background: linear-gradient(135deg, #2f49cc, #2439a3);
}

.custom-file-label:hover {
  background: linear-gradient(135deg, #2439a3, #1e2f8f);
  transform: translateY(-2px);
}

.record-btn {
  background: linear-gradient(135deg, #1ea74a, #178a3d);
}

.record-btn:hover {
  background: linear-gradient(135deg, #178a3d, #126d32);
  transform: translateY(-2px);
}

.record-btn.stop {
  background: #e63946 !important;
  padding: 14px 36px;
  border-radius: 10px;
  color: #fff;
  min-width: 220px;
  cursor: pointer;
  transition: all 0.3s;
}

.record-btn.stop:hover {
  background: #c62836 !important;
  transform: translateY(-2px);
}

.or-divider {
  font-weight: 600;
  font-size: 1rem;
  color: #555;
}

.divider {
  margin: 20px auto;
  text-align: center;
  font-weight: 600;
  color: #555;
}

/* ------------------ Textarea ------------------ */
textarea {
  width: 100%;
  min-height: 220px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid #ccc;
  background: #f7f9ff;
  font-size: 1rem;
  resize: vertical;
}

/* ------------------ Text File Upload ------------------ */
.text-file-label {
  display: inline-block;
  width:220px;
  margin: 10px auto;
  text-align: center;
  background: #3756f1;
  color: #fff;
  padding: 14px 36px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s;
}

.text-file-label:hover {
  background: linear-gradient(135deg, #3959fb, #1939ec);
  transform: translateY(-2px);
}

/* ------------------ Audio Preview ------------------ */
#recordedAudio {
  display: block;
  margin: 10px auto 0;
}

/* ------------------ Sample Voices ------------------ */
.show-samples-text {
  cursor: pointer;
  color: #2f49cc;
  font-weight: 600;
  text-decoration: underline;
}

.samples-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-top: 15px;
}

.sample-item audio {
  width: 250px;
}

/* ------------------ Generate Voices Grid ------------------ */
.voices-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
  justify-items: center;
  margin-top: 20px;
  width: 100%;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

/* ------------------ Voice Card ------------------ */
.voice-card {
  background: #f7f9ff;
  border-radius: 12px;
  padding: 15px;
  width: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  box-sizing: border-box;
}

.voice-card p {
  font-weight: 600;
  text-align: center;
  margin: 0;
}

.voice-card audio {
  width: 100%;
}

/* ------------------ Radio Select ------------------ */
.select-voice-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 500;
  color: #2e3a70;
  font-size: 0.95rem;
}

.select-voice-label input[type="radio"] {
  accent-color: #2e3a70;
}

/* ------------------ Load More Button ------------------ */
.load-more-btn {
  margin: 20px auto 0;
  padding: 12px 28px;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #2f49cc, #2439a3);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: block;
  transition: all 0.3s ease;
}

.load-more-btn:hover {
  background: linear-gradient(135deg, #2439a3, #1e2f8f);
  transform: translateY(-2px);
}

/* ------------------ Submit Button ------------------ */
.submit-btn {
  margin: 20px auto;
  padding: 14px 28px;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #2f49cc, #2439a3);
  border: none;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  cursor: pointer;
  transition: all 0.3s ease;
  max-width: 300px;
  display: block;
}

.submit-btn:hover {
  background: linear-gradient(135deg, #2439a3, #1e2f8f);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

/* ------------------ Responsive ------------------ */
@media (max-width: 768px) {
  .hero-content h2 {
    font-size: 1.75rem;
  }

  .hero-content p {
    font-size: 1rem;
  }

  .button-row {
    flex-direction: column;
    gap: 12px;
  }

  .btn-group {
    flex-direction: column;
  }

  .custom-file-label:not(.text-file-label),
  .record-btn,
  .submit-btn,
  .load-more-btn {
    width: 100%;
  }

  .voices-grid {
    grid-template-columns: 1fr;
  }
}

/* ------------------ No Voices or Samples Message ------------------ */
.no-voices-msg,
.no-samples-msg {
  text-align: center;
  font-size: 1.05rem;
  font-weight: 500;
  color: #777;
  background: #f9faff;
  border: 1px dashed #ccd2f0;
  border-radius: 12px;
  padding: 18px;
  margin-top: 20px;
  width: 100%;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* Loader overlay */
#loaderOverlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 9999;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* Spinner */
#loaderOverlay .loader {
  border: 8px solid #f3f3f3;
  border-top: 8px solid #3498db;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  animation: spin 1s linear infinite;
  margin-bottom: 15px;
}

#loaderOverlay p {
  color: #fff;
  font-size: 1.1rem;
  text-align: center;
}

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

.inline-error {
  color: #ff4d4f;
  font-size: 0.9em;
  margin-top: 6px;
  font-weight: 500;
  display: block;
}

.error-highlight {
  border: 2px solid #ff4d4f !important;
  box-shadow: 0 0 4px rgba(255, 77, 79, 0.6);
}

.flash-container {
  margin: 20px auto;
  max-width: 800px;
}
.alert {
  padding: 10px 15px;
  border-radius: 6px;
  margin-bottom: 10px;
  font-weight: 500;
}
.alert-error { background: #f8d7da; color: #721c24; }
.alert-warning { background: #fff3cd; color: #856404; }
.alert-success { background: #d4edda; color: #155724; }

/* ❌ Remove button */
.remove-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-left: 8px;
  background-color: #ff4d4f;
  color: #fff;
  font-size: 0.9rem;
  font-weight: bold;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.25s ease;
  vertical-align: middle;
  box-shadow: 0 0 0 rgba(255, 77, 79, 0);
}

.remove-btn:hover {
  background-color: #ff0000;
  transform: scale(1.15);
  box-shadow: 0 0 6px rgba(255, 77, 79, 0.6);
}

.remove-btn:active {
  transform: scale(0.95);
  background-color: #cc0000;
  box-shadow: 0 0 3px rgba(255, 77, 79, 0.4);
}

.audio-preview {
  display: block;
  margin: 10px auto;
  width: 280px;
  border-radius: 8px;
}

/* ===== Full-Width Compact Plan Banner ===== */
.plan-banner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 14px 30px;
  background: linear-gradient(135deg, #f9fafb, #ffffff);
  border-top: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  position: relative;
  margin: 0;
  z-index: 50;
}

.plan-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 100%;
}

.free-banner::before {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
}
.pro-banner::before {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}
.premium-banner::before {
  background: linear-gradient(135deg, #10b981, #047857);
}

.plan-info {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  max-width: 1200px;
  width: 100%;
  justify-content: space-between;
}

.plan-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  color: #1e293b;
  background: #eef2ff;
  padding: 6px 12px;
  border-radius: 8px;
}

.plan-name i {
  font-size: 0.9rem;
  color: #4338ca;
}

.plan-limits {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.85rem;
  color: #475569;
}

.limit-item strong {
  color: #111827;
}

.limit-warning {
  color: #dc2626;
  font-size: 0.8rem;
  font-weight: 600;
}

.plan-note {
  font-size: 0.85rem;
  color: #334155;
  background: #f0f7ff;
  padding: 6px 12px;
  border-radius: 6px;
  border-left: 3px solid #3b82f6;
}

/* Responsive */
@media (max-width: 768px) {
  .plan-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 16px;
  }
  .plan-info {
    flex-direction: column;
    align-items: flex-start;
  }
}

.flash-container {
  position: fixed;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  width: auto;
  max-width: 420px;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.flash-message {
  padding: 12px 20px 12px 16px; /* add more right padding for close button */
  border-radius: 8px;
  font-size: 0.95rem;
  text-align: left;
  margin-bottom: 8px;
  position: relative;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  background: #e8f1ff; /* light blue background */
  color: #3756e4; /* blue text */
  border: 1px solid #90caf9; /* blue border */
}

/* Close button */
.flash-message .close-btn {
  position: absolute;
  top: 50%;
  right: 8px; /* moved a little left */
  transform: translateY(-50%);
  background: transparent;
  border: none;
  font-size: 18px;
  font-weight: bold;
  color: #3756e4;
  cursor: pointer;
  transition: color 0.2s;
}

.flash-message .close-btn:hover {
  color: #1a3bb8;
}

/* ------------------ Recording Name & Script Name Inputs ------------------ */
#recordingName,
#scriptName {
  width: 100%;
  max-width: 400px;
  margin: 8px auto 0;
  padding: 14px 20px;
  border-radius: 12px;
  border: 1px solid #ccc;
  font-size: 1rem;
  font-weight: 500;
  color: #2e3a70;
  background: #f7f9ff;
  transition: all 0.25s ease;
  display: block;
  text-align: left;
}

#recordingName:focus,
#scriptName:focus {
  border-color: #2f49cc;
  box-shadow: 0 0 8px rgba(47, 73, 204, 0.3);
  outline: none;
}

/* Optional placeholder style */
#recordingName::placeholder,
#scriptName::placeholder {
  color: #9ca3af;
  font-weight: 400;
}


