/* Voice Input Modal Styles */
#voiceInputModal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 1001; /* Ensure it's above other modals */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.5);
    transition: opacity var(--transition-speed);
}

#voiceInputModal .modal-content {
    background-color: var(--bg-color);
    margin: 10% auto;
    padding: 20px;
    border: 1px solid var(--border-color);
    width: 80%;
    max-width: 400px;
    border-radius: 8px;
    position: relative;
    text-align: center;
    color: var(--text-color);
}

#voiceInputModal .close-button {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 24px;
    color: var(--text-color);
    cursor: pointer;
    z-index: 1002; /* Ensure close button is above other elements */
}

.voice-modal-body h1 {
    font-size: 24px;
    margin-bottom: 20px;
}

.mic-container {
    position: relative;
    display: inline-block;
}

.mic-circle {
    width: 100px;
    height: 100px;
    background-color: red; /* Default red background */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin: 0 auto;
    color: var(--button-text);
    font-size: 48px;
    position: relative;
    z-index: 2;
    transition: background-color 0.3s ease; /* Smooth color transition */
}

/* Language Selection Styles */
#languageContainer {
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

#languageContainer i {
    margin-right: 10px;
    font-size: 24px;
    color: var(--accent-color);
}

#languageSelect {
    padding: 8px;
    font-size: 16px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--input-bg);
    color: var(--text-color);
    width: 200px;
}

.audio-wave {
    position: absolute; /* Changed from relative to absolute */
    bottom: -60px; /* Adjusted position to prevent overlap */
    left: 50%;
    transform: translateX(-50%);
    display: none; /* Hide wave by default */
    align-items: flex-end;
    height: 50px;
    width: 100%;
    max-width: 200px;
    overflow: hidden;
    z-index: 9999999; /* Ensure wave is behind the mic-circle */
}

.wave-bar {
    width: 4px;
    margin: 0 1px;
    background-color: red; /* Default wave bar color */
    height: 50px; /* Initial height */
    transition: height 0.1s ease, background-color 0.3s ease; /* Smooth transitions */
    z-index: 9999999;
}

@keyframes wave {
    0%, 100% { height: 10px; }
    50% { height: 30px; }
}

.voice-modal-body {
    position: relative;
}

#voiceInputModal[data-listening="true"] .mic-circle {
    background-color: green; /* Green when listening */
}

/* Adjust wave bar colors in dark mode */
[data-theme="dark"] .wave-bar {
    background-color: var(--accent-color);
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .mic-circle {
        width: 80px;
        height: 80px;
        font-size: 36px;
    }

    .audio-wave {
        max-width: 150px;
        bottom: -40px;
    }
}
