/* Voice Search Styles */

.voice-search-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.voice-search-container h1 {
  font-size: 2rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 8px;
}

.voice-search-subtitle {
  color: var(--color-text-muted);
  margin-bottom: 24px;
  font-size: 1rem;
}

/* Search Form Card */
.voice-search-form-card {
  background: var(--color-white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.voice-search-form-body {
  padding: 24px;
}

/* Search Grid */
.voice-search-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.voice-search-field-full {
  grid-column: 1 / -1;
}

.voice-search-field .form-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: var(--color-text-primary);
  font-size: var(--font-size-sm);
}

.voice-search-field .form-input,
.voice-search-field .form-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color-input);
  border-radius: var(--radius-base);
  font-size: var(--font-size-sm);
  background: var(--color-white);
  color: var(--color-text-primary);
  transition: border-color 0.2s ease;
}

.voice-search-field .form-input:focus,
.voice-search-field .form-select:focus {
  outline: none;
  border-color: var(--border-color-input-focus);
  box-shadow: var(--shadow-focus-primary);
}

.voice-search-field .form-input::placeholder {
  color: var(--color-text-muted);
}

/* Search Buttons */
.voice-search-buttons {
  display: flex;
  gap: 12px;
}

.voice-search-buttons .btn {
  padding: 10px 16px;
  border-radius: var(--radius-base);
  font-size: var(--font-size-sm);
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.voice-search-buttons .btn-primary {
  background: var(--main-a-color);
  color: white;
  border-color: var(--main-a-color);
}

.voice-search-buttons .btn-primary:hover {
  background: var(--main-hover-color);
  border-color: var(--main-hover-color);
}

.voice-search-buttons .btn-secondary {
  background: var(--color-white);
  color: var(--color-text-primary);
  border-color: var(--border-color);
}

.voice-search-buttons .btn-secondary:hover {
  background: #e9ecef;
  color: #333;
  border-color: #adb5bd;
}

/* Results Section */
.voice-search-results-header {
  margin-bottom: 16px;
}

.voice-search-results-header h4 {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0;
}

.voice-search-count {
  color: var(--color-text-muted);
  font-weight: 400;
}

/* Voice Cards Grid */
.voice-search-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.voice-card {
  background: var(--color-white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease;
  height: fit-content;
}

.voice-card:hover {
  box-shadow: var(--shadow-md);
}

.voice-card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  height: 100%;
}

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

.voice-card-title {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0;
  flex: 1;
  margin-right: 12px;
}

.voice-play-button {
  background: var(--main-a-color);
  color: white;
  border: none;
  border-radius: var(--radius-circle);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.75rem;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.voice-play-button:hover {
  background: #1a2532;
  transform: scale(1.05);
}

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

.voice-label {
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: capitalize;
}

.voice-label-gender {
  background: var(--color-secondary);
  color: white;
}

.voice-label-age {
  background: var(--color-info);
  color: white;
}

.voice-label-accent {
  background: var(--color-success);
  color: white;
}

.voice-label-descriptive {
  background: var(--color-warning);
  color: var(--color-dark);
}

/* Voice Use Case */
.voice-use-case {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  margin: 0 0 12px 0;
}

/* Voice Description */
.voice-description {
  color: var(--color-text-primary);
  font-size: var(--font-size-sm);
  line-height: 1.5;
  margin: 0 0 16px 0;
  flex: 1;
}

/* Voice Card Actions */
.voice-card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.voice-card-actions .btn {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  flex: 1;
  text-align: center;
  display: inline-block;
}

.voice-card-actions .btn-outline {
  background: transparent;
  color: var(--main-a-color);
  border: 1px solid var(--main-a-color);
}

.voice-card-actions .btn-outline:hover {
  background: var(--main-a-color);
  color: white;
}

/* Empty State */
.voice-search-empty {
  background: var(--alert-info-bg);
  color: var(--alert-info-text);
  padding: 16px;
  border-radius: var(--radius-base);
  text-align: center;
  font-size: var(--font-size-sm);
  border: 1px solid var(--alert-info-border);
}

/* Responsive Design */
@media (max-width: 768px) {
  .voice-search-container {
    padding: 16px;
  }
  
  .voice-search-grid {
    grid-template-columns: 1fr;
  }
  
  .voice-search-results {
    grid-template-columns: 1fr;
  }
  
  .voice-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .voice-card-title {
    margin-right: 0;
  }
  
  .voice-card-actions {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .voice-search-container h1 {
    font-size: 1.5rem;
  }

  .voice-search-form-body {
    padding: 16px;
  }

  .voice-card-body {
    padding: 16px;
  }

  .voice-search-buttons {
    flex-direction: column;
  }
}

/* Voice Designer Styles */
.voice-designer-container {
  max-width: 1400px;
  margin: 2rem auto;
  padding: 0 1rem;
}

@media (min-width: 768px) {
  .voice-designer-container {
    padding: 0 3rem;
  }
}

@media (min-width: 1200px) {
  .voice-designer-container {
    padding: 0 4rem;
  }
}

.voice-designer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.voice-designer-title {
  font-size: 2.5rem;
  margin-bottom: 0.25rem;
  color: #1a1a1a;
}

.voice-designer-subtitle {
  color: #666;
  font-size: 0.875rem;
  margin: 0;
}

.voice-current-badge {
  padding: 0.75rem 1rem;
  background: #e7f3ff;
  border: 1px solid #0d6efd;
  border-radius: 8px;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.voice-current-badge strong {
  color: #004085;
}

.voice-current-badge code {
  background: #ffffff;
  color: #0d6efd;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  border: 1px solid #0d6efd;
}

.btn-outline-light {
  border: 1px solid #dee2e6;
  color: #333;
  background: #ffffff;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.btn-outline-light:hover {
  background: #f8f9fa;
  border-color: #adb5bd;
  color: #1a1a1a;
}

.voice-section {
  margin-bottom: 3rem;
}

.voice-section-title {
  margin-bottom: 0.5rem;
  color: #1a1a1a;
}

.voice-section-description {
  color: #666;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

/* Voice Filters */
.voice-filters {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  align-items: end;
}

.voice-filter-group {
  flex: 1;
}

.voice-filters .btn-secondary {
  background-color: var(--color-secondary);
  color: var(--color-white);
  border-color: var(--color-secondary);
}

.voice-filters .btn-secondary:hover {
  background-color: #5c636a;
  color: #fff;
  border-color: #565e64;
}

.voice-filter-label {
  display: block;
  color: #666;
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.voice-filter-select {
  width: 100%;
  padding: 0.5rem 2rem 0.5rem 0.5rem;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  background-color: #ffffff;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 1em;
  color: #333;
  appearance: none;
}

.voice-filter-select option {
  background: #ffffff;
  color: #333;
}

/* Voice Table */
.voice-table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  overflow: hidden;
}

.voice-table thead {
  background: #f8f9fa;
  border-bottom: 2px solid #dee2e6;
}

.voice-table th {
  padding: 1rem;
  text-align: left;
  color: #1a1a1a;
  font-weight: 600;
}

/* Column widths for better distribution */
.voice-table th:nth-child(1),
.voice-table td:nth-child(1) {
  width: 18%;
}

.voice-table th:nth-child(2),
.voice-table td:nth-child(2) {
  width: 12%;
}

.voice-table th:nth-child(3),
.voice-table td:nth-child(3) {
  width: 15%;
}

.voice-table th:nth-child(4),
.voice-table td:nth-child(4) {
  width: 13%;
}

.voice-table th:nth-child(5),
.voice-table td:nth-child(5) {
  width: 13%;
}

.voice-table th:nth-child(6),
.voice-table td:nth-child(6) {
  width: 8%;
  text-align: center;
}

.voice-table th:nth-child(7),
.voice-table td:nth-child(7) {
  width: 21%;
  text-align: center;
}

.voice-table td {
  padding: 1rem;
  border-bottom: 1px solid #dee2e6;
}

.voice-table tbody tr[data-active="true"] {
  background: rgba(13, 110, 253, 0.1);
}

.voice-table-name {
  color: #1a1a1a;
}

.voice-table-badge {
  display: inline-block;
  background: #e7f3ff;
  color: #004085;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.875rem;
}

.voice-table-empty {
  color: #999;
  font-size: 0.875rem;
}

.voice-table-active-badge {
  display: inline-block;
  background: #0d6efd;
  color: white;
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  margin-left: 0.5rem;
}

.voice-table-category {
  color: #666;
  font-size: 0.875rem;
}

.voice-table-preview audio {
  height: 32px;
}

.voice-table-no-preview {
  color: #999;
  font-size: 0.875rem;
}

.voice-table-action {
  text-align: center;
}

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

.custom-voices-empty {
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 3rem;
  text-align: center;
  background: #f8f9fa;
}

/* Dialogue Samples */
.dialogue-samples {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dialogue-sample-item {
  background: #ffffff;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 1rem;
  transition: background 0.2s ease;
}

.dialogue-sample-item:hover {
  background: #f8f9fa;
}

.dialogue-sample-content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.dialogue-sample-text {
  color: #1a1a1a;
  font-size: 0.95rem;
  line-height: 1.5;
}

.dialogue-sample-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.dialogue-sample-scene {
  color: #666;
  font-size: 0.875rem;
}

.text-muted {
  color: #999;
  font-size: 0.875rem;
}

/* Dark Theme Overrides */
[data-theme="dark"] .voice-designer-title {
  color: #fff;
}

[data-theme="dark"] .voice-designer-subtitle {
  color: #999;
}

[data-theme="dark"] .voice-current-badge {
  background: rgba(13, 110, 253, 0.15);
  border: 1px solid rgba(13, 110, 253, 0.3);
}

[data-theme="dark"] .voice-current-badge strong {
  color: #fff;
}

[data-theme="dark"] .voice-current-badge code {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .btn-outline-light {
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  background: transparent;
}

[data-theme="dark"] .btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
}

[data-theme="dark"] .voice-section-title {
  color: #fff;
}

[data-theme="dark"] .voice-section-description {
  color: #999;
}

[data-theme="dark"] .voice-filter-label {
  color: #aaa;
}

[data-theme="dark"] .voice-filter-select {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background-color: rgba(255, 255, 255, 0.1);
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 1em;
  color: #fff;
}

[data-theme="dark"] .voice-filter-select option {
  background: #2d3748;
  color: #fff;
}

[data-theme="dark"] .voice-table {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .voice-table thead {
  background: rgba(255, 255, 255, 0.1);
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .voice-table th {
  color: #fff;
}

[data-theme="dark"] .voice-table td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .voice-table tbody tr[data-active="true"] {
  background: rgba(13, 110, 253, 0.2);
}

[data-theme="dark"] .voice-table-name {
  color: #fff;
}

[data-theme="dark"] .voice-table-badge {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

[data-theme="dark"] .voice-table-empty {
  color: #666;
}

[data-theme="dark"] .voice-table-category {
  color: #aaa;
}

[data-theme="dark"] .dialogue-sample-item {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .dialogue-sample-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .dialogue-sample-text {
  color: #fff;
}

[data-theme="dark"] .dialogue-sample-scene {
  color: #999;
}

[data-theme="dark"] .text-muted {
  color: #666;
}

[data-theme="dark"] .custom-voices-empty {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .voice-play-button:hover {
  background: var(--main-hover-color);
}

[data-theme="dark"] .voice-filters .btn-secondary {
  background-color: var(--color-secondary);
  color: var(--color-white);
  border-color: var(--color-secondary);
}

[data-theme="dark"] .voice-filters .btn-secondary:hover {
  background-color: #9ca5ad;
  color: #1a1a1a;
  border-color: #9ca5ad;
}