/* 語音通話模態視窗 */
.voice-call-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: opacity 0.3s ease;
    opacity: 0;
}

.voice-call-modal.visible {
    opacity: 1;
    display: flex !important;
}

.voice-call-container {
    background-color: rgba(18, 18, 18, 0.8);
    border-radius: 24px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    animation: modalFadeIn 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform: translateY(0);
    transition: transform 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.voice-call-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 22px;
    background-color: rgba(78, 137, 247, 0.15);
    border-bottom: 1px solid rgba(78, 137, 247, 0.2);
}

.voice-call-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.95);
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
}

.voice-call-header h3:before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    background-color: #4cd964;
    border-radius: 50%;
    margin-right: 10px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(76, 217, 100, 0.6);
        transform: scale(1);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(76, 217, 100, 0);
        transform: scale(1.1);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(76, 217, 100, 0);
        transform: scale(1);
    }
}

.close-voice-call {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 20px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.close-voice-call:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    transform: rotate(90deg);
}

.voice-call-body {
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.voice-status {
    text-align: center;
    font-size: 17px;
    color: rgba(255, 255, 255, 0.9);
    padding: 14px 16px;
    border-radius: 16px;
    background-color: rgba(255, 255, 255, 0.07);
    width: 100%;
    letter-spacing: 0.3px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
    font-weight: 500;
}

.voice-visualization {
    width: 100%;
    height: 140px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    padding: 10px;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    overflow: hidden;
}

.voice-visualization:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, transparent 30%, rgba(0, 0, 0, 0.4) 100%);
    pointer-events: none;
}

.voice-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    width: 100%;
    margin-top: 10px;
}

.voice-call-button {
    padding: 16px 28px;
    border-radius: 30px;
    border: none;
    background-color: rgba(255, 70, 70, 0.95);
    color: white;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 6px 15px rgba(255, 70, 70, 0.3);
}

.voice-call-button:hover {
    background-color: rgba(255, 70, 70, 1);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(255, 70, 70, 0.4);
}

.voice-call-button:active {
    transform: translateY(0);
    box-shadow: 0 4px 10px rgba(255, 70, 70, 0.3);
}

/* 波形圖在用戶說話時的動畫效果 */
@keyframes waveform-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 70, 70, 0.3);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(255, 70, 70, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 70, 70, 0);
    }
}

.voice-visualization.active {
    animation: waveform-pulse 1.5s infinite;
    background-color: rgba(255, 70, 70, 0.15);
    border-color: rgba(255, 70, 70, 0.25);
}

/* AI說話時的動畫效果 */
@keyframes ai-speaking {
    0% {
        box-shadow: 0 0 0 0 rgba(78, 137, 247, 0.3);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(78, 137, 247, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(78, 137, 247, 0);
    }
}

.voice-visualization.ai-speaking {
    animation: ai-speaking 1.5s infinite;
    background-color: rgba(78, 137, 247, 0.15);
    border-color: rgba(78, 137, 247, 0.25);
}

/* 波形容器 */
.wave-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    gap: 6px;
    position: relative;
    z-index: 2;
}

/* 波形條 */
.wave-bar {
    width: 4px;
    height: 3px;
    background-color: rgba(78, 137, 247, 0.7);
    border-radius: 4px;
    transition: all 0.2s ease;
    position: relative;
}

.wave-bar:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: inherit;
    border-radius: inherit;
    filter: blur(2px);
    opacity: 0.7;
}

/* 用戶說話時的波形 */
.voice-visualization.active .wave-bar {
    background-color: rgba(255, 70, 70, 0.9);
    box-shadow: 0 0 12px rgba(255, 70, 70, 0.6);
    animation: wave-animation 0.5s infinite alternate;
}

/* AI說話時的波形 */
.voice-visualization.ai-speaking .wave-bar {
    background-color: rgba(78, 137, 247, 0.9);
    box-shadow: 0 0 12px rgba(78, 137, 247, 0.6);
    animation: wave-animation 0.7s infinite alternate;
}

/* 波形動畫 - 為每個條設置不同延遲 */
@keyframes wave-animation {
    0% {
        height: 3px;
        opacity: 0.6;
    }
    100% {
        height: 50px;
        opacity: 1;
    }
}

/* 為每個波形條設置不同的動畫延遲 */
.wave-bar:nth-child(1) { animation-delay: -0.45s; }
.wave-bar:nth-child(2) { animation-delay: -0.4s; }
.wave-bar:nth-child(3) { animation-delay: -0.35s; }
.wave-bar:nth-child(4) { animation-delay: -0.3s; }
.wave-bar:nth-child(5) { animation-delay: -0.25s; }
.wave-bar:nth-child(6) { animation-delay: -0.2s; }
.wave-bar:nth-child(7) { animation-delay: -0.15s; }
.wave-bar:nth-child(8) { animation-delay: -0.1s; }
.wave-bar:nth-child(9) { animation-delay: -0.05s; }
.wave-bar:nth-child(10) { animation-delay: 0s; }
.wave-bar:nth-child(11) { animation-delay: -0.05s; }
.wave-bar:nth-child(12) { animation-delay: -0.1s; }
.wave-bar:nth-child(13) { animation-delay: -0.15s; }
.wave-bar:nth-child(14) { animation-delay: -0.2s; }
.wave-bar:nth-child(15) { animation-delay: -0.25s; }

/* 麥克風按鈕樣式 */
.mic-button {
    /* ... existing code ... */
    transition: all 0.3s ease;
}

.mic-button.active {
    background-color: #ff4646;
    transform: scale(1.05);
    box-shadow: 0 0 0 4px rgba(255, 70, 70, 0.3);
}

.mic-button.active i {
    color: white !important;
}

/* 麥克風按鈕點擊效果 */
.mic-button:active {
    transform: scale(0.95);
}

/* 除錯按鈕 - 可以在畫面右下角點擊強制清除任何殘留的模式 */
.debug-voice-button {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 40px;
    height: 40px;
    background-color: #ff4646;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    cursor: pointer;
    z-index: 10000;
} 