/* Voice Interface Optimizations */

.voice-toggle-wrapper {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 22px;
}

.toggle-switch-ui {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e2e8f0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 22px;
    height: 22px;
}

.toggle-switch-ui:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    top: 3px;
    background-color: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#tts-toggle:checked+.toggle-switch-ui {
    background-color: var(--primary-color);
}

#tts-toggle:checked+.toggle-switch-ui:before {
    transform: translateX(20px);
}

.recording {
    color: #ef4444 !important;
    animation: mic-pulse 1.5s infinite;
}

@keyframes mic-pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }

    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

.speak-btn:hover i {
    color: #ec4899 !important;
}

/* Firefox Voice States */
.voice-ready i {
    color: var(--success) !important;
}

.processing i {
    animation: voice-processing-spin 1s linear infinite;
    display: inline-block;
}

@keyframes voice-processing-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}