
#applantic-chatbot {
    position: fixed;
    bottom: 20px;
    right: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    z-index: 999999;
}

#chatbot-bubble {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

#chatbot-bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(102, 126, 234, 0.6);
}

#chatbot-bubble svg {
    width: 28px;
    height: 28px;
    fill: white;
}

#chatbot-bubble::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: inherit;
    animation: pulse 2s infinite;
    z-index: -1;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.15);
        opacity: 0.5;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

#chatbot-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4757;
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    display: none;
}

#chatbot-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    height: 550px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

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

@media (max-width: 480px) {
    #chatbot-window {
        width: 100vw;
        height: 100vh;
        right: 0;
        bottom: 0;
        border-radius: 0;
        max-height: 100vh;
    }
    
    #chatbot-bubble {
        bottom: 15px;
        right: 15px;
    }
    
    #chatbot-messages {
        padding-bottom: 20px;
    }
    
    #chatbot-input-area {
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }
}

#chatbot-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

#chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

#chatbot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 2px solid white;
    flex-shrink: 0;
}

#chatbot-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#chatbot-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

#chatbot-subtitle {
    font-size: 12px;
    opacity: 0.9;
    margin: 2px 0 0 0;
}

#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.2s;
    flex-shrink: 0;
}

#chatbot-close:hover {
    background: rgba(255,255,255,0.3);
}

#chatbot-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    background: #f7f9fc;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
}

@media (max-width: 480px) {
    #chatbot-messages {
        padding: 15px;
        padding-bottom: 20px;
    }
}

#chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

#chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

#chatbot-messages::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

#chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

.chatbot-message {
    display: flex;
    gap: 10px;
    animation: messageSlide 0.3s ease-out;
    align-items: flex-start;
}

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

.chatbot-message.bot {
    align-self: flex-start;
}

.chatbot-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chatbot-message-avatar {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    background: #667eea;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
    overflow: hidden;
}

.chatbot-message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chatbot-message.user .chatbot-message-avatar {
    background: #4a5568;
}

.chatbot-message-content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 12px;
    line-height: 1.5;
    font-size: 14px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

@media (max-width: 480px) {
    .chatbot-message-content {
        max-width: 75%;
        font-size: 15px;
    }
}

.chatbot-message.bot .chatbot-message-content {
    background: white;
    color: #2d3748;
    border-bottom-left-radius: 4px;
}

.chatbot-message.user .chatbot-message-content {
    background: #667eea;
    color: white;
    border-bottom-right-radius: 4px;
}

.chatbot-typing {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border-radius: 12px;
    border-bottom-left-radius: 4px;
    width: fit-content;
}

.chatbot-typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #cbd5e0;
    animation: typing 1.4s infinite;
}

.chatbot-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.chatbot-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

.chatbot-lead-form {
    background: white;
    padding: 16px;
    border-radius: 12px;
    margin: 10px 0;
}

.chatbot-lead-form h4 {
    margin: 0 0 8px 0;
    font-size: 15px;
    color: #2d3748;
}

.chatbot-lead-form p {
    margin: 0 0 12px 0;
    font-size: 13px;
    color: #718096;
    line-height: 1.4;
}

.chatbot-form-group {
    margin-bottom: 10px;
}

.chatbot-form-group label {
    display: block;
    font-size: 12px;
    color: #4a5568;
    margin-bottom: 4px;
    font-weight: 500;
}

.chatbot-form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.chatbot-form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.chatbot-form-submit {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.chatbot-form-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.chatbot-form-submit:active {
    transform: translateY(0);
}

.chatbot-message-content a {
    color: inherit;
    text-decoration: underline;
    font-weight: 600;
}

.chatbot-message.bot .chatbot-message-content a {
    color: #667eea;
}

#chatbot-input-area {
    padding: 16px 20px;
    background: white;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 10px;
    align-items: flex-end;
    flex-shrink: 0;
}

@media (max-width: 480px) {
    #chatbot-input-area {
        padding: 12px 15px;
    }
}

#chatbot-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    min-height: 40px;
    max-height: 100px;
    transition: border-color 0.2s;
    overflow-y: auto;
}

#chatbot-input:focus {
    outline: none;
    border-color: #667eea;
}

#chatbot-input::-webkit-scrollbar {
    width: 4px;
}

#chatbot-input::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 2px;
}

#chatbot-send-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

#chatbot-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

#chatbot-send-btn:active {
    transform: scale(0.95);
}

#chatbot-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#chatbot-send-btn svg {
    width: 18px;
    height: 18px;
    fill: white;
}

#chatbot-footer {
    padding: 8px 20px;
    text-align: center;
    font-size: 11px;
    color: #a0aec0;
    background: #f7f9fc;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
}

#chatbot-footer a {
    color: #667eea;
    text-decoration: none;
}

#chatbot-footer a:hover {
    text-decoration: underline;
}

.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Exit Intent Popup Styles */
#exit-intent-popup {
    animation: slideUpPopup 0.3s ease-out;
}

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