/* =============================
   VOICE ASSISTANT STYLES
   Multilingual voice interface
   ============================= */

/* Voice button */
.voice-btn {
    background: linear-gradient(135deg, #1e7f7f 0%, #176666 100%);
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    margin-right: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.voice-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.voice-btn:active {
    transform: scale(0.95);
}

.voice-btn.listening {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(245, 87, 108, 0.3);
    }

    50% {
        transform: scale(1.1);
        box-shadow: 0 6px 20px rgba(245, 87, 108, 0.5);
    }
}

/* Language selector */
.language-selector {
    padding: 10px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 12px;
    min-width: 140px;
}

.language-selector:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.language-selector:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Voice status */
.voice-status {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 12px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    animation: fadeIn 0.3s ease forwards;
}

.voice-status.listening {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.voice-status.error {
    background: #ef4444;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* Adjust chat form layout for voice controls */
#chat-form {
    display: flex;
    gap: 12px;
    align-items: center;
    position: relative;
    padding: 16px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

#chat-message {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.3s ease;
}

#chat-message:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Voice wave animation (optional) */
.voice-wave {
    display: inline-block;
    width: 4px;
    height: 20px;
    background: currentColor;
    margin: 0 2px;
    animation: wave 1.2s ease-in-out infinite;
}

.voice-wave:nth-child(2) {
    animation-delay: 0.1s;
}

.voice-wave:nth-child(3) {
    animation-delay: 0.2s;
}

.voice-wave:nth-child(4) {
    animation-delay: 0.3s;
}

@keyframes wave {

    0%,
    100% {
        transform: scaleY(1);
    }

    50% {
        transform: scaleY(1.5);
    }
}

/* RTL Support for Arabic, Farsi, Urdu */
[dir="rtl"] .chat-form,
[lang="ar"] .chat-form,
[lang="fa"] .chat-form,
[lang="ur"] .chat-form {
    direction: rtl;
}

[dir="rtl"] .voice-btn,
[lang="ar"] .voice-btn,
[lang="fa"] .voice-btn,
[lang="ur"] .voice-btn {
    margin-right: 0;
    margin-left: 12px;
}

[dir="rtl"] .language-selector,
[lang="ar"] .language-selector,
[lang="fa"] .language-selector,
[lang="ur"] .language-selector {
    margin-right: 0;
    margin-left: 12px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .language-selector {
        background: #1e293b;
        border-color: #334155;
        color: #e2e8f0;
    }

    .language-selector:hover {
        border-color: #667eea;
    }

    #chat-form {
        background: #1e293b;
    }

    #chat-message {
        background: #0f172a;
        border-color: #334155;
        color: #e2e8f0;
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .voice-btn {
        width: 44px;
        height: 44px;
        font-size: 20px;
    }

    .language-selector {
        min-width: 120px;
        font-size: 13px;
        padding: 8px 12px;
    }

    #chat-form {
        flex-wrap: wrap;
    }

    #chat-message {
        width: 100%;
        order: -1;
    }
}

/* Accessibility */
.voice-btn:focus-visible,
.language-selector:focus-visible {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

/* Loading indicator for voice */
.voice-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}