/**
 * Voice Design Styles
 * Styles for voice cloning/design functionality
 */

/* Voice Mode Button */
.voice-mode-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 9999px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.voice-mode-btn.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.voice-mode-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-color);
    background: rgba(255, 255, 255, 0.05);
}

/* Voice Design View */
.voice-design-view {
    width: 100%;
    max-width: 768px;
    margin: 48px auto 80px;
    padding: 0 16px;
}

.voice-design-container {
    position: relative;
    border-radius: 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* Voice Tabs */
.voice-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.voice-tab {
    flex: 1;
    padding: 16px;
    background: transparent;
    color: var(--text-tertiary);
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.voice-tab:hover {
    color: var(--text-secondary);
}

.voice-tab.active {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

/* Voice Content */
.voice-content {
    padding: 24px;
}

.voice-mode-content {
    min-height: 160px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Audio Input Container */
.audio-input-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* File Upload Zone */
.file-upload-zone {
    border: 2px dashed #3f3f46;
    border-radius: 12px;
    padding: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 200px;
}

.file-upload-zone:hover {
    border-color: #52525b;
    background: rgba(39, 39, 42, 0.3);
}

/* Audio Record Zone */
.audio-record-zone {
    border: 2px dashed #3f3f46;
    border-radius: 12px;
    padding: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 200px;
}

.audio-record-zone:hover {
    border-color: #52525b;
    background: rgba(39, 39, 42, 0.3);
}

.record-icon {
    color: #ef4444;
    margin-bottom: 12px;
}

.record-idle,
.record-recording,
.record-loading,
.record-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.record-loading .spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 12px;
}

.recording-indicator {
    width: 32px;
    height: 32px;
    background: #ef4444;
    border-radius: 50%;
    margin-bottom: 12px;
    animation: pulse-red 1.5s ease-in-out infinite;
}

@keyframes pulse-red {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.1); }
}

.record-stop-btn {
    margin-top: 12px;
    padding: 8px 24px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
}

.record-stop-btn:hover {
    background: #dc2626;
}

.upload-icon {
    color: #52525b;
    margin-bottom: 12px;
}

.upload-text {
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 4px;
}

.upload-hint {
    color: var(--text-tertiary);
    font-size: 12px;
}

/* Voice Description Input */
.voice-description-input {
    width: 100%;
    height: 140px;
    background: rgba(39, 39, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px;
    color: white;
    font-size: 14px;
    font-weight: 300;
    line-height: 1.5;
    resize: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.voice-description-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.2);
}

.voice-description-input::placeholder {
    color: #52525b;
}

/* Voice Action Bar */
.voice-action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 24px;
    gap: 12px;
}

.voice-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #18181b;
    border-radius: 9999px;
    padding: 4px 16px 4px 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.preview-play-btn {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    position: relative;
}

.preview-play-btn:hover {
    color: #22c55e;
}

.preview-play-btn.loading svg {
    opacity: 0.3;
}

.preview-play-btn.loading::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.waveform-preview {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 32px;
}

.waveform-bar {
    width: 4px;
    background: #52525b;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.waveform-bar.playing {
    background: #22c55e;
    animation: pulse 0.8s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.preview-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-left: 8px;
}

.preview-save-btn {
    background: #22c55e;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    margin-left: 12px;
    transition: background 0.2s;
}

.preview-save-btn:hover {
    background: #16a34a;
}

.voice-action-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
}

.voice-api-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #27272a;
    color: white;
    border: 1px solid #3f3f46;
    border-radius: 9999px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.voice-api-btn:hover {
    background: #3f3f46;
}

.voice-generate-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: white;
    color: black;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.voice-generate-btn:hover {
    background: #e6e6e6;
}

.voice-generate-btn:disabled {
    opacity: 0.7;
    cursor: wait;
}

/* Upload States */
.upload-idle,
.upload-loading,
.upload-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.upload-loading .spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 12px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.upload-success .success-icon {
    color: #22c55e;
    margin-bottom: 12px;
}

.upload-filename {
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 4px;
}

.upload-file-id {
    color: var(--text-tertiary);
    font-size: 12px;
    font-family: 'Consolas', monospace;
}

/* Voice Slots Section */
.voice-slots-section {
    margin-top: 32px;
    padding: 24px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.voice-slots-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.voice-slots-header h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.slots-counter {
    font-size: 14px;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 12px;
    border-radius: 12px;
}

.voice-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.voice-slot-card {
    background: #18181b;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.slot-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.slot-play-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #22c55e;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    transition: all 0.2s;
}

.slot-play-btn:hover {
    background: #16a34a;
}

.slot-info {
    flex: 1;
    overflow: hidden;
}

.slot-filename {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.slot-date {
    font-size: 10px;
    color: var(--text-secondary);
}

.slot-voice-id {
    font-size: 9px;
    color: var(--text-tertiary);
    font-family: 'Consolas', monospace;
    word-break: break-all;
}

.slot-preview-text {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.modal-btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.modal-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Modal Styles */
.modal-info {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modal-info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.modal-info-item label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.modal-info-item code {
    background: rgba(39, 39, 42, 0.5);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-primary);
    font-family: 'Consolas', monospace;
    word-break: break-all;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
}

.modal-btn {
    background: white;
    color: black;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.modal-btn:hover {
    background: #e6e6e6;
}

/* Responsive */
@media (max-width: 768px) {
    .header-actions .voice-mode-btn {
        display: none;
    }

    .audio-input-container {
        grid-template-columns: 1fr;
    }

    .voice-action-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .voice-preview {
        justify-content: center;
    }

    .voice-action-buttons {
        flex-direction: column;
    }

    .voice-api-btn,
    .voice-generate-btn {
        width: 100%;
        justify-content: center;
    }
}
