/* ==========================================
   VOICE POPUP - Elderly-friendly Giant Button
   ========================================== */

/* Floating Call Button (always visible) */
.floating-call-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(145deg, #4caf50 0%, #2e7d32 100%);
    border: none;
    cursor: pointer;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 25px rgba(76, 175, 80, 0.5);
    z-index: 9998;
    transition: all 0.3s ease;
    animation: pulse-float 2s infinite;
}

.floating-call-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 35px rgba(76, 175, 80, 0.6);
}

.floating-call-btn .material-icons {
    font-size: 2rem;
}

.floating-call-btn .floating-btn-text {
    font-size: 0.75rem;
    margin-top: 2px;
}

@keyframes pulse-float {
    0% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.6);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(76, 175, 80, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
}

/* Welcome Popup Overlay */
.voice-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Popup Container */
.voice-popup {
    background: linear-gradient(145deg, #ffffff 0%, #f0f9f0 100%);
    border-radius: 30px;
    padding: 50px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Popup Title */
.voice-popup h2 {
    color: #1b5e20;
    font-size: 2rem;
    margin-bottom: 15px;
    font-weight: 700;
}

.voice-popup p {
    color: #555;
    font-size: 1.3rem;
    margin-bottom: 40px;
    line-height: 1.6;
}

/* GIANT CALL BUTTON */
.giant-call-btn {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: linear-gradient(145deg, #4caf50 0%, #2e7d32 100%);
    border: none;
    cursor: pointer;
    color: #fff;
    font-size: 2.5rem;
    font-weight: 700;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto 30px;
    box-shadow: 0 10px 40px rgba(76, 175, 80, 0.4);
    transition: all 0.3s ease;
    animation: pulse-giant 2s infinite;
    /* Mobile touch optimization */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

.giant-call-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 50px rgba(76, 175, 80, 0.5);
}

.giant-call-btn:active {
    transform: scale(0.92);
    box-shadow: 0 8px 30px rgba(76, 175, 80, 0.5);
}

.giant-call-btn .material-icons {
    font-size: 5rem;
    margin-bottom: 5px;
}

@keyframes pulse-giant {
    0% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
    }

    70% {
        box-shadow: 0 0 0 30px rgba(76, 175, 80, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
}

/* Close button */
.voice-popup-close {
    background: transparent;
    border: 2px solid #ccc;
    border-radius: 25px;
    padding: 12px 30px;
    font-size: 1rem;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}

.voice-popup-close:hover {
    background: #f5f5f5;
    border-color: #999;
}

/* ==========================================
   ASSISTANT PAGE - Voice-First Layout
   ========================================== */

.voice-assistant-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #e8f5e9 0%, #fff 50%);
}

/* Chat Area */
.voice-chat-area {
    flex: 1;
    padding: 30px;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.voice-message {
    padding: 20px 25px;
    border-radius: 20px;
    margin-bottom: 20px;
    font-size: 1.2rem;
    line-height: 1.6;
    max-width: 85%;
    animation: messageSlide 0.3s ease;
}

@keyframes messageSlide {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.voice-message.bot {
    background: #fff;
    border: 2px solid #e0e0e0;
    margin-right: auto;
    border-bottom-left-radius: 5px;
}

.voice-message.user {
    background: linear-gradient(135deg, #4caf50 0%, #2e7d32 100%);
    color: #fff;
    margin-left: auto;
    border-bottom-right-radius: 5px;
}

/* Bottom Call Button Area */
.voice-call-area {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px;
    background: linear-gradient(180deg, transparent 0%, #fff 30%);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.voice-status {
    font-size: 1.3rem;
    color: #666;
    margin-bottom: 20px;
    min-height: 30px;
}

/* Call Button States */
.call-btn {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: linear-gradient(145deg, #4caf50 0%, #2e7d32 100%);
    border: none;
    cursor: pointer;
    color: #fff;
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 30px rgba(76, 175, 80, 0.4);
    transition: all 0.4s ease;
}

.call-btn .material-icons {
    font-size: 4rem;
    margin-bottom: 5px;
}

/* Ready state - pulsing */
.call-btn.ready {
    animation: pulse-giant 2s infinite;
}

/* Recording state - red */
.call-btn.recording {
    background: linear-gradient(145deg, #f44336 0%, #c62828 100%);
    box-shadow: 0 8px 30px rgba(244, 67, 54, 0.4);
    animation: pulse-recording 1s infinite;
}

@keyframes pulse-recording {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

/* Processing state - shrink */
.call-btn.processing {
    width: 80px;
    height: 80px;
    background: linear-gradient(145deg, #ff9800 0%, #f57c00 100%);
    box-shadow: 0 5px 20px rgba(255, 152, 0, 0.4);
    animation: spin 1.5s linear infinite;
}

.call-btn.processing .material-icons {
    font-size: 2rem;
}

.call-btn.processing span:not(.material-icons) {
    display: none;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 600px) {
    .voice-popup {
        padding: 30px 20px;
    }

    .voice-popup h2 {
        font-size: 1.6rem;
    }

    .giant-call-btn {
        width: 160px;
        height: 160px;
        font-size: 2rem;
    }

    .giant-call-btn .material-icons {
        font-size: 4rem;
    }

    .call-btn {
        width: 120px;
        height: 120px;
    }

    .call-btn .material-icons {
        font-size: 3rem;
    }
}

/* ==========================================
   AI DOCTOR AVATAR - Image Based
   ========================================== */
.ai-avatar {
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(180deg, #f5f5f5 0%, #e0e0e0 100%);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.ai-avatar .avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Talking State - More vibrant glow */
.ai-avatar.talking {
    box-shadow: 0 0 30px rgba(46, 125, 50, 0.6);
    animation: avatarPulse 0.6s ease-in-out infinite alternate;
}

/* Listening State - Blue glow */
.ai-avatar.listening {
    box-shadow: 0 0 30px rgba(25, 118, 210, 0.6);
}

@keyframes avatarPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(46, 125, 50, 0.4);
    }

    100% {
        transform: scale(1.05);
        box-shadow: 0 0 35px rgba(46, 125, 50, 0.8);
    }
}