/* 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, var(--navy, #1f3a5f) 0%, var(--navy-dark, #16293f) 100%);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    min-width: 36px;
    max-width: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(31, 58, 95, 0.28);
    overflow: hidden;
    white-space: nowrap;
    font-size: 0;
    line-height: 1;
}

.mic-button:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 12px rgba(31, 58, 95, 0.42);
}

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

.mic-button i {
    color: white;
    font-size: 16px;
    line-height: 1;
    pointer-events: none;
}

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

.mic-button.processing {
    background: linear-gradient(135deg, var(--good, #2e7d52) 0%, #1f5f41 100%);
    cursor: not-allowed;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(201, 162, 75, 0.34);
    }
    50% {
        box-shadow: 0 4px 16px rgba(201, 162, 75, 0.82);
    }
}

@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: 44px;
        height: 44px;
        min-width: 44px;
        max-width: 44px;
        right: 3px;
    }

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

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

    .input-with-mic:has(textarea) .mic-button {
        top: 5px;
    }
}

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

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

/* Accessibility improvements */
.mic-button:focus {
    outline: 2px solid var(--gold, #c9a24b);
    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(31, 58, 95, 0.5);
    }

    .mic-button:hover {
        box-shadow: 0 4px 12px rgba(31, 58, 95, 0.7);
    }
}
