/**
 * AI Voice Support - Styles
 * Modern glassmorphism design with animated elements
 */

/* Modal Overlay */
.ai-voice-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.ai-voice-modal.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Container */
.ai-voice-container {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    padding: 40px;
    max-width: 480px;
    width: 90%;
    text-align: center;
    position: relative;
    box-shadow:
        0 25px 50px rgba(0, 0, 0, 0.3),
        inset 0 1px 1px rgba(255, 255, 255, 0.1);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.ai-voice-modal.active .ai-voice-container {
    transform: scale(1) translateY(0);
}

/* Close Button */
.ai-voice-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.ai-voice-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Header */
.ai-voice-header {
    margin-bottom: 30px;
}

.ai-voice-header h3 {
    color: #fff;
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.ai-voice-header h3 i {
    color: #f5a623;
    font-size: 28px;
}

.ai-voice-header p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    margin: 0;
}

/* Microphone Button */
.ai-voice-mic-btn {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f5a623, #e8940d);
    border: none;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 30px;
    transition: all 0.3s ease;
    box-shadow:
        0 10px 30px rgba(245, 166, 35, 0.4),
        0 0 0 0 rgba(245, 166, 35, 0.5);
}

.ai-voice-mic-btn i {
    font-size: 40px;
    color: #fff;
    transition: transform 0.3s ease;
}

.ai-voice-mic-btn:hover {
    transform: scale(1.05);
    box-shadow:
        0 15px 40px rgba(245, 166, 35, 0.5),
        0 0 0 0 rgba(245, 166, 35, 0.5);
}

.ai-voice-mic-btn:active {
    transform: scale(0.95);
}

/* Listening State - Pulsing Animation */
.ai-voice-mic-btn.listening {
    animation: pulse 1.5s infinite;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    box-shadow:
        0 10px 30px rgba(76, 175, 80, 0.4),
        0 0 0 0 rgba(76, 175, 80, 0.5);
}

@keyframes pulse {
    0% {
        box-shadow:
            0 10px 30px rgba(76, 175, 80, 0.4),
            0 0 0 0 rgba(76, 175, 80, 0.5);
    }

    70% {
        box-shadow:
            0 10px 30px rgba(76, 175, 80, 0.4),
            0 0 0 20px rgba(76, 175, 80, 0);
    }

    100% {
        box-shadow:
            0 10px 30px rgba(76, 175, 80, 0.4),
            0 0 0 0 rgba(76, 175, 80, 0);
    }
}

/* Processing State */
.ai-voice-mic-btn.processing {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    animation: processing-spin 1s linear infinite;
}

.ai-voice-mic-btn.processing i {
    animation: processing-pulse 0.5s ease-in-out infinite alternate;
}

@keyframes processing-spin {
    0% {
        box-shadow:
            0 10px 30px rgba(33, 150, 243, 0.4),
            0 0 0 0 rgba(33, 150, 243, 0.3);
    }

    50% {
        box-shadow:
            0 10px 30px rgba(33, 150, 243, 0.6),
            0 0 0 10px rgba(33, 150, 243, 0);
    }

    100% {
        box-shadow:
            0 10px 30px rgba(33, 150, 243, 0.4),
            0 0 0 0 rgba(33, 150, 243, 0.3);
    }
}

@keyframes processing-pulse {
    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(0.9);
    }
}

/* Speaking State */
.ai-voice-mic-btn.speaking {
    background: linear-gradient(135deg, #9C27B0, #7B1FA2);
    box-shadow:
        0 10px 30px rgba(156, 39, 176, 0.4),
        0 0 0 0 rgba(156, 39, 176, 0.5);
}

/* Error State */
.ai-voice-mic-btn.error {
    background: linear-gradient(135deg, #f44336, #d32f2f);
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-5px);
    }

    40%,
    80% {
        transform: translateX(5px);
    }
}

/* Voice Wave Visualization */
.ai-voice-wave {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 40px;
    margin-bottom: 20px;
    opacity: 0.3;
    transition: opacity 0.3s ease;
}

.ai-voice-wave.active {
    opacity: 1;
}

.ai-voice-wave span {
    width: 4px;
    height: 10px;
    background: linear-gradient(to top, #f5a623, #ffd93d);
    border-radius: 2px;
    animation: wave 0.5s ease-in-out infinite;
    animation-play-state: paused;
}

.ai-voice-wave.active span {
    animation-play-state: running;
}

.ai-voice-wave span:nth-child(1) {
    animation-delay: 0s;
}

.ai-voice-wave span:nth-child(2) {
    animation-delay: 0.1s;
}

.ai-voice-wave span:nth-child(3) {
    animation-delay: 0.2s;
}

.ai-voice-wave span:nth-child(4) {
    animation-delay: 0.3s;
}

.ai-voice-wave span:nth-child(5) {
    animation-delay: 0.4s;
}

.ai-voice-wave span:nth-child(6) {
    animation-delay: 0.3s;
}

.ai-voice-wave span:nth-child(7) {
    animation-delay: 0.2s;
}

.ai-voice-wave span:nth-child(8) {
    animation-delay: 0.1s;
}

.ai-voice-wave span:nth-child(9) {
    animation-delay: 0s;
}

@keyframes wave {

    0%,
    100% {
        height: 10px;
    }

    50% {
        height: 35px;
    }
}

/* Status Text */
.ai-voice-status {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    margin-bottom: 20px;
    min-height: 20px;
}

/* Transcript Box */
.ai-voice-transcript {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    min-height: 60px;
}

.ai-voice-transcript label {
    display: block;
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.ai-voice-transcript p {
    color: #fff;
    font-size: 14px;
    margin: 0;
    line-height: 1.5;
    min-height: 21px;
}

/* Response Box */
.ai-voice-response {
    background: rgba(245, 166, 35, 0.1);
    border: 1px solid rgba(245, 166, 35, 0.3);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    min-height: 80px;
}

.ai-voice-response label {
    display: block;
    color: #f5a623;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.ai-voice-response p {
    color: #fff;
    font-size: 14px;
    margin: 0;
    line-height: 1.6;
    min-height: 21px;
}

/* Contact Link */
.ai-voice-contact {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    text-decoration: none;
    transition: color 0.3s ease;
}

.ai-voice-contact:hover {
    color: #f5a623;
}

.ai-voice-contact i {
    font-size: 16px;
}

/* Language Selector */
.ai-voice-language-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.ai-voice-language-selector label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 18px;
}

.ai-voice-language-selector select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 8px 16px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
    min-width: 180px;
}

.ai-voice-language-selector select:hover,
.ai-voice-language-selector select:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(245, 166, 35, 0.5);
}

.ai-voice-language-selector select option {
    background: #1a1a2e;
    color: #fff;
}

/* AI Voice Support Button Styles */
.ai-voice-trigger-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.ai-voice-trigger-btn i {
    font-size: 16px;
}

/* Mobile Responsiveness */
@media (max-width: 576px) {
    .ai-voice-container {
        padding: 30px 20px;
        margin: 20px;
        width: calc(100% - 40px);
    }

    .ai-voice-mic-btn {
        width: 100px;
        height: 100px;
    }

    .ai-voice-mic-btn i {
        font-size: 32px;
    }

    .ai-voice-header h3 {
        font-size: 20px;
    }
}