/* Speech-to-Text Styles */

.input-with-mic {
    position: relative;
    display: flex;
    align-items: stretch;
    width: 100%;
}

.input-with-mic input,
.input-with-mic textarea {
    flex: 1;
    padding-right: 50px !important;
    border-radius: 12px !important;
}

.mic-button {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.mic-button:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5);
}

.mic-button:active {
    transform: translateY(-50%) scale(0.95);
}

.mic-button i {
    color: white;
    font-size: 16px;
}

.mic-button.recording {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    animation: pulse 1.5s ease-in-out infinite;
}

.mic-button.processing {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    cursor: not-allowed;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(245, 87, 108, 0.3);
    }
    50% {
        box-shadow: 0 4px 16px rgba(245, 87, 108, 0.8);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* Adjust for textareas */
.input-with-mic:has(textarea) .mic-button {
    top: 20px;
    transform: translateY(0);
}

.input-with-mic:has(textarea) .mic-button:hover {
    transform: translateY(0) scale(1.1);
}

.input-with-mic:has(textarea) .mic-button:active {
    transform: translateY(0) scale(0.95);
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .mic-button {
        width: 32px;
        height: 32px;
        right: 6px;
    }

    .mic-button i {
        font-size: 14px;
    }

    .input-with-mic input,
    .input-with-mic textarea {
        padding-right: 45px !important;
    }
}

/* Ensure proper stacking in forms */
.form-group {
    position: relative;
}

.form-group .input-with-mic {
    width: 100%;
}

/* Accessibility improvements */
.mic-button:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.mic-button:focus:not(:focus-visible) {
    outline: none;
}

/* Dark mode support (if needed) */
@media (prefers-color-scheme: dark) {
    .mic-button {
        box-shadow: 0 2px 8px rgba(102, 126, 234, 0.5);
    }

    .mic-button:hover {
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.7);
    }
}
