/* Better Messages Speech Recognition Styles */
.bm-mic-button {
    
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgb(0, 124, 186);
    font-size: 16px;
    transition: all 0.3s ease;
    
    position: relative;
    outline: none;
    margin-left: 8px;
    flex-shrink: 0;
}

.bm-mic-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(115, 103, 240, 0.4);    
}

.bm-mic-button:active {
    transform: translateY(0);
}

.bm-mic-button.listening {
    background: #ff9f43;
    animation: bm-pulse 1.5s ease-in-out infinite both;
}

.bm-mic-button.listening:hover {
    background: #ff8e24;
}

.bm-mic-button:disabled {
    background: #b8b8b8;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.bm-mic-button:disabled:hover {
    transform: none;
    box-shadow: none;
}

.bm-speech-status {
    margin-left: 10px;
    padding: 4px 8px;
    background: rgba(115, 103, 240, 0.1);
    border-radius: 12px;
    font-size: 12px;
    color: #7367f0;
    display: none;
}

.bm-speech-status.listening {
    display: inline-block;
    animation: bm-status-pulse 2s ease-in-out infinite;
}

.bm-speech-error {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #ea5455;
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(234, 84, 85, 0.3);
    z-index: 10000;
    display: none;
    max-width: 300px;
    font-size: 14px;
}

.bm-speech-error.show {
    display: block;
    animation: bm-slide-in 0.3s ease-out;
}

@keyframes bm-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 159, 67, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 159, 67, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 159, 67, 0);
    }
}

@keyframes bm-status-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@keyframes bm-slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Адаптивность */
@media (max-width: 768px) {
    .bm-mic-button {
        width: 36px;
        height: 36px;
        font-size: 14px;
        margin-left: 6px;
    }
}

/* Стили для интеграции с Better Messages */
.bm-speech-container {
    display: inline-flex;
    align-items: center;
}

/* Позиционирование в разных версиях Better Messages */
.better-messages-input-container .bm-speech-container {
    display: flex;
    align-items: center;
}

.bp-messages-wrap .bm-speech-container {
    margin: 0 5px;
}