/**
 * VoiceInput Component Styles
 * Voice dictation microphone button for inputs/textareas
 */

/* Wrapper for positioning the button */
.voice-input-wrapper {
    position: relative;
    display: inline-block;
}

/* Ensure wrapped inputs have padding for the button */
.voice-input-wrapper > input,
.voice-input-wrapper > textarea {
    padding-right: 36px !important;
}

/* The microphone button */
.voice-input-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    padding: 3px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, color 0.2s;
    z-index: 10;
    color: #6c757d;
}

.voice-input-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: #495057;
}

.voice-input-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.25);
}

.voice-input-btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* Button SVG sizing */
.voice-input-btn svg {
    width: 18px;
    height: 18px;
}

/* Recording state - red pulsing */
.voice-input-btn.voice-input-recording {
    color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
}

.voice-input-btn.voice-input-recording:hover {
    background-color: rgba(220, 53, 69, 0.2);
}

/* Processing state - blue spinner */
.voice-input-btn.voice-input-processing {
    color: #0d6efd;
}

/* For textareas, position button at top-right */
.voice-input-wrapper > textarea + .voice-input-btn {
    top: 8px;
}

/* Adjustments for Bootstrap form-control sizes */
.voice-input-wrapper > .form-control-sm + .voice-input-btn {
    top: 4px;
    right: 6px;
    width: 20px;
    height: 20px;
    padding: 2px;
}

.voice-input-wrapper > .form-control-sm + .voice-input-btn svg {
    width: 14px;
    height: 14px;
}

.voice-input-wrapper > .form-control-lg + .voice-input-btn {
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    padding: 4px;
}

.voice-input-wrapper > .form-control-lg + .voice-input-btn svg {
    width: 20px;
    height: 20px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .voice-input-btn {
        color: #adb5bd;
    }

    .voice-input-btn:hover {
        background-color: rgba(255, 255, 255, 0.1);
        color: var(--mv-border-color);
    }
}

/* For use with Bootstrap dark theme class */
[data-bs-theme="dark"] .voice-input-btn {
    color: #adb5bd;
}

[data-bs-theme="dark"] .voice-input-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--mv-border-color);
}
