/* CosyVoice Interface Styles */

.cosyvoice-interface {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-top: 40px;
    align-items: stretch;
}

.cosyvoice-interface.api-docs-active {
    grid-template-columns: 1fr;
    gap: 0;
}

.cosyvoice-interface.api-docs-active .cosyvoice-output {
    display: none;
}

.cosyvoice-interface.api-docs-active .cosyvoice-input {
    padding: 0;
    background: none;
    border: none;
    box-shadow: none;
}

.cosyvoice-interface.api-docs-active .cosyvoice-input > .side-tabs {
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.98) 0%, rgba(236, 243, 255, 0.92) 100%);
    border-radius: var(--radius-lg);
    padding: 28px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    max-width: 960px;
    margin: 0 auto;
}

.cosyvoice-input,
.cosyvoice-output {
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.98) 0%, rgba(236, 243, 255, 0.92) 100%);
    border-radius: var(--radius-lg);
    padding: 28px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(6px);
}

.cosyvoice-input {
    display: flex;
}

.cosyvoice-input > .side-tabs {
    flex: 1;
}

.input-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.input-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.input-header .char-counter {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

.cosyvoice-textarea {
    width: 100%;
    min-height: 8rem;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 16px;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
    font-family: inherit;
    margin-bottom: 24px;
    background-color: rgba(255, 255, 255, 0.92);
    color: var(--text-primary);
    box-shadow: inset 0 1px 2px rgba(148, 163, 184, 0.12);
}

.cosyvoice-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.16);
}

.cosyvoice-textarea--secondary {
    min-height: 5rem;
    background-color: rgba(240, 249, 255, 0.78);
}

.control-group {
    margin-bottom: 24px;
}

.control-group:last-of-type {
    margin-bottom: 0;
}

.control-group h4 {
    margin: 0 0 12px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.control-hint {
    margin: 8px 0 0;
    font-size: 14px;
    color: var(--text-muted);
}

.prompt-dropzone {
    border: 2px dashed rgba(96, 165, 250, 0.4);
    border-radius: var(--radius-md);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: center;
    background: rgba(240, 249, 255, 0.72);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.prompt-dropzone:hover,
.prompt-dropzone.is-dragover {
    border-color: rgba(59, 130, 246, 0.6);
    background: rgba(219, 234, 254, 0.9);
}

.prompt-dropzone.has-file {
    border-style: solid;
    background: rgba(219, 234, 254, 0.9);
}

.prompt-name {
    font-weight: 500;
    color: var(--text-muted);
}

.prompt-name.has-file {
    color: var(--accent-primary);
}

.dropzone-icon {
    font-size: 28px;
}

.dropzone-hint {
    font-size: 14px;
    color: var(--text-muted);
}

.clear-prompt-button {
    align-self: center;
    padding: 6px 14px;
    border-radius: 999px;
    border: none;
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
    display: none;
}

.clear-prompt-button.visible {
    display: inline-flex;
}

.example-prompts {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.example-button {
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid rgba(96, 165, 250, 0.3);
    background: rgba(59, 130, 246, 0.08);
    color: var(--accent-primary);
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
    font-size: 14px;
}

.example-button:hover {
    background: rgba(59, 130, 246, 0.18);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.16);
}

.generation-controls {
    margin-top: 32px;
    display: flex;
    justify-content: flex-start;
}

.generate-button {
    width: 100%;
    margin-top: 24px;
    padding: 16px;
    border-radius: var(--radius-md);
    border: none;
    background: var(--accent-gradient);
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.generate-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 22px 38px rgba(99, 102, 241, 0.28);
}

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

.button-icon {
    font-size: 18px;
}

.cosyvoice-output .audio-preview {
    margin-top: 24px;
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: rgba(240, 249, 255, 0.75);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cosyvoice-output audio {
    width: 100%;
}

.audio-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.audio-actions button {
    padding: 10px 18px;
    border-radius: 8px;
    border: none;
    background: rgba(59, 130, 246, 0.12);
    color: var(--accent-primary);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.audio-actions button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.audio-actions button:not(:disabled):hover {
    background: rgba(59, 130, 246, 0.22);
}

.generation-status {
    border-radius: var(--radius-md);
    padding: 14px 18px;
    font-size: 15px;
    color: var(--text-primary);
    background: rgba(219, 234, 254, 0.65);
    border: 1px solid rgba(59, 130, 246, 0.25);
}

@media (max-width: 1200px) {
    .cosyvoice-interface {
        grid-template-columns: 1fr;
    }

    .cosyvoice-output {
        order: 2;
    }

    .cosyvoice-input {
        order: 1;
    }
}
