/* Floating Chatbot Styles - Complete Final Version */
.chatbot-container {
    position: fixed !important;
    bottom: 20px !important;
    right: 90px !important;
    z-index: 99999 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.chatbot-bubble {
    width: 60px;
    height: 60px;
    background: #007bff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 123, 255, 0.3);
    transition: all 0.3s ease;
    position: relative;
}

.chatbot-bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 123, 255, 0.4);
    background: #0056b3;
}

.chatbot-bubble svg {
    width: 28px;
    height: 28px;
    fill: white;
}

.chatbot-status {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: #4ade80;
    border: 2px solid white;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

.chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 600px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chatbot-header {
    background: #007bff;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.chatbot-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chatbot-header-titles {
    min-width: 0;
}

.chatbot-header-sub {
    margin: 2px 0 0;
    font-size: 11px;
    font-weight: 400;
    opacity: 0.92;
    line-height: 1.3;
}

.chatbot-muted {
    font-size: 12px;
    opacity: 0.85;
}

.chatbot-header-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.chatbot-clear {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    padding: 5px 8px;
    border-radius: 5px;
    transition: background 0.3s ease;
}

.chatbot-clear:hover {
    background: rgba(255, 255, 255, 0.3);
}

.chatbot-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
    font-size: 18px;
}

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chatbot-message {
    display: flex;
    animation: fadeIn 0.3s ease;
    width: 100%;
}

.chatbot-message.user {
    justify-content: flex-end;
}

.chatbot-message.bot {
    justify-content: flex-start;
}

.message-bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 18px;
    word-wrap: break-word;
    line-height: 1.4;
    font-size: 14px;
}

.chatbot-message.user .message-bubble {
    background: #007bff;
    color: white;
    border-bottom-right-radius: 4px;
}

.chatbot-message.bot .message-bubble {
    background: white;
    color: #333;
    border: 1px solid #e9ecef;
    border-bottom-left-radius: 4px;
}

/* Typing Indicator */
.chatbot-typing-container {
    padding: 10px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 50px;
    flex-shrink: 0;
}

.chatbot-typing {
    display: none;
    align-items: center;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    padding: 8px 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    width: fit-content;
}

.typing-dots {
    display: flex;
    gap: 4px;
    align-items: center;
    justify-content: center;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #007bff;
    border-radius: 50%;
    animation: typing 1.4s infinite;
    box-shadow: 0 0 4px rgba(0, 123, 255, 0.3);
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
}

.chatbot-input {
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #e9ecef;
    flex-shrink: 0;
}

.chatbot-input-form {
    display: flex;
    gap: 10px;
}

.chatbot-input input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e9ecef;
    border-radius: 25px;
    outline: none;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.chatbot-input input:focus {
    border-color: #007bff;
}

.chatbot-link {
    color: #007bff;
    text-decoration: underline;
}

.chatbot-bold {
    font-weight: bold;
    color: #007bff;
}

.chatbot-send {
    background: #007bff;
    border: none;
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.chatbot-send:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.chatbot-send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.chatbot-send svg {
    width: 20px;
    height: 20px;
    fill: white;
}

/* Quick Actions - Fixed for all screen sizes */
.quick-actions {
    display: flex !important;
    gap: 10px !important;
    margin: 10px 0 !important;
    padding: 0 10px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.quick-action-btn {
    background: #007bff !important;
    color: white !important;
    border: none !important;
    border-radius: 20px !important;
    padding: 10px 16px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    flex: 1 !important;
    text-align: center !important;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.2) !important;
    min-width: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.quick-action-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3) !important;
}

.quick-action-btn:first-child {
    background: #28a745 !important;
}

.quick-action-btn:first-child:hover {
    background: #218838 !important;
}

.quick-action-btn:last-child {
    background: #6c757d !important;
}

.quick-action-btn:last-child:hover {
    background: #5a6268 !important;
}

/* Lead Capture Modal - Fixed for all screen sizes */
.lead-capture-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0, 0, 0, 0.5) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 1000000 !important;
    padding: 20px !important;
    backdrop-filter: blur(5px);
    margin: 0 !important;
    box-sizing: border-box !important;
}

.lead-capture-content {
    background: white !important;
    border-radius: 12px !important;
    padding: 30px !important;
    max-width: 500px !important;
    width: 100% !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3) !important;
    animation: modalFadeIn 0.3s ease;
    margin: auto !important;
    box-sizing: border-box !important;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.lead-capture-header {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    gap: 12px !important;
    margin-bottom: 10px !important;
}

.lead-capture-header h3 {
    margin: 0 !important;
    flex: 1 !important;
    color: #333 !important;
    font-size: 1.5rem !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
}

.lead-capture-close {
    flex-shrink: 0 !important;
    width: 36px !important;
    height: 36px !important;
    border: none !important;
    border-radius: 50% !important;
    background: #f0f0f0 !important;
    color: #333 !important;
    font-size: 18px !important;
    line-height: 1 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    pointer-events: auto !important;
    position: relative !important;
    z-index: 2 !important;
}

.lead-capture-close:hover {
    background: #e0e0e0 !important;
}

.lead-capture-content h3 {
    margin: 0 0 15px 0 !important;
    color: #333 !important;
    font-size: 1.5rem !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
}

.lead-capture-content p {
    margin: 0 0 20px 0 !important;
    color: #666 !important;
    line-height: 1.5 !important;
    font-size: 14px !important;
}

.lead-capture-form {
    width: 100% !important;
}

.lead-capture-form .mss-hp {
    position: absolute !important;
    left: -10000px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

.lead-capture-form .form-group {
    margin-bottom: 15px !important;
    width: 100% !important;
}

.lead-capture-form label {
    display: block !important;
    margin-bottom: 5px !important;
    font-weight: 500 !important;
    color: #333 !important;
    font-size: 14px !important;
}

.lead-capture-form input,
.lead-capture-form select,
.lead-capture-form textarea {
    width: 100% !important;
    padding: 10px 12px !important;
    border: 1px solid #ddd !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    box-sizing: border-box !important;
    transition: all 0.3s ease;
}

.lead-capture-form input:focus,
.lead-capture-form select:focus,
.lead-capture-form textarea:focus {
    outline: none !important;
    border-color: #007bff !important;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1) !important;
}

.lead-capture-form textarea {
    min-height: 100px !important;
    resize: vertical !important;
}

.lead-capture-form input[type="checkbox"] {
    width: auto !important;
    margin-right: 8px !important;
    display: inline-block !important;
}

.lead-capture-form input[type="file"] {
    padding: 8px !important;
    font-size: 13px !important;
    border: 2px dashed #ddd !important;
    background: #f9f9f9 !important;
    cursor: pointer !important;
}

.lead-capture-form input[type="file"]:hover {
    border-color: #007bff !important;
    background: #f0f8ff !important;
}

.lead-capture-form .form-buttons {
    display: flex !important;
    gap: 10px !important;
    margin-top: 20px !important;
    width: 100% !important;
}

.lead-capture-form .btn {
    flex: 1 !important;
    padding: 12px 20px !important;
    border: none !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    text-align: center !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    position: relative !important;
    pointer-events: auto !important;
    overflow: visible !important;
}

.lead-capture-form .btn::before {
    display: none !important;
    content: none !important;
}

.lead-capture-form .btn-primary {
    background: #007bff !important;
    color: white !important;
}

.lead-capture-form .btn-primary:hover {
    background: #0056b3 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.lead-capture-form .btn-secondary {
    background: #6c757d !important;
    color: white !important;
}

.lead-capture-form .btn-secondary:hover {
    background: #545b62 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.lead-capture-form .btn:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

.lead-capture-form small {
    color: #666 !important;
    font-size: 12px !important;
    display: block !important;
    margin-top: 5px !important;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .chatbot-container {
        bottom: 20px !important;
        right: 90px !important;
    }
    
    .chatbot-bubble {
        width: 55px;
        height: 55px;
    }
    
    .chatbot-window {
        position: fixed !important;
        top: 10px !important;
        left: 10px !important;
        right: 10px !important;
        bottom: 10px !important;
        width: auto !important;
        height: auto !important;
        border-radius: 16px;
    }
    
    .quick-actions {
        gap: 8px !important;
        padding: 0 8px !important;
    }
    
    .quick-action-btn {
        padding: 8px 12px !important;
        font-size: 13px !important;
    }
    
    .lead-capture-modal {
        padding: 10px !important;
    }
    
    .lead-capture-content {
        padding: 20px !important;
    }
    
    .lead-capture-content h3 {
        font-size: 1.3rem !important;
    }
    
    .lead-capture-form .form-buttons {
        flex-direction: column;
        gap: 8px !important;
    }
    
    .lead-capture-form .btn {
        width: 100% !important;
    }
}

@media (max-width: 400px) {
    .chatbot-container {
        bottom: 90px !important;
        right: 20px !important;
    }
    
    .quick-actions {
        flex-direction: column;
        gap: 5px !important;
    }
    
    .quick-action-btn {
        width: 100% !important;
    }
}

/* Desktop adjustments */
@media (min-width: 1025px) {
    .quick-action-btn {
        white-space: normal !important;
        word-break: break-word !important;
    }
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    .chatbot-window {
        background: #1a1a1a;
    }
    
    .chatbot-messages {
        background: #2d2d2d;
    }
    
    .chatbot-message.bot .message-bubble {
        background: #3a3a3a;
        color: white;
        border-color: #4a4a4a;
    }
    
    .chatbot-typing-container {
        background: #2d2d2d;
        border-top-color: #4a4a4a;
    }
    
    .chatbot-typing {
        background: #3a3a3a;
        border-color: #4a4a4a;
    }
    
    .chatbot-input {
        background: #1a1a1a;
        border-top-color: #4a4a4a;
    }
    
    .chatbot-input input {
        background: #3a3a3a;
        border-color: #4a4a4a;
        color: white;
    }
    
    .chatbot-input input::placeholder {
        color: #aaa;
    }
    
    .lead-capture-content {
        background: #2d2d2d !important;
    }
    
    .lead-capture-content h3,
    .lead-capture-content p,
    .lead-capture-form label {
        color: white !important;
    }
    
    .lead-capture-form input,
    .lead-capture-form select,
    .lead-capture-form textarea {
        background: #3a3a3a !important;
        border-color: #4a4a4a !important;
        color: white !important;
    }
    
    .lead-capture-form input[type="file"] {
        background: #3a3a3a !important;
        border-color: #4a4a4a !important;
        color: #ddd !important;
    }
    
    .lead-capture-form small {
        color: #aaa !important;
    }
}