/* ============================================
   IN-CHAT LEAD CAPTURE FORM
   ============================================ */
.ai-lead-form-card {
    background: linear-gradient(135deg, #1a1a1a, #2a2a2a);
    border-top: 2px solid #D4AF37;
    padding: 12px 14px;
    animation: slideUp 0.3s ease;
}
@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.lead-form-header {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #D4AF37;
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 4px;
}
.lead-form-header i { font-size: 14px; }
.lead-form-close {
    margin-left: auto;
    background: none;
    border: none;
    color: #888;
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.lead-form-close:hover { color: #fff; }
.lead-form-subtitle {
    color: #aaa;
    font-size: 11px;
    margin-bottom: 8px;
    line-height: 1.3;
}
.ai-lead-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.ai-lead-form input {
    background: #111;
    border: 1px solid #444;
    color: #fff;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 12px;
    outline: none;
    transition: border-color 0.2s;
}
.ai-lead-form input:focus {
    border-color: #D4AF37;
}
.ai-lead-form input::placeholder {
    color: #666;
}
.lead-form-submit {
    background: #D4AF37;
    color: #000;
    border: none;
    padding: 9px 12px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.lead-form-submit:hover { background: #C19B2A; }
.lead-form-success {
    text-align: center;
    color: #4CAF50;
    font-size: 12px;
    font-weight: 600;
    padding: 10px 0 4px;
}
.lead-form-success i {
    font-size: 20px;
    display: block;
    margin-bottom: 4px;
}

/* WhatsApp Handoff */
.ai-whatsapp-handoff {
    padding: 6px 14px 8px;
    background: #1a1a1a;
    border-top: 1px solid #333;
}
.whatsapp-handoff-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #25D366;
    color: #fff !important;
    text-decoration: none !important;
    padding: 8px 14px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 12px;
    transition: background 0.2s;
    width: 100%;
}
.whatsapp-handoff-btn:hover { background: #1DA851; }
.whatsapp-handoff-btn i { font-size: 16px; }

/* AI Chat Links - Clickable links in messages */
.ai-chat-link {
    color: #D4AF37 !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    border-bottom: 1px solid rgba(238, 162, 52, 0.3);
    transition: all 0.2s ease;
    cursor: pointer;
}
.ai-chat-link:hover {
    color: #C19B2A !important;
    border-bottom-color: #D4AF37;
    text-decoration: none !important;
}
.message.assistant .ai-chat-link {
    display: inline-block;
    margin: 2px 0;
}

/* Floating Order Button */
.floating-order-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: #333;
    color: #D4AF37;
    width: 56px;
    height: 56px;
    min-height: 56px;
    max-height: 56px;
    border-radius: 50%;
    font-weight: bold;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    z-index: 9998;
    font-family: 'Plateia', sans-serif;
    transition: width 0.4s ease, border-radius 0.4s ease, background 0.4s ease, box-shadow 0.4s ease, transform 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    overflow: hidden;
    padding: 0;
}
.floating-order-btn i {
    font-size: 1.3rem;
    transition: all 0.4s ease;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    margin-left: 0;
    width: 56px;
    min-width: 56px;
}
.floating-order-btn span,
.floating-order-btn .d-none {
    white-space: nowrap;
    margin-left: 10px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0;
    transform: translateX(-10px);
    width: 0;
    overflow: hidden;
    transition: all 0.4s ease;
}
.floating-order-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
    background: #3a3a3a;
    color: #D4AF37;
    text-decoration: none;
    width: auto;
    padding-right: 22px;
    padding-left: 0;
    border-radius: 28px;
    height: 56px;
    min-height: 56px;
    max-height: 56px;
}
.floating-order-btn:hover i {
    margin-left: 0;
}
.floating-order-btn:hover span,
.floating-order-btn:hover .d-none {
    opacity: 1;
    transform: translateX(0);
    width: auto;
}
@media (max-width: 768px) {
    .floating-order-btn {
        width: 50px;
        height: 50px;
        min-height: 50px;
        max-height: 50px;
    }
    .floating-order-btn i {
        font-size: 1.2rem;
        width: 50px;
        min-width: 50px;
    }
    .floating-order-btn:hover {
        width: 50px;
        padding: 0;
        border-radius: 50%;
        height: 50px;
        min-height: 50px;
        max-height: 50px;
    }
    .floating-order-btn:hover span,
    .floating-order-btn:hover .d-none {
        opacity: 0;
        width: 0;
    }
}

/* Chat Widget Styles */
.ai-chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 380px;
    height: 650px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
    z-index: 99999;
    overflow: hidden;
    transition: all 0.3s ease;
    font-family: Arial, sans-serif;
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
    border: 2px solid #D4AF37;
}

.ai-chat-widget.closed {
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
    visibility: hidden;
}

.ai-chat-widget:not(.closed) {
    opacity: 1 !important;
    pointer-events: auto !important;
    visibility: visible !important;
}

.ai-chat-header {
    background: #000000;
    color: #D4AF37;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
}

.ai-chat-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.language-selector {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
    min-width: 45px;
}

.language-selector:hover {
    background: rgba(255, 255, 255, 0.2);
}

.language-selector option {
    background: #333;
    color: white;
}

.ai-chat-controls button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.1em;
    margin-left: 0;
}

.ai-chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #e5ddd5 !important; /* WhatsApp-like background */
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.message {
    padding: 10px 15px;
    border-radius: 16px;
    max-width: 80%;
    line-height: 1.5;
    font-size: 0.95em;
    word-wrap: break-word;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

.message.assistant {
    background: #fff !important;
    color: #000 !important;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border: 1px solid #e0e0e0;
}

/* Ensure all text inside assistant messages is black */
.message.assistant,
.message.assistant *,
.message.assistant div,
.message.assistant span,
.message.assistant p {
    color: #000 !important;
}

.message.user {
    background: linear-gradient(135deg, #D4AF37 0%, #C19B2A 100%) !important;
    color: #000 !important;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    font-weight: 500;
}

.ai-chat-input-area {
    padding: 8px 12px !important;
    background: #f0f0f0 !important;
    border-top: 1px solid #e0e0e0 !important;
    display: flex !important;
    gap: 8px !important;
    align-items: center !important;
    flex-shrink: 0;
    min-height: auto !important;
    order: 2; /* Place it after speaking indicator */
}

/* Input Container - Rounded box with white background */
.input-container {
    flex: 1 !important;
    display: flex !important;
    align-items: center !important;
    background: white !important;
    border-radius: 25px !important;
    padding: 6px 12px !important;
    position: relative;
    min-width: 0;
    border: 1px solid #e0e0e0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    height: 38px !important;
    min-height: 38px !important;
    max-height: 38px !important;
}

.input-container #ai-chat-input {
    flex: 1 !important;
    border: none !important;
    background: transparent !important;
    padding: 6px 0 !important;
    outline: none !important;
    font-size: 0.95em !important;
    color: #333 !important;
    width: 100% !important;
    min-width: 0 !important;
    line-height: 1.4 !important;
    height: auto !important;
    min-height: auto !important;
}

.input-container .recording-waveform {
    flex: 1;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    height: 26px !important;
    min-height: 26px !important;
    max-height: 26px !important;
    position: relative;
}

.input-container .recording-waveform canvas {
    width: 100%;
    height: 26px !important;
    border-radius: 13px;
}

.recording-text-overlay {
    position: absolute;
    top: -22px;
    left: 0;
    right: 0;
    text-align: center;
    z-index: 6;
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
}

.recording-text-waving {
    display: inline-block;
    font-size: 0.7em;
    color: #D4AF37;
    font-weight: 600;
    white-space: nowrap;
    animation: wave-text 2s ease-in-out infinite;
    text-shadow: 0 1px 2px rgba(238, 162, 52, 0.3);
}

@keyframes wave-text {
    0%, 100% {
        transform: translateY(0);
        opacity: 1;
    }
    50% {
        transform: translateY(-3px);
        opacity: 0.85;
    }
}

.input-container .input-icons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.input-container .input-icon {
    color: #666;
    font-size: 1.1em;
    padding: 5px;
    border-radius: 50%;
    transition: background-color 0.2s;
    display: flex !important;
    align-items: center;
    justify-content: center;
    visibility: visible !important;
}

.input-container .input-icon:hover {
    background-color: rgba(238, 162, 52, 0.1);
    color: #D4AF37;
}

/* Mic button states - recording, paused */
.input-container .input-icon.recording {
    background-color: rgba(238, 162, 52, 0.2);
    color: #D4AF37;
    animation: pulse-recording 1.5s ease-in-out infinite;
}

.input-container .input-icon.paused {
    background-color: rgba(238, 162, 52, 0.15);
    color: #D4AF37;
}

@keyframes pulse-recording {
    0%, 100% {
        background-color: rgba(238, 162, 52, 0.2);
    }
    50% {
        background-color: rgba(238, 162, 52, 0.35);
    }
}

.icon-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    transition: all 0.2s;
}

.send-btn {
    background: linear-gradient(135deg, #D4AF37 0%, #C19B2A 100%) !important;
    color: #000 !important;
    border: none !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    padding: 0 !important;
    margin: 0 !important;
    margin-left: 8px !important;
    visibility: visible !important;
    opacity: 1 !important;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
}

.send-btn:hover {
    background: linear-gradient(135deg, #C19B2A 0%, #A88523 100%) !important;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
}

.icon-btn.send-btn {
    background: linear-gradient(135deg, #D4AF37 0%, #C19B2A 100%) !important;
    color: #000 !important;
}

.record-btn {
    background: #dc3545;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    animation: pulse-red 1.5s infinite;
}

@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(220, 53, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); }
}

/* Voice Recording UI */
.voice-recording-ui {
    padding: 15px !important;
    background: white !important;
    border-top: 1px solid #eee !important;
    display: none !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 10px !important;
    flex-shrink: 0;
}

.voice-recording-ui:not([style*="display: none"]) {
    display: flex !important;
}

.recording-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #dc3545;
    font-weight: bold;
}

.recording-pulse {
    width: 12px;
    height: 12px;
    background: #dc3545;
    border-radius: 50%;
    animation: recording-pulse 1.5s infinite;
}

@keyframes recording-pulse {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

.waveform-container {
    width: 100%;
    max-width: 250px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#waveform-canvas {
    width: 100%;
    height: 100%;
    border-radius: 5px;
}

.recording-timer {
    font-size: 0.9em;
    color: #666;
    font-weight: bold;
}

#ai-mic-btn.listening {
    color: #28a745;
    animation: listening-pulse 2s infinite;
}

@keyframes listening-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

/* AI Chat Toggle Button Wrapper - HIDDEN (using footer buttons instead) */
.ai-chat-toggle-wrapper {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.ai-chat-circular-text {
    display: none !important;
}

/* Quick Action Floating Buttons - REMOVED */

/* Typing Animation */
.typing-indicator {
    display: inline-block;
    padding: 5px 10px;
}

.typing-dots {
    display: inline-flex;
    gap: 2px;
    align-items: center;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: #D4AF37;
    border-radius: 50%;
    animation: typing-bounce 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(2) { animation-delay: 0.16s; }
.typing-dots span:nth-child(3) { animation-delay: 0.32s; }

@keyframes typing-bounce {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.6; }
    40% { transform: scale(1); opacity: 1; }
}

.typing-indicator span {
    display: inline-block;
    animation: wave 1.2s infinite ease-in-out;
    font-size: 0.9em;
    color: #666;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.1s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(4) { animation-delay: 0.3s; }
.typing-indicator span:nth-child(5) { animation-delay: 0.4s; }

/* Stop Audio Button */
.stop-audio-btn {
    display: none;
    margin-top: 8px;
    padding: 8px 16px;
    background: #D4AF37;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.3s;
    width: fit-content;
}

.stop-audio-btn[style*="display: flex"],
.stop-audio-btn[style*="display:block"] {
    display: flex !important;
    align-items: center;
    gap: 6px;
}

.stop-audio-btn:hover {
    background: #C19B2A;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(238, 162, 52, 0.3);
}

.stop-audio-btn i {
    margin-right: 4px;
}

/* Audio Playing Indicator */
.audio-playing-indicator {
    display: none;
    margin-top: 10px;
    padding: 8px 12px;
    background: rgba(238, 162, 52, 0.1);
    border-radius: 8px;
    align-items: center;
    gap: 8px;
}

.audio-playing-indicator .typing-dots {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

.audio-playing-indicator .typing-dots span {
    width: 6px;
    height: 6px;
    background: #D4AF37;
    border-radius: 50%;
    animation: wave-pulse 1.2s infinite;
}

.audio-playing-indicator .typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.audio-playing-indicator .typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

/* Speaking Indicator Above Input Area */
.ai-speaking-indicator {
    display: none;
    margin: 0;
    padding: 12px 15px;
    background: rgba(238, 162, 52, 0.15);
    border-top: 1px solid rgba(238, 162, 52, 0.2);
    border-bottom: 1px solid rgba(238, 162, 52, 0.2);
    flex-shrink: 0;
    order: 1; /* Place it between messages and input */
}

.speaking-content {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: space-between;
}

.speaking-content .typing-dots {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

.speaking-content .typing-dots span {
    width: 6px;
    height: 6px;
    background: #D4AF37;
    border-radius: 50%;
    animation: wave-pulse 1.2s infinite;
}

.speaking-content .typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.speaking-content .typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

.speaking-text {
    flex: 1;
    color: #000 !important;
    font-size: 0.9em;
    font-weight: 500;
}

.stop-speaking-btn {
    padding: 6px 12px;
    background: #D4AF37;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 500;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.stop-speaking-btn:hover {
    background: #C19B2A;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(238, 162, 52, 0.3);
}

.stop-speaking-btn i {
    font-size: 0.85em;
}

@keyframes wave {
    0%, 100% { transform: translateY(0); opacity: 0.6; }
    50% { transform: translateY(-4px); opacity: 1; }
}

/* Camera Modal Styles */
.camera-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 999999 !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.camera-modal-content {
    background: white;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    z-index: 999999 !important;
    position: relative;
}

.camera-modal-header {
    background: #000000;
    color: #D4AF37;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1em;
}

.camera-modal-header h3 {
    margin: 0;
    font-size: 1.2em;
}

.camera-modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5em;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.camera-modal-body {
    padding: 20px;
}

.image-description-section {
    margin-top: 20px;
}

.image-description-section .image-preview {
    max-width: 100%;
    max-height: 200px;
    border-radius: 5px;
    margin-bottom: 10px;
    display: block;
    border: 1px solid #ddd;
}

.image-description-section textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    margin-bottom: 10px;
}

.image-description-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.image-description-section .camera-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    min-width: 100px;
    white-space: nowrap;
}

.image-description-buttons {
    display: flex;
    gap: 10px;
    align-items: stretch;
    width: 100%;
}

.image-description-buttons .camera-btn {
    flex: 1;
}

.image-description-buttons .camera-btn.cancel {
    flex: 0 0 auto;
    min-width: 100px;
}

.image-description-section .camera-btn:not(.cancel) {
    background: #D4AF37;
    color: white;
}

.image-description-section .camera-btn:not(.cancel):hover {
    background: #C19B2A;
}

.image-description-section .camera-btn.cancel {
    background: #6c757d;
    color: white;
}

.image-description-section .camera-btn.cancel:hover {
    background: #5a6268;
}

.camera-options {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 0;
    width: 100%;
    clear: both;
}

/* Ensure proper spacing and no overlap */
.camera-modal-body {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.image-description-section {
    width: 100%;
    clear: both;
}

.image-description-buttons {
    display: flex !important;
    gap: 10px !important;
    align-items: stretch !important;
    width: 100% !important;
    margin-top: 10px !important;
}

.image-description-buttons .camera-btn {
    flex: 1;
    min-width: 0;
}

.image-description-buttons .camera-btn.cancel {
    flex: 0 0 auto;
    min-width: 100px;
}

.camera-option-btn {
    background: #D4AF37;
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    flex: 1;
    justify-content: center;
}

.camera-option-btn:hover {
    background: #C19B2A;
    color: white;
}

.camera-preview {
    text-align: center;
}

#camera-video {
    width: 100%;
    max-width: 400px;
    border-radius: 10px;
    margin-bottom: 15px;
}

.camera-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.camera-btn {
    background: #D4AF37;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.3s;
}

.camera-btn:hover {
    background: #C19B2A;
}

.camera-btn.cancel {
    background: #6c757d;
}

.camera-btn.cancel:hover {
    background: #5a6268;
}

/* Voice Status Indicator */
.voice-status {
    position: absolute;
    top: 60px;
    left: 15px;
    right: 15px;
    background: rgba(40, 167, 69, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: bold;
    text-align: center;
    z-index: 1000;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    animation: status-fade-in 0.3s ease-out;
}

@keyframes status-fade-in {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.voice-status.speaking {
    background: rgba(238, 162, 52, 0.9);
}

/* Voice Message Animations */
@keyframes wave-pulse {
    0%, 100% { height: 4px; opacity: 0.4; }
    50% { height: 16px; opacity: 1; }
}

.play-voice-btn:hover {
    background: #C19B2A !important;
}

.wave-bar {
    animation: wave-pulse 1.5s infinite;
    animation-play-state: paused;
}

/* Image Preview Panel with Description */
.ai-image-preview-panel {
    display: none;
    flex-direction: column;
    background: #f8f9fa;
    border-top: 2px solid #D4AF37;
    padding: 0;
    flex-shrink: 0;
    max-height: 280px;
    overflow: hidden;
}
.image-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #D4AF37;
    color: white;
    font-weight: 600;
    font-size: 0.9em;
}
.image-preview-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.4em;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}
.image-preview-close:hover {
    opacity: 0.8;
}
.image-preview-body {
    display: flex;
    gap: 10px;
    padding: 12px;
    align-items: flex-start;
}
.image-preview-body img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    flex-shrink: 0;
}
.image-preview-body textarea {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 0.88em;
    resize: none;
    outline: none;
    font-family: Arial, sans-serif;
    line-height: 1.4;
    min-height: 70px;
}
.image-preview-body textarea:focus {
    border-color: #D4AF37;
    box-shadow: 0 0 0 2px rgba(238, 162, 52, 0.15);
}
.image-preview-actions {
    padding: 8px 12px 12px;
    text-align: right;
}
.image-send-btn {
    background: linear-gradient(135deg, #D4AF37 0%, #C19B2A 100%);
    color: white;
    border: none;
    padding: 9px 22px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.image-send-btn:hover {
    background: linear-gradient(135deg, #C19B2A 0%, #c0850e 100%);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(238, 162, 52, 0.3);
}
.image-send-btn i {
    font-size: 0.9em;
}

/* Proactive Toast Notification — WhatsApp-style bubble */
.wsw-proactive-toast {
    position: fixed;
    bottom: 100px; /* Positioned above AI button (64px + 20px bottom + 16px gap) */
    right: 20px;
    max-width: 320px;
    background: white;
    border-radius: 1rem; /* rounded-2xl like WhatsApp */
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); /* shadow-xl */
    z-index: 9998;
    padding: 1rem;
    cursor: pointer;
    transform: translateX(0);
    opacity: 0;
    transition: all 0.5s ease;
    animation: slideIn 0.5s ease-out 5s, fadeOut 0.5s ease-out 9.5s forwards;
}

.wsw-proactive-toast.wsw-toast-visible {
    transform: translateX(0);
    opacity: 1;
}

.wsw-toast-message {
    font-size: 0.875rem; /* text-sm */
    color: #000000 !important; /* Black text like WhatsApp */
    line-height: 1.5;
    font-weight: 500;
}

.wsw-toast-avatar {
    display: none; /* Hide avatar for cleaner WhatsApp-like look */
}

.wsw-toast-name {
    display: none; /* Hide name for cleaner look */
}

.wsw-toast-content {
    flex: 1;
    min-width: 0;
}

.wsw-toast-close {
    display: none; /* Hide close button, will auto-dismiss */
}

/* Chat bubble tail (small triangle at bottom) */
.wsw-proactive-toast::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 32px;
    width: 16px;
    height: 16px;
    background: white;
    transform: rotate(45deg);
}

@keyframes slideIn {
    from {
        transform: translateX(-400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
        transform: translateX(-400px);
    }
}

@media (max-width: 768px) {
    .wsw-proactive-toast {
        right: 16px;
        bottom: 92px; /* 60px button + 16px bottom + 16px gap */
        max-width: calc(100% - 32px);
    }
}

@media (max-width: 480px) {
    .wsw-proactive-toast {
        right: 16px;
        bottom: 86px; /* 56px button + 16px bottom + 14px gap */
        max-width: calc(100% - 32px);
    }
}

@media (max-width: 375px) {
    .wsw-proactive-toast {
        bottom: 84px; /* 56px button + 16px bottom + 12px gap */
    }
}

@media (max-width: 480px) {
    .ai-chat-widget {
        width: 90%;
        height: 500px; /* Fixed height for mobile */
        bottom: 15px;
        right: 5%;
    }
    .message {
        padding: 10px 15px;
        font-size: 0.9em;
    }
    .camera-modal-content {
        width: 95%;
        margin: 10px;
    }
    .camera-options {
        flex-direction: column;
    }
    .voice-status {
        top: 50px;
        left: 10px;
        right: 10px;
        padding: 6px 10px;
        font-size: 0.8em;
    }
    .voice-recording-ui {
        padding: 10px;
    }
    .waveform-container {
        max-width: 200px;
    }

    /* Image Preview Panel - Mobile Centered Layout */
    .ai-image-preview-panel {
        max-height: 320px;
    }
    .image-preview-body {
        flex-direction: column;
        align-items: center;
        padding: 15px;
        gap: 12px;
    }
    .image-preview-body img {
        width: 120px;
        height: 120px;
        margin: 0 auto;
    }
    .image-preview-body textarea {
        width: 100%;
        min-height: 60px;
    }
    .image-preview-actions {
        text-align: center;
        padding: 10px 15px 15px;
    }
    .image-send-btn {
        width: 100%;
        justify-content: center;
    }
}
