/* Clone Voices Page - Modern Professional Design */

.custom-voices-page {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px 48px;
}

/* ============================================
   HERO SECTION - Create Voice
   ============================================ */

   .check-icon{
    background: transparent;
   }

.create-voice-hero {
  position: relative;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: 1.5rem;
  padding: 48px 32px;
  margin-bottom: 48px;
  overflow: hidden;
  text-align: center;
}

.hero-glow {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, hsl(var(--foreground) / 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 500px;
  margin: 0 auto;
}

.hero-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, hsl(var(--foreground) / 0.1) 0%, hsl(var(--foreground) / 0.05) 100%);
  border-radius: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: hsl(var(--foreground));
}

.create-voice-hero h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  color: hsl(var(--muted-foreground));
  margin-bottom: 24px;
  font-size: 1rem;
}

/* Audio Source Tabs */
.audio-source-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  justify-content: center;
}

.source-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: hsl(var(--secondary));
  border: 1px solid hsl(var(--border));
  border-radius: 9999px;
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.source-tab:hover {
  background: hsl(var(--muted));
  color: hsl(var(--foreground));
}

.source-tab.active {
  background: hsl(var(--foreground));
  color: hsl(var(--background));
  border-color: hsl(var(--foreground));
}

/* Upload Zone */
.upload-zone {
  margin-bottom: 24px;
}

/* Record Zone */
.record-zone {
  margin-bottom: 24px;
  padding: 40px 24px;
  background: hsl(var(--background));
  border: 2px dashed hsl(var(--border));
  border-radius: 1rem;
  text-align: center;
}

.record-idle,
.record-active {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.record-icon {
  width: 80px;
  height: 80px;
  background: hsl(var(--secondary));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: hsl(var(--muted-foreground));
}

.record-instructions {
  color: hsl(var(--muted-foreground));
  font-size: 0.9rem;
  margin: 0;
}

.record-start-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  background: hsl(0 70% 50%);
  color: white;
  border: none;
  border-radius: 9999px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.record-start-btn:hover {
  background: hsl(0 70% 45%);
  transform: scale(1.02);
}

/* Recording Active State */
.record-pulse {
  position: relative;
  width: 80px;
  height: 80px;
}

.pulse-ring {
  position: absolute;
  inset: 0;
  border: 3px solid hsl(0 70% 50%);
  border-radius: 50%;
  animation: pulseRing 1.5s ease-out infinite;
}

@keyframes pulseRing {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(1.4);
    opacity: 0;
  }
}

.pulse-core {
  position: absolute;
  inset: 0;
  background: hsl(0 70% 50%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  animation: pulseCore 1s ease-in-out infinite;
}

@keyframes pulseCore {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(0.95);
  }
}

.record-timer {
  font-size: 2rem;
  font-weight: 700;
  color: hsl(var(--foreground));
  font-variant-numeric: tabular-nums;
}

.record-status {
  color: hsl(0 70% 50%);
  font-size: 0.9rem;
  font-weight: 500;
  margin: 0;
}

.record-stop-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: hsl(var(--secondary));
  color: hsl(var(--foreground));
  border: 1px solid hsl(var(--border));
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.record-stop-btn:hover {
  background: hsl(var(--muted));
}

.upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 40px 24px;
  background: hsl(var(--background));
  border: 2px dashed hsl(var(--border));
  border-radius: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.upload-label:hover {
  border-color: hsl(var(--foreground) / 0.3);
  background: hsl(var(--secondary) / 0.5);
}

.upload-label:hover .upload-icon {
  transform: translateY(-4px);
}

.upload-icon {
  width: 64px;
  height: 64px;
  background: hsl(var(--secondary));
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: hsl(var(--muted-foreground));
  transition: transform 0.3s ease;
}

.upload-text {
  font-size: 0.95rem;
  color: hsl(var(--muted-foreground));
}

.upload-text strong {
  color: hsl(var(--foreground));
}

.upload-hint {
  font-size: 0.8rem;
  color: hsl(var(--muted-foreground) / 0.7);
}

.file-error {
  margin-top: 12px;
  font-size: 0.875rem;
  min-height: 1.5em;
  color: hsl(var(--destructive));
}

/* Selected File Card */
.selected-file-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: linear-gradient(135deg, hsl(142 70% 45% / 0.1), hsl(142 70% 45% / 0.05));
  border: 1px solid hsl(142 70% 45% / 0.3);
  border-radius: 1rem;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.selected-file-icon {
  width: 52px;
  height: 52px;
  background: hsl(142 70% 45% / 0.15);
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: hsl(142 70% 45%);
  flex-shrink: 0;
}

.selected-file-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.selected-file-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-file-size {
  font-size: 0.8rem;
  color: hsl(142 70% 45%);
  font-weight: 500;
}

.selected-file-remove {
  width: 36px;
  height: 36px;
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.selected-file-remove:hover {
  background: hsl(0 70% 50%);
  border-color: hsl(0 70% 50%);
  color: white;
}

/* Voice Form */
.voice-form {
  display: none;
  animation: slideUp 0.4s ease;
  margin-top: 24px;
}

.voice-form.visible {
  display: block;
}

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

.form-row {
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: 16px;
  margin-bottom: 16px;
}

.form-field {
  text-align: left;
  margin-bottom: 16px;
}

.form-field:last-child {
  margin-bottom: 0;
}

.form-field label {
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--foreground));
  margin-bottom: 8px;
}

.form-field .optional {
  color: hsl(var(--muted-foreground));
  font-weight: 400;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 12px 16px;
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  border-radius: 0.75rem;
  color: hsl(var(--foreground));
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

/* Checkbox Styling */
.checkbox-field {
  display: flex;
  align-items: flex-start;
  margin-bottom: 24px;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  line-height: 1.5;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid hsl(var(--border));
  border-radius: 4px;
  background: transparent;
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  margin-top: 0; /* Changed from 1px to 0 if we align center, or keep 1px and check */
  margin-top: 0.125em; /* Better alignment with text line-height */
}

.checkbox-label input[type="checkbox"]:checked {
  background: hsl(var(--foreground));
  border-color: hsl(var(--foreground));
}

.checkbox-label input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  background-color: hsl(var(--background));
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") no-repeat center center;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") no-repeat center center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: hsl(var(--foreground) / 0.3);
  box-shadow: 0 0 0 3px hsl(var(--foreground) / 0.05);
}

.form-field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%239ca3af' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
  background-position: right 12px center;
  background-repeat: no-repeat;
  background-size: 20px;
  padding-right: 40px;
}

.form-field textarea {
  min-height: 80px;
  resize: vertical;
}

.create-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 24px;
  margin-top: 8px;
  background: hsl(var(--foreground));
  color: hsl(var(--background));
  border: none;
  border-radius: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.create-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px hsl(var(--foreground) / 0.25);
}

.create-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.create-btn .spinner-icon {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ============================================
   VOICES SECTION
   ============================================ */

.voices-section {
  margin-top: 0;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
}

.voice-count {
  background: hsl(var(--secondary));
  color: hsl(var(--muted-foreground));
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 9999px;
}

.section-info {
  display: flex;
  align-items: center;
}

.info-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: hsl(var(--muted-foreground));
  padding: 6px 12px;
  background: hsl(var(--secondary) / 0.5);
  border-radius: 9999px;
}

/* Voices Grid */
.voices-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

/* ============================================
   VOICE CARD
   ============================================ */

.voice-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: 1rem;
  padding: 20px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.voice-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, hsl(var(--foreground) / 0.2), hsl(var(--foreground) / 0.05));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.voice-card:hover {
  transform: translateY(-4px);
  border-color: hsl(var(--foreground) / 0.15);
  box-shadow: 0 16px 40px -12px hsl(0 0% 0% / 0.15);
}

.voice-card:hover::before {
  opacity: 1;
}

.voice-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.voice-card-name {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: hsl(var(--foreground));
}

.voice-card-actions-header {
  display: flex;
  gap: 6px;
}

.voice-play-btn,
.voice-delete-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: hsl(var(--secondary));
  border: none;
  border-radius: 0.625rem;
  cursor: pointer;
  color: hsl(var(--muted-foreground));
  transition: all 0.2s ease;
}

.voice-play-btn:hover {
  background: hsl(var(--foreground));
  color: hsl(var(--background));
}

.voice-play-btn.playing {
  background: hsl(var(--foreground));
  color: hsl(var(--background));
}

.voice-delete-btn:hover {
  background: hsl(0 70% 50%);
  color: white;
}

.voice-card-description {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  margin: 0 0 12px 0;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Voice ID */
.voice-card-id {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: hsl(var(--background));
  border-radius: 0.625rem;
  margin-bottom: 12px;
}

.voice-id-content {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  flex: 1;
}

.voice-id-label {
  font-size: 0.7rem;
  color: hsl(var(--muted-foreground));
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.voice-id-content code {
  font-size: 0.75rem;
  font-family: ui-monospace, 'SF Mono', monospace;
  color: hsl(var(--foreground) / 0.7);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-id-copy-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  color: hsl(var(--muted-foreground));
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.voice-id-copy-btn:hover {
  background: hsl(var(--secondary));
  color: hsl(var(--foreground));
}

/* Voice Labels */
.voice-card-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.voice-label {
  font-size: 0.7rem;
  font-weight: 500;
  padding: 4px 10px;
  background: hsl(var(--secondary));
  color: hsl(var(--muted-foreground));
  border-radius: 9999px;
  text-transform: capitalize;
}

.voice-label-advanced {
  background: linear-gradient(135deg, hsl(var(--foreground) / 0.1), hsl(var(--foreground) / 0.05));
  color: hsl(var(--foreground) / 0.8);
}

/* Use Voice Button */
.voice-card-actions {
  display: flex;
}

.use-voice-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1;
  padding: 12px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  background: hsl(var(--foreground));
  color: hsl(var(--background));
  border: none;
  border-radius: 0.625rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.use-voice-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px hsl(var(--foreground) / 0.2);
}

/* ============================================
   LOADING & EMPTY STATES
   ============================================ */

.loading-state,
.empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
  color: hsl(var(--muted-foreground));
  background: hsl(var(--card));
  border: 1px dashed hsl(var(--border));
  border-radius: 1rem;
}

.loading-state .spinner {
  width: 40px;
  height: 40px;
  border: 3px solid hsl(var(--border));
  border-top-color: hsl(var(--foreground));
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

.empty-state svg {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  opacity: 0.3;
}

.empty-state h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
  font-weight: 600;
  color: hsl(var(--foreground));
}

.empty-state p {
  margin: 0;
  font-size: 0.9rem;
  max-width: 280px;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 640px) {
  .custom-voices-page {
    padding: 0 16px 32px;
  }
  
  .create-voice-hero {
    padding: 32px 20px;
  }
  
  .hero-icon {
    width: 64px;
    height: 64px;
  }
  
  .hero-icon svg {
    width: 32px;
    height: 32px;
  }
  
  .create-voice-hero h2 {
    font-size: 1.5rem;
  }
  
  .upload-label {
    padding: 32px 16px;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .voices-grid {
    grid-template-columns: 1fr;
  }
  
  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ============================================
   CONFIRM DIALOG
   ============================================ */

.confirm-dialog-overlay {
  position: fixed;
  inset: 0;
  background: hsl(0 0% 0% / 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

.confirm-dialog-overlay.active {
  opacity: 1;
  visibility: visible;
}

.confirm-dialog {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: 1rem;
  padding: 32px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: 0 24px 48px -12px hsl(0 0% 0% / 0.3);
  transform: scale(0.9) translateY(20px);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.confirm-dialog-overlay.active .confirm-dialog {
  transform: scale(1) translateY(0);
}

.confirm-dialog-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  background: hsl(0 70% 50% / 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: hsl(0 70% 50%);
}

.confirm-dialog-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: hsl(var(--foreground));
  margin: 0 0 12px;
}

.confirm-dialog-message {
  font-size: 0.9rem;
  color: hsl(var(--muted-foreground));
  margin: 0 0 28px;
  line-height: 1.5;
}

.confirm-dialog-actions {
  display: flex;
  gap: 12px;
}

.confirm-dialog-btn {
  flex: 1;
  padding: 12px 20px;
  border-radius: 0.625rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.confirm-dialog-cancel {
  background: hsl(var(--secondary));
  color: hsl(var(--foreground));
}

.confirm-dialog-cancel:hover {
  background: hsl(var(--muted));
}

.confirm-dialog-delete {
  background: hsl(0 70% 50%);
  color: white;
}

.confirm-dialog-delete:hover {
  background: hsl(0 70% 45%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px hsl(0 70% 50% / 0.3);
}

/* Premium Upgrade Modal (Copied from tts.css for consistency) */
.premium-upgrade-modal {
  background: hsl(var(--background));
  border-radius: 1.25rem;
  padding: 2rem;
  max-width: 380px;
  width: 90vw;
  text-align: center;
  box-shadow: 0 25px 60px -12px hsl(0 0% 0% / 0.25);
}

.premium-upgrade-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 1.25rem;
  background: linear-gradient(135deg, hsl(45, 100%, 50%) 0%, hsl(35, 100%, 55%) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 8px 24px hsl(45 100% 50% / 0.3);
}

.premium-upgrade-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: hsl(var(--foreground));
  margin-bottom: 0.5rem;
}

.premium-upgrade-text {
  font-size: 0.9rem;
  color: hsl(var(--muted-foreground));
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.premium-upgrade-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.premium-upgrade-actions .btn-primary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
