/* Chatbot Styles - Meta Inspired Design */
.chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Chatbot Toggle Button */
.chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #D60000 0%, #B00000 100%);
    border: none;
    box-shadow: 0 4px 12px rgba(214, 0, 0, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(214, 0, 0, 0.5);
}

.chatbot-toggle:active {
    transform: scale(0.95);
}

.chatbot-toggle i {
    color: white;
    font-size: 28px;
    transition: transform 0.3s ease;
}

.chatbot-toggle.active i {
    transform: rotate(180deg);
}

/* Notification Badge */
.chatbot-notification {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background: #ff0000;
    border-radius: 50%;
    border: 2px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: white;
    font-weight: bold;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

/* Chat Window */
.chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 370px;
    height: 600px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.chatbot-window.active {
    display: flex;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Chat Header */
.chatbot-header {
    background: linear-gradient(135deg, #D60000 0%, #B00000 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 16px 16px 0 0;
}

.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.chatbot-header-text h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chatbot-header-text p {
    margin: 0;
    font-size: 12px;
    opacity: 0.9;
}

.chatbot-header-actions {
    display: flex;
    gap: 10px;
}

.chatbot-header-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.chatbot-header-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Language Toggle */
.chatbot-lang-toggle {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    cursor: pointer;
    transition: background 0.2s ease;
}

.chatbot-lang-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Chat Messages Area */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f0f2f5;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: #c1c7cd;
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #a8b0b9;
}

/* Message Bubbles */
.chatbot-message {
    display: flex;
    flex-direction: column;
    max-width: 75%;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chatbot-message.bot {
    align-self: flex-start;
}

.chatbot-message.user {
    align-self: flex-end;
}

.chatbot-bubble {
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.chatbot-message.bot .chatbot-bubble {
    background: white;
    color: #050505;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.chatbot-message.user .chatbot-bubble {
    background: #D60000;
    color: white;
    border-bottom-right-radius: 4px;
}

.chatbot-timestamp {
    font-size: 11px;
    color: #8a8d91;
    margin-top: 4px;
    padding: 0 4px;
}

.chatbot-message.user .chatbot-timestamp {
    text-align: right;
}

/* Typing Indicator */
.chatbot-typing {
    display: flex;
    gap: 4px;
    padding: 10px 14px;
    background: white;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    max-width: 50px;
}

.chatbot-typing span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #c1c7cd;
    animation: typing 1.4s infinite;
}

.chatbot-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.chatbot-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Quick Replies */
.chatbot-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.chatbot-quick-reply {
    background: white;
    border: 1px solid #e4e6eb;
    border-radius: 18px;
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #D60000;
}

.chatbot-quick-reply:hover {
    background: #f0f2f5;
    border-color: #D60000;
}

/* Input Area */
.chatbot-input-area {
    padding: 12px;
    background: white;
    border-top: 1px solid #e4e6eb;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chatbot-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.chatbot-input {
    flex: 1;
    border: 1px solid #e4e6eb;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
    resize: none;
    max-height: 100px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s ease;
}

.chatbot-input:focus {
    border-color: #D60000;
}

.chatbot-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #D60000;
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.chatbot-send-btn:hover:not(:disabled) {
    background: #B00000;
}

.chatbot-send-btn:disabled {
    background: #c1c7cd;
    cursor: not-allowed;
}

/* Phone Input */
.chatbot-phone-input {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.chatbot-phone-input input {
    flex: 1;
    min-width: 150px;
    border: 1px solid #e4e6eb;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

.chatbot-phone-input input:focus {
    border-color: #D60000;
}

.chatbot-phone-input input.error {
    border-color: #f02849;
}

.chatbot-skip-btn {
    background: #6c757d;
    font-size: 12px;
    padding: 10px 14px;
    border-radius: 20px;
    border: none;
    color: white;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.chatbot-skip-btn:hover {
    background: #5a6268;
}

/* Success Message */
.chatbot-success {
    background: #ffe5e5;
    border: 1px solid #D60000;
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    color: #D60000;
    font-size: 14px;
    margin: 8px 0;
}

.chatbot-success i {
    margin-right: 8px;
}

/* Responsive */
@media (max-width: 768px) {
    .chatbot-container {
        bottom: 15px;
        right: 15px;
        left: auto;
    }
    
    .chatbot-window {
        width: calc(100vw - 30px);
        max-width: 370px;
        height: calc(100vh - 120px);
        max-height: 600px;
        bottom: 80px;
        right: 0;
        left: auto;
    }
    
    .chatbot-toggle {
        width: 56px;
        height: 56px;
    }
}

@media (max-width: 480px) {
    .chatbot-container {
        bottom: 10px;
        right: 10px;
    }
    
    .chatbot-window {
        width: calc(100vw - 20px);
        height: calc(100vh - 100px);
        bottom: 70px;
        right: 0;
    }
    
    .chatbot-toggle {
        width: 50px;
        height: 50px;
    }
    
    .chatbot-toggle i {
        font-size: 24px;
    }
    
    .chatbot-phone-input {
        flex-direction: column;
        align-items: stretch;
    }
    
    .chatbot-phone-input input {
        min-width: 100%;
    }
    
    .chatbot-skip-btn {
        width: 100%;
        margin-top: 4px;
    }
}

