/* ==================== Voice Clone Styles ==================== */

/* Voice Clone Container */
.voice-clone-container {
    display: none;
}

.voice-clone-container.active {
    display: block;
}

/* Clone Header */
.clone-header {
    margin-bottom: 32px;
}

.clone-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.clone-header p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Clone Card */
.clone-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
}

.clone-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
}

/* Form Elements */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.form-group input[type="text"],
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-color);
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--primary-color);
}

.preview-textarea {
    width: 100%;
    min-height: 100px;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-color);
    font-family: inherit;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s;
}

.preview-textarea:focus {
    border-color: var(--primary-color);
}

/* Clone Tabs */
.clone-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.clone-tab {
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.clone-tab:hover {
    color: var(--text-primary);
}

.clone-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* Import Options */
.import-options-container {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 16px;
}

.import-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-color);
    min-height: 220px;
    text-align: center;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.import-card:hover {
    background: var(--panel-bg);
    transform: translateY(-2px);
    border-color: var(--primary-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.import-card.upload-card {
    border: 2px dashed #c7cbd1;
    background-color: #f9fafb;
}

.import-card.upload-card:hover {
    border-color: var(--primary-color);
    background-color: #eff6ff;
}

.import-card.record-card {
    border: 2px solid #d1d5db;
    background-color: #fafbfc;
}

.import-card.record-card:hover {
    border-color: var(--primary-color);
    background-color: #f0f5ff;
}

.import-separator {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.import-icon-bg {
    width: 48px;
    height: 48px;
    background: #e0e7ff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    color: var(--primary-color);
    transition: transform 0.2s ease;
}

.import-card:hover .import-icon-bg {
    transform: scale(1.1);
}

.import-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.import-desc {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 20px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

input:checked + .toggle-slider {
    background-color: var(--primary-color);
}

input:focus + .toggle-slider {
    box-shadow: 0 0 1px var(--primary-color);
}

input:checked + .toggle-slider:before {
    transform: translateX(16px);
}

/* Preview Box */
.preview-box-container {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    background: white;
    transition: border-color 0.2s;
}

.preview-box-container:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

.preview-language-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f3f4f6;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.preview-language-tag .close-tag {
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    color: var(--text-secondary);
}

.preview-language-tag .close-tag:hover {
    color: var(--text-primary);
}

.preview-textarea-large {
    width: 100%;
    min-height: 80px;
    border: none;
    resize: none;
    outline: none;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    font-family: inherit;
    background: transparent;
    margin-bottom: 12px;
}

.preview-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-secondary);
    border-top: 1px solid #f3f4f6;
    padding-top: 12px;
}

/* Confirmation Section */
.confirmation-section {
    margin-top: 24px;
}

.checkbox-container {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    user-select: none;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: relative;
    height: 18px;
    width: 18px;
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    flex-shrink: 0;
    margin-top: 2px;
}

.checkbox-container:hover input ~ .checkmark {
    border-color: var(--primary-color);
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 6px;
    top: 2px;
    width: 4px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-text a {
    color: var(--text-secondary);
    text-decoration: underline;
}

/* Clone Bottom Bar */
.clone-bottom-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 32px;
    padding-top: 24px;
}

.voice-slots-info {
    font-size: 14px;
    color: var(--text-secondary);
}

.generate-btn-purple {
    background-color: #8b5cf6;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    box-shadow: 0 4px 6px -1px rgba(139, 92, 246, 0.2);
}

.generate-btn-purple:hover {
    background-color: #7c3aed;
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(139, 92, 246, 0.3);
}

.generate-btn-purple:disabled,
.generate-btn-purple.loading {
    background: linear-gradient(135deg, #b4adc4 0%, #9d98ab 100%) !important;
    color: #e5e3eb;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Advanced Settings */
.advanced-settings {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.settings-header {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.setting-item {
    margin-bottom: 12px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.info-icon {
    color: var(--text-secondary);
    opacity: 0.5;
}

/* Button Group */
.button-group {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-primary:disabled {
    background: var(--border-color);
    cursor: not-allowed;
}

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

.btn-secondary:hover {
    background: var(--text-secondary);
    color: white;
}

/* Loading & Messages */
.loading-spinner {
    text-align: center;
    padding: 20px;
    display: none;
}

.loading-spinner.active {
    display: block;
}

.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 12px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.message-box {
    padding: 12px;
    border-radius: 8px;
    margin-top: 12px;
    font-size: 13px;
    display: none;
}

.message-box.active {
    display: block;
}

.message-box.success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #4caf50;
}

.message-box.error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #f44336;
}

.message-box.info {
    background: #e3f2fd;
    color: #1565c0;
    border: 1px solid #2196f3;
}

/* Audio Player */
.audio-player {
    margin-top: 16px;
    display: none;
}

.audio-player.active {
    display: block;
}

.audio-player audio {
    width: 100%;
    height: 40px;
    border-radius: 8px;
}

/* Cloned Voices List */
.cloned-voices-list {
    min-height: 200px;
}

/* Info Box */
.info-box {
    background: #e0f2fe;
    border-left: 4px solid #0ea5e9;
    padding: 16px;
    border-radius: 8px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: #075985;
    font-size: 14px;
    margin-top: 20px;
}

.info-box.warning {
    background: #fffbeb;
    border-left-color: #f59e0b;
    color: #b45309;
}

.info-box-icon {
    color: #0ea5e9;
    font-size: 20px;
    flex-shrink: 0;
}

.info-box.warning .info-box-icon {
    color: #f59e0b;
}

.info-box-content p:last-child {
    margin-bottom: 0;
}

/* Preview Input Focus */
.preview-input-wrapper input:focus,
.library-filter-bar input:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

/* Disabled Nav Items */
.nav-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    filter: grayscale(100%);
}

/* ==================== New Recording Interface ==================== */
.record-interface-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.record-modal-content {
    background: white;
    width: 400px;
    padding: 40px;
    border-radius: 24px;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.record-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: all 0.2s;
}

.record-close-btn:hover {
    background: var(--panel-bg);
    color: var(--text-primary);
}

.record-timer-large {
    font-size: 48px;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    margin-bottom: 8px;
}

.record-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 32px;
}

.record-visualizer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 40px;
    margin-bottom: 40px;
}

.visualizer-bar {
    width: 4px;
    height: 4px;
    background-color: #e0e7ff;
    border-radius: 2px;
    transition: height 0.1s ease;
}

.record-visualizer.active .visualizer-bar {
    background-color: var(--primary-color);
    animation: visualize 1s ease-in-out infinite;
}

.record-visualizer.active .visualizer-bar:nth-child(odd) { animation-duration: 0.8s; }
.record-visualizer.active .visualizer-bar:nth-child(2n) { animation-duration: 1.1s; }
.record-visualizer.active .visualizer-bar:nth-child(3n) { animation-duration: 1.3s; }
.record-visualizer.active .visualizer-bar:nth-child(4n) { animation-duration: 0.9s; }

@keyframes visualize {
    0%, 100% { height: 4px; }
    50% { height: 24px; }
}

.record-action-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 4px solid #fee2e2;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    margin: 0 auto;
    padding: 0;
}

.record-action-btn:hover {
    transform: scale(1.05);
    border-color: #fecaca;
}

.stop-square {
    width: 24px;
    height: 24px;
    background-color: #ef4444;
    border-radius: 6px;
}

/* ==================== Uploaded Samples Section ==================== */
.sample-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #f8f9fc;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.sample-item:hover {
    background: #f0f2f7;
    border-color: var(--primary-color);
}

.sample-item.playing {
    background: #e0e7ff;
    border-color: var(--primary-color);
}

.sample-item.playing .sample-filename {
    color: var(--primary-color);
    font-weight: 600;
}

.sample-play-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: #6366f1;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.sample-play-btn:hover {
    background: #4f46e5;
    transform: scale(1.05);
}

.sample-play-btn.playing {
    background: #ef4444;
}

.sample-play-btn svg {
    width: 20px;
    height: 20px;
}

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

.sample-filename {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sample-meta {
    font-size: 12px;
    color: var(--text-secondary);
}

.sample-delete-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.sample-delete-btn:hover {
    background: #fee;
    border-color: #ef4444;
    color: #ef4444;
}

.sample-delete-btn svg {
    width: 16px;
    height: 16px;
}

/* ==================== Voice Name Input Styles ==================== */
#cloneName:focus,
#cloneModelSelect:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* ==================== Audition Panel ==================== */
.audition-panel {
    margin-top: 40px;
    padding: 24px;
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.audition-panel .clone-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.audition-panel .clone-header p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.audition-panel .form-group {
    margin-bottom: 16px;
}

.audition-panel label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.audition-panel textarea {
    width: 100%;
    padding: 12px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    resize: vertical;
    min-height: 100px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
}

.audition-panel textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.audition-panel textarea::placeholder {
    color: var(--text-tertiary);
}

/* ==================== Loading Indicator ==================== */
.loading-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--card-bg);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 14px;
}

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