.speech-to-text-component {
    margin-bottom: 1rem;
}

.speech-to-text-component textarea {
    padding-right: 55px !important; /* Add extra padding on the right for the mic button */
    min-height: 100px !important; /* Ensure minimum height to prevent microphone overlap */
    resize: vertical !important; /* Allow vertical resizing only */
    /* Other textarea styles now come from the unified styling in radzen-override.css */
}

.speech-to-text-component .mic-button-container {
    position: absolute;
    bottom: 10px;
    right: 10px;
}

/* Move the microphone icon when scrollbar appears */
.speech-to-text-component .position-relative:has(textarea::-webkit-scrollbar-thumb) .mic-button-container,
.speech-to-text-component .position-relative textarea[style*="overflow: auto"] ~ .mic-button-container,
.speech-to-text-component .position-relative textarea[style*="overflow-y: auto"] ~ .mic-button-container {
    right: 26px; /* Move further from right edge when scrollbar is present */
}

.speech-to-text-component .text-end {
    text-align: right;
}

.speech-to-text-component .d-block {
    display: block;
}

.speech-to-text-component .transcription-info {
    margin-top: 0px;
    min-height: 0;
    height: 0;
    overflow: hidden;
}

.speech-to-text-component .streaming-text {
    text-align: right;
    font-style: italic;
    min-height: 0;
    height: auto;
}

/* Expand the info area when there's content */
.speech-to-text-component .streaming-text:not(:empty) {
    margin-top: 4px;
    height: auto;
    min-height: 1.5em;
}

.speech-to-text-component .transcription-info:has(.streaming-text span) {
    height: auto;
    margin-top: 4px;
}

.speech-to-text-component .logprob-info {
    font-size: 0.9em;
    padding: 5px 0;
    min-height: 1.5em;
    overflow-x: auto;
    white-space: nowrap;
}

.speech-to-text-component .btn-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    text-align: center;
    padding: 0;
    line-height: 40px;
}

.speech-to-text-component .mic-recording {
    background-color: #dc3545;
    color: white;
    animation: pulse 1.5s infinite;
}

.speech-to-text-component .mic-available {
    background-color: #28a745;
    color: white;
}

.speech-to-text-component .mic-disabled {
    background-color: #6c757d;
    color: white;
    opacity: 0.6;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }
    
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);
    }
    
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    }
}