/* TTS Interface Styles */

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

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

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

.tts-input {
    display: flex;
}

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

/* Input Section */
.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);
}

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

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

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

.text-input::placeholder {
    color: var(--text-muted);
}

/* Voice Selection */
.voice-selection h4 {
    margin: 0 0 16px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.voice-options {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.voice-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.25s ease;
    color: var(--text-primary);
    background: rgba(246, 249, 255, 0.86);
}

.voice-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
    background: rgba(237, 242, 255, 0.96);
    box-shadow: 0 14px 28px rgba(148, 163, 184, 0.22);
}

.voice-card.active {
    border-color: rgba(99, 102, 241, 0.55);
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 18px 34px rgba(99, 102, 241, 0.28);
}

.voice-avatar {
    font-size: 32px;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 246, 0.12);
    border-radius: var(--radius-md);
}

.voice-card.active .voice-avatar {
    background: rgba(255, 255, 255, 0.2);
}

.voice-info {
    flex: 1;
}

.voice-info h5 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: inherit;
}

.voice-info p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.85;
    color: inherit;
}

.preview-button {
    padding: 8px 16px;
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.28);
    border-radius: 999px;
    color: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.voice-card:not(.active) .preview-button {
    color: var(--accent-primary);
}

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

.voice-card.active .preview-button {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.45);
}

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

/* Generation Controls */
.generation-controls {
    text-align: center;
}

.generate-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2.25rem;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: 0.9rem;
    font-size: 1.08rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    margin-bottom: 1rem;
    min-width: 210px;
    box-shadow: var(--button-shadow);
}

.generate-button:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 28px 50px rgba(99, 102, 241, 0.28);
}

.generate-button:disabled {
    background: rgba(148, 163, 184, 0.22);
    color: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.quick-examples {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: center;
    margin-top: 16px;
}

.examples-label {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

.example-button {
    padding: 6px 14px;
    background: rgba(37, 99, 235, 0.08);
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-radius: 999px;
    color: #1d4ed8;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.example-button:hover {
    background: rgba(37, 99, 235, 0.18);
    color: var(--accent-primary);
    border-color: rgba(37, 99, 235, 0.35);
}

/* Audio Result */
.audio-result {
    min-height: 8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: rgba(241, 245, 255, 0.95);
    margin-bottom: 24px;
}

/* Audio Player */
.audio-player {
    padding: 24px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.92);
    margin-bottom: 24px;
    box-shadow: 0 16px 32px rgba(148, 163, 184, 0.2);
}

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

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

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

.action-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(59, 130, 246, 0.28);
    background: rgba(59, 130, 246, 0.12);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    min-width: 110px;
    justify-content: center;
}

.action-button:hover {
    background: var(--accent-gradient);
    color: white;
    border-color: transparent;
    box-shadow: 0 18px 32px rgba(99, 102, 241, 0.25);
    transform: translateY(-2px);
}

.action-button:disabled {
    background: rgba(148, 163, 184, 0.15);
    color: var(--text-muted);
    border-color: var(--border-color);
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.control-button {
    width: 48px;
    height: 48px;
    background: var(--accent-gradient);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 18px 34px rgba(99, 102, 241, 0.28);
}

.control-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 38px rgba(99, 102, 241, 0.32);
}

.progress-container {
    flex: 1;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(203, 213, 225, 0.6);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 8px;
    cursor: pointer;
}

.progress-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: var(--radius-sm);
    transition: width 0.1s;
    width: 0%;
}

.time-display {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.player-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(148, 163, 184, 0.3);
}

.output-cost-note {
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-muted);
}

.generation-status {
    text-align: center;
    color: var(--text-muted);
    font-weight: 500;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .tts-interface {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .tts-input, .tts-output {
        padding: 24px;
    }
}

@media (max-width: 768px) {
    .tts-interface {
        margin-top: 24px;
        gap: 16px;
    }

    .tts-input, .tts-output {
        padding: 20px;
    }

    .model-header {
        text-align: center;
    }

    .page-title {
        font-size: 28px;
    }

    .page-description {
        font-size: 15px;
    }

    .input-header {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }

    .input-header h3 {
        font-size: 18px;
    }

    .char-counter {
        font-size: 13px;
    }

    .text-input {
        min-height: 120px;
        font-size: 15px;
        padding: 14px;
    }

    .voice-selection h4 {
        font-size: 16px;
        margin-bottom: 14px;
    }

    .voice-options {
        gap: 12px;
    }

    .voice-card {
        flex-direction: row;
        text-align: left;
        gap: 12px;
        padding: 14px;
    }

    .voice-avatar {
        font-size: 28px;
        width: 48px;
        height: 48px;
        flex-shrink: 0;
    }

    .voice-info {
        order: 0;
    }

    .voice-info h5 {
        font-size: 15px;
    }

    .voice-info p {
        font-size: 13px;
    }

    .preview-button {
        padding: 8px 14px;
        font-size: 13px;
        min-width: auto;
    }

    .generation-controls {
        margin-top: 20px;
    }

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

    .quick-examples {
        flex-direction: column;
        gap: 10px;
        margin-top: 14px;
    }

    .examples-label {
        font-size: 13px;
        width: 100%;
    }

    .example-button {
        font-size: 13px;
        padding: 8px 12px;
        width: 100%;
    }

    /* Output section mobile improvements */
    .output-header h3 {
        font-size: 18px;
    }

    .audio-player {
        padding: 18px;
    }

    .player-controls {
        flex-direction: column;
        gap: 14px;
        align-items: stretch;
    }

    .play-button {
        width: 100%;
        font-size: 16px;
        padding: 14px;
    }

    .progress-container {
        width: 100%;
    }

    .progress-bar {
        height: 6px;
    }

    .time-display {
        font-size: 12px;
        margin-top: 6px;
    }

    .player-info {
        grid-template-columns: 1fr;
        gap: 12px;
        padding-top: 14px;
    }

    .info-item {
        font-size: 13px;
    }

    .info-label {
        font-size: 12px;
    }

    .info-value {
        font-size: 14px;
    }

    .output-actions {
        flex-direction: column;
        gap: 10px;
    }

    .download-button, .clear-button {
        width: 100%;
        font-size: 14px;
        padding: 12px 20px;
    }

    .output-cost-note {
        font-size: 12px;
        text-align: center;
    }

    .generation-status {
        font-size: 14px;
    }
}

/* Animation for loading states */
@keyframes shimmer {
    0% { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}

.loading-shimmer {
    background: linear-gradient(90deg, rgba(148, 163, 184, 0.18) 25%, rgba(148, 163, 184, 0.3) 50%, rgba(148, 163, 184, 0.18) 75%);
    background-size: 200px 100%;
    animation: shimmer 1.6s infinite;
}
