/* ===========================
   FixBot AI - Chatbot CSS
=========================== */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --bg: #ffffff;
    --text: #222;
    --border: #e5e7eb;
    --shadow: 0 10px 35px rgba(0, 0, 0, .18);
}

/* बॉक्स-साइजिंग रिसेट ताकि पैडिंग से लेआउट न बिगड़े */
.chat-container, .chat-container * {
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Floating Button */
.chat-toggle {
    position: fixed;
    bottom: 25px;
    left: 25px;
    width: 70px;
    height: 70px;
    border: none;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    box-shadow: var(--shadow);
    z-index: 99999;
    transition: .3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-toggle:hover {
    transform: scale(1.08);
    background: transparent;
}

.chat-toggle img {
    width: 65px;
    height: 65px;
}

/* Chat Window */
.chat-container {
    position: fixed;
    bottom: 57px;
    left: 25px;
    width: 380px;
    height: 620px;
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    display: none; 
    flex-direction: column;
    box-shadow: var(--shadow);
    z-index: 99999;
}

/* Header */
.chat-header {
    height: 75px;
    background: linear-gradient(135deg, #0a0157fc, #1d4ed8);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
}

.chat-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bot-logo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: transparent;
    padding: 0px;
}

.chat-header h3 {
    margin: 0;
    font-size: 18px;
}

.chat-header span {
    font-size: 13px;
    opacity: .9;
}

.close-chat {
    background: none;
    border: none;
    color: white;
    font-size: 22px;
    cursor: pointer;
}

/* Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    background: #f5f7fb;
    padding: 20px;
}

/* Bot Message */
.bot-message {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
}

.avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    flex-shrink: 0;
}

.message {
    max-width: 80%;
    background: white;
    border-radius: 0px 15px 15px 15px; /* बोट के लिए मॉडर्न लुक */
    padding: 12px 16px;
    box-shadow: 0 3px 12px rgba(0,0,0,.05);
}

.message p {
    margin: 0;
    color: #333;
    line-height: 1.5;
    font-size: 14.5px;
}

/* User Message */
.user-message {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 18px;
}

.user-message .message {
    background: #2563eb;
    color: white;
    border-radius: 15px 0px 15px 15px; /* यूजर के लिए दाईं तरफ का कोना शार्प */
    box-shadow: 0 3px 12px rgba(37, 99, 235, .2);
}

.user-message .message p {
    color: white;
}

/* Quick Buttons */
.quick-buttons {
    margin-top: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.quick-btn {
    padding: 8px 14px;
    border: 1px solid #dbeafe;
    border-radius: 30px;
    background: #edf4ff;
    color: #2563eb;
    cursor: pointer;
    transition: .2s;
    font-weight: 500;
    font-size: 13.5px;
}

.quick-btn:hover {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

/* Typing Animation */
.typing {
    display: none;
    padding: 10px 20px;
    background: #f5f7fb;
}

.typing span {
    width: 8px;
    height: 8px;
    margin-right: 4px;
    background: #93c5fd;
    border-radius: 50%;
    display: inline-block;
    animation: typing 1.4s infinite both;
}

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

@keyframes typing {
    0%, 100% { transform: translateY(0); background-color: #93c5fd; }
    50% { transform: translateY(-5px); background-color: #2563eb; }
}

/* Input Area */
.chat-input {
    display: flex;
    align-items: center;
    border-top: 1px solid var(--border);
    padding: 12px;
    background: white;
}

.chat-input input {
    flex: 1;
    height: 45px;
    border: 1px solid #ddd;
    border-radius: 30px;
    padding: 0 18px;
    font-size: 14.5px;
    outline: none;
}

.chat-input input:focus {
    border-color: var(--primary);
}

.chat-input button {
    width: 45px;
    height: 45px;
    border: none;
    border-radius: 50%;
    background: #2563eb;
    color: white;
    font-size: 16px;
    margin-left: 8px;
    cursor: pointer;
    transition: .2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Scrollbar */
.chat-messages::-webkit-scrollbar { width: 5px; }
.chat-messages::-webkit-scrollbar-thumb { background: #ccc; border-radius: 10px; }

/* Responsive Mobile View (Fixed Overlapping) */
@media(max-width: 500px){
    .chat-container { 
        width: 100%; 
        height: 100%; 
        left: 0; 
        right: 0;
        bottom: 0; 
        border-radius: 0; 
    }
    
    /* सुधारा गया: मोबाइल पर आइकॉन को छोटा किया और व्हाट्सएप के ऊपर सेट किया */
    .chat-toggle { 
        bottom: 25px; /* अब इसे व्हाट्सएप के बराबर नीचे रख सकते हैं क्योंकि कोना बदल गया है */
        left: 20px;   /* बाईं तरफ सेट किया */
        right: auto;  /* राइट वाली पोजीशन हटाई */
        width: 60px;   
        height: 60px; 
    }
    
    .chat-toggle img {
        width: 100%;
        height: 100%;
    }
}