/* Voice Assistant Login Modal */
#voiceAssistantLoginModal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: #fff;
    margin: 15% auto;
    padding: 20px;
    border-radius: 8px;
    width: 350px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.modal-header {
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.modal-header h3 {
    margin: 0;
    color: #1f2937;
    font-size: 1.25rem;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #4b5563;
}

.form-group input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.875rem;
}

.modal-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

.modal-buttons button {
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    border: none;
}

.modal-buttons button[type="button"] {
    background-color: #e5e7eb;
    color: #4b5563;
}

.modal-buttons button[type="submit"] {
    background-color: #ef4444;
    color: white;
}

/* === Red Theme Styles === */
.voice-agent-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    bottom: auto;
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: linear-gradient(135deg, #dc2626, #ef4444);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.4);
    z-index: 2000;
    transition: all 0.3s ease;
}

.voice-agent-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(220, 38, 38, 0.6);
}

.voicebot-container {
    position: fixed;
    top: 20px;
    right: 20px;
    bottom: auto;
    max-height: calc(100vh - 40px);
    width: 420px;
    background: #fff;
    color: #222;
    border-radius: 25px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.3);
    overflow: hidden;
    transition: all .4s ease;
    font-family: 'Poppins', sans-serif;
    display: none;
    flex-direction: column;
    border: 2px solid #fecaca;
    z-index: 1999;
}

.voicebot-container.show { 
    display: flex; 
    animation: fadeIn .4s ease-in-out; 
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === Header - Red Theme === */
.voicebot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #dc2626, #ef4444);
    padding: 12px 15px;
    color: white;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-icon { 
    font-size: 20px; 
    color: white; 
    background: rgba(255,255,255,0.2);
    padding: 8px;
    border-radius: 10px;
}

.voicebot-header h5 { 
    margin: 0; 
    font-size: 16px; 
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* === Modern Buttons - Red Theme === */
.btn-icon {
    width: 32px;
    height: 32px;
    margin-left: 8px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
    cursor: pointer;
}

.btn-icon.minimize {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    box-shadow: 0 0 6px rgba(255,255,255,0.3);
}

.btn-icon.minimize:hover {
    background: rgba(255,255,255,0.4);
    transform: scale(1.1);
}

.btn-icon.maximize {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
}

btn-icon.maximize:hover {
    background: rgba(255,255,255,0.4);
    transform: scale(1.1);
}



/* === Chat History === */
.voicebot-body {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-history {
    height: 240px;
    overflow-y: auto;
    padding: 12px 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scrollbar-width: thin;
    scrollbar-color: #dc2626 #fff;
    background: #fef2f2;
}

.chat-history::-webkit-scrollbar {
    width: 6px;
}

.chat-history::-webkit-scrollbar-track {
    background: #fef2f2;
    border-radius: 3px;
}

.chat-history::-webkit-scrollbar-thumb {
    background: #dc2626;
    border-radius: 3px;
}

.chat-bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 18px;
    line-height: 1.4;
    font-size: 14px;
    word-wrap: break-word;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.chat-bubble.user {
    align-self: flex-end;
    background: linear-gradient(135deg, #dc2626, #ef4444);
    color: #fff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

.chat-bubble.bot {
    align-self: flex-start;
    background: #fff;
    color: #333;
    border-bottom-left-radius: 4px;
    border: 1px solid #fecaca;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* === Wave Animation - Red Theme === */
.google-style-animation {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 4px;
    height: 60px;
    margin-top: 10px;
}

.google-style-animation .bar {
    width: 6px;
    height: 10px;
    background: linear-gradient(180deg, #dc2626, #ef4444, #fca5a5);
    border-radius: 3px;
    transition: height .08s ease;
    box-shadow: 0 0 10px rgba(220, 38, 38, 0.3);
}

.google-style-animation.listening .bar {
    animation: wave 1.2s ease-in-out infinite;
}

.google-style-animation .bar:nth-child(1) { animation-delay: 0s; }
.google-style-animation .bar:nth-child(2) { animation-delay: 0.1s; }
.google-style-animation .bar:nth-child(3) { animation-delay: 0.2s; }
.google-style-animation .bar:nth-child(4) { animation-delay: 0.3s; }
.google-style-animation .bar:nth-child(5) { animation-delay: 0.4s; }

@keyframes wave {
    0%, 100% { height: 10px; }
    50% { height: 30px; }
}

/* === Voice Controls - Red Theme === */
.voice-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    padding-bottom: 10px;
}

.voice-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.voice-select {
    background: #fff;
    color: #222;
    border: 1px solid #dc2626;
    padding: 5px 10px;
    border-radius: 10px;
    font-size: 13px;
}

.voice-select:focus {
    outline: none;
    border-color: #b91c1c;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2);
}

.control-buttons {
    display: flex;
    gap: 10px;
}

.mic-btn, .stop-btn {
    border: none;
    border-radius: 50%;
    width: 55px;
    height: 55px;
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.mic-btn { 
    background: linear-gradient(135deg, #dc2626, #ef4444);
    border: 2px solid #fecaca;
}

.mic-btn:hover { 
    background: linear-gradient(135deg, #b91c1c, #dc2626); 
    transform: scale(1.1); 
    box-shadow: 0 6px 15px rgba(220, 38, 38, 0.4);
}

.stop-btn { 
    background: linear-gradient(135deg, #6b7280, #4b5563);
    border: 2px solid #e5e7eb;
}

.stop-btn:hover { 
    background: linear-gradient(135deg, #4b5563, #374151); 
    transform: scale(1.1); 
}

.voice-status {
    margin-top: 10px;
    font-size: 14px;
    color: #dc2626;
    text-align: center;
    font-weight: 500;
    min-height: 20px;
}

/* === Permission Status - Red Theme === */
.permission-status {
    padding: 8px 12px;
    margin: 5px 15px;
    border-radius: 8px;
    font-size: 12px;
    text-align: center;
    display: none;
}

.permission-status.granted {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
    display: block;
}

.permission-status.denied {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    display: block;
}

.permission-status.pending {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
    display: block;
}

/* === Mobile Help - Red Theme === */
.mobile-help {
    font-size: 11px;
    text-align: center;
    padding: 8px 12px;
    color: #dc2626;
    background: #fef2f2;
    margin: 8px 12px;
    border-radius: 8px;
    border: 1px solid #fecaca;
}

/* === Listening Pulse - Red Theme === */
.listening-pulse {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    width: 70px;
    height: 70px;
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
    z-index: 2;
    background: radial-gradient(circle, rgba(220, 38, 38, 0.4) 0%, rgba(220, 38, 38, 0.1) 70%);
    animation: pulseEffect 2s infinite;
}

@keyframes pulseEffect {
    0% { transform: translateX(-50%) scale(1); opacity: 0.6; }
    70% { transform: translateX(-50%) scale(1.8); opacity: 0.2; }
    100% { transform: translateX(-50%) scale(1); opacity: 0; }
}

/* === Mobile Responsive Fixes === */
@media (max-width: 768px) {
    .voicebot-container {
        width: 94vw !important;
        right: 3vw !important;
        top: 20px !important;
        bottom: auto !important;
        max-height: calc(100vh - 40px) !important;
        border-radius: 16px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2) !important;
    }
    
    .voice-agent-toggle {
        top: 20px;
        right: 20px;
        bottom: auto;
        width: 56px;
        height: 56px;
        font-size: 20px;
    }
    
    .voicebot-header {
        padding: 10px 12px;
    }
    
    .voicebot-body {
        max-height: 60vh;
        height: 60px;
        font-size: 22px;
    }
    
    .chat-history {
        height: 180px !important;
        font-size: 13px;
        padding: 10px 12px;
    }
    
    .chat-bubble {
        max-width: 85% !important;
        padding: 8px 12px !important;
        font-size: 13px !important;
        line-height: 1.3;
    }
    
    .mic-btn, .stop-btn {
        width: 48px !important;
        height: 48px !important;
        font-size: 16px !important;
    }
    
    .voice-status {
        font-size: 13px;
        padding: 0 10px;
    }
    
    .mobile-help {
        font-size: 11px;
        padding: 8px 12px;
        margin: 8px 12px;
    }
}