/* AI Assistant Widget (Text Only) */
:root {
  --ai-primary: #1ba6a6; /* Teal accent */
  --ai-secondary: #0b4f6c; /* Dark corporate blue */
  --ai-text: #333;
  --ai-bg: #fff;
  --ai-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
  --ai-border: #f0f0f0;
}

/* 1. Floating Toggle Buttons Container */
.ai-widget-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 10000;
    align-items: center;
}

.ai-fab {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: none;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.ai-fab:hover {
    transform: scale(1.1) translateY(-5px);
}

/* Voice FAB (Top) */
.ai-voice-fab {
    background: rgba(11, 79, 108, 0.7); /* Corporate blue with transparency */
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(11, 79, 108, 0.3), 0 0 15px rgba(27, 166, 166, 0.4);
    animation: glow 2s infinite alternate;
}

/* Chat FAB (Bottom) */
.ai-chat-fab {
    background: rgba(27, 166, 166, 0.7); /* Teal with transparency */
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(27, 166, 166, 0.3);
}

@keyframes glow {
    from { box-shadow: 0 8px 32px rgba(11, 79, 108, 0.3), 0 0 5px rgba(27, 166, 166, 0.3); }
    to { box-shadow: 0 8px 32px rgba(11, 79, 108, 0.3), 0 0 20px rgba(27, 166, 166, 0.6); }
}

/* Hidden state for when chat is open */
.ai-widget-container.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
}

/* 2. Chat Window Container (Bottom Right) */
.ai-assistant-overlay {
    position: fixed;
    bottom: 100px; /* Above the toggle button space */
    right: 30px;
    width: 350px;
    height: 500px;
    max-height: 80vh;
    z-index: 9999;
    
    /* Animation: Slide up and Fade In */
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: opacity 0.3s, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
    
    display: flex;
    flex-direction: column;
}

.ai-assistant-overlay.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* 3. Modal Internal Structure */
.ai-assistant-modal {
    background: var(--ai-bg);
    width: 100%;
    height: 100%;
    border-radius: 16px;
    box-shadow: var(--ai-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--ai-border);
}

.ai-modal-header {
    background: linear-gradient(135deg, var(--ai-secondary) 0%, #173f5f 100%);
    color: white;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.ai-modal-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    color: white !important;
}

.ai-close-btn {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.ai-close-btn:hover {
    background: rgba(255,255,255,0.25);
}

/* 4. Chat Body */
.ai-modal-body {
    flex: 1;
    background-color: #f8f9fa;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-message {
    padding: 10px 14px;
    border-radius: 12px;
    max-width: 85%;
    line-height: 1.45;
    font-size: 0.9rem;
    position: relative;
    word-wrap: break-word;
}

.ai-message.bot {
    background-color: #fff;
    color: var(--ai-text);
    align-self: flex-start;
    border-bottom-left-radius: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.ai-message.user {
    background-color: var(--ai-primary);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* 5. Footer & Input */
.ai-modal-footer {
    padding: 12px;
    background: #fff;
    border-top: 1px solid var(--ai-border);
    display: flex;
    gap: 8px;
    align-items: center;
}

.ai-input-wrapper {
    flex: 1;
}

.ai-chat-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ai-chat-input:focus {
    border-color: var(--ai-primary);
    box-shadow: 0 0 0 2px rgba(27, 166, 166, 0.1);
}

.ai-send-btn {
    background: var(--ai-primary);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
}

.ai-send-btn:hover {
    background: #148f8f;
    transform: scale(1.05);
}

/* Typing Indicator (Simple dots) */
.bot-typing {
    color: #888;
    font-style: italic;
    font-size: 0.8rem;
    margin-left: 5px;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    .ai-assistant-overlay {
        bottom: 0;
        right: 0;
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    .ai-assistant-modal {
        border-radius: 0;
    }
    .ai-widget-toggle {
        bottom: 20px;
        right: 20px;
    }
}
/* 6. Voice Agent Specific (Full Bleed / Native Card) */
.voice-overlay .ai-assistant-modal {
    background: transparent !important; /* Ensure no white background */
    background-color: transparent !important;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    border-radius: 15px;
    overflow: hidden; /* Crop sharp corners */
    position: relative;
    box-shadow: none; /* Removed from container as requested */
}

.voice-overlay .floating-close {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 100;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 32px;
    height: 32px;
    font-size: 1.4rem;
    color: white;
    opacity: 0.6;
    transition: opacity 0.2s, background 0.2s;
}

.voice-overlay .floating-close:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.4);
}

.voice-overlay .ai-modal-header {
    display: none; /* Hide container header */
}

.voice-overlay .ai-modal-body {
    background: transparent !important;
    padding: 0 !important; /* Force zero padding */
    height: 100%;
    width: 100%;
}

.voice-overlay .ai-modal-body iframe {
    background: transparent;
    border-radius: 15px;
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.25); /* Shadow added here */
}
