/* Chatterbox Interface Styles */

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

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

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

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

.chatterbox-interface.api-docs-active .chatterbox-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);
}

.chatterbox-input,
.chatterbox-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);
}

.chatterbox-input {
    display: flex;
}

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

/* Playground */
.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;
}

.chatterbox-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);
}

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

.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);
}

.exaggeration-control {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: rgba(246, 249, 255, 0.86);
}

.exaggeration-control input[type="range"] {
    flex: 1;
}

.exaggeration-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--accent-primary);
    min-width: 68px;
    text-align: right;
}

.audio-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;
}

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

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

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

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

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

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

.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(59, 130, 246, 0.28);
    background: rgba(59, 130, 246, 0.08);
    color: var(--accent-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.example-button:hover {
    background: rgba(59, 130, 246, 0.18);
    border-color: rgba(59, 130, 246, 0.4);
}

.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;
}

/* Output panel */
.chatterbox-output {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.chatterbox-output .panel-header-with-history {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.chatterbox-output .panel-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatterbox-output .panel-header-with-history h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.chatterbox-output .status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-muted);
}

.generation-status {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(248, 250, 252, 0.65);
    font-size: 15px;
}

.generation-status[data-status="success"] {
    border-color: rgba(74, 222, 128, 0.45);
    background: rgba(236, 253, 245, 0.9);
    color: #15803d;
}

.generation-status[data-status="error"] {
    border-color: rgba(239, 68, 68, 0.45);
    background: rgba(254, 242, 242, 0.9);
    color: #b91c1c;
}

.audio-preview {
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: var(--radius-md);
    padding: 20px;
    background: rgba(248, 250, 252, 0.7);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.audio-preview audio {
    width: 100%;
    display: none;
}

.audio-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

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

.audio-actions button:hover {
    background: rgba(59, 130, 246, 0.22);
    transform: translateY(-1px);
}

.audio-actions button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.output-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

.summary-card {
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    background: rgba(248, 250, 252, 0.7);
}

.summary-card .label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.summary-card .value {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.code-section {
    margin-bottom: 24px;
}

.code-section:last-of-type {
    margin-bottom: 0;
}

.code-section h4 {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 600;
}

.code-block {
    position: relative;
    padding: 16px;
    background: rgba(15, 23, 42, 0.96);
    color: rgba(248, 250, 252, 0.92);
    border-radius: var(--radius-md);
    font-size: 14px;
    max-height: 320px;
    overflow: auto;
    line-height: 1.55;
}

.copy-code-btn {
    margin-top: 12px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(148, 163, 184, 0.1);
    color: rgba(15, 23, 42, 0.9);
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.copy-code-btn:hover {
    background: rgba(148, 163, 184, 0.16);
    border-color: rgba(59, 130, 246, 0.3);
}

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

@media (max-width: 640px) {
    .audio-actions {
        flex-direction: column;
    }

    .generate-button {
        font-size: 15px;
    }
}
