/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}



/* Floating Chat Button */
.floating-chat-btn {
    position: fixed;
    bottom: 25px;
    right: 25px;
    color: white;
    padding: 14px 20px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s ease;
    border: none;
    font-size: 14px;
    font-weight: 600;
}

.floating-chat-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(238, 238, 238, 0.6);
}

.floating-chat-btn i {
    font-size: 20px;
}

/* Chatbox - FIXED STRUCTURE */
.chatbox {
    display: none;              /* CLOSED BY DEFAULT */
    position: fixed;
    bottom: 80px;
    right: 25px;
    width: 380px;
    height: 520px;
    background: white;
    border-radius: 0px;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.25);
    flex-direction: column;
    overflow: hidden;
    z-index: 1001;
}

.chatbox.open {
    display: flex;              /* OPEN ONLY ON CLICK */
}


/* Chat Header - FIXED AT TOP */
.chat-header {
    background: linear-gradient(135deg, #2A5176 0%, #1a365d 100%);
    color: white;
    padding: 10px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0; /* Prevent shrinking */
    z-index: 10;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #F0CA9C;
    object-fit: cover;
}

.header-info h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    opacity: 0.9;
}

.status-dot {
    width: 7px;
    height: 7px;
    background: #4CAF50;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s;
    font-size: 18px;
    right: 13px;
    top: 13px;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Messages Container - SCROLLABLE AREA */
.messages {
    flex: 1; /* Take remaining space */
    padding: 16px;
    overflow-y: auto;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 12px;
    /* Ensure messages start from top and scroll */
    min-height: 0; /* Important for flex scrolling */
}

/* Message Styles */
.message {
    display: flex;
    gap: 10px;
    max-width: 85%;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.bot-message {
    align-self: flex-start;
}

.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid #F0CA9C;
}

.message-content {
    background: white;
    padding: 12px 15px;
    border-radius: 16px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
    position: relative;
}

.bot-message .message-content {
    border-radius: 0 16px 16px 16px;
    background: white;
}

.user-message .message-content {
    border-radius: 16px 0 16px 16px;
    background: linear-gradient(135deg, #2A5176 0%, #3a6ba5 100%);
    color: white;
}

.message-text {
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 4px;
}

.message-time {
    font-size: 10px;
    opacity: 0.7;
    text-align: right;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 5px;
    padding: 8px 12px;
    background: white;
    border-radius: 16px;
    width: fit-content;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
}

.typing-dot {
    width: 7px;
    height: 7px;
    background: #2A5176;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Lead Form - FIXED AT BOTTOM */
.lead-form {
    padding: 20px;
    background: white;
    border-top: 1px solid #eee;
    display: block;
    flex-shrink: 0; /* Fixed at bottom */
}

.form-header {
    text-align: center;
    margin-bottom: 20px;
}

.form-header h4 {
    color: #2A5176;
    font-size: 18px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.form-header p {
    color: #666;
    font-size: 13px;
}

.form-group {
    position: relative;
    margin-bottom: 16px;
}

.form-group input {
    width: 100%;
    padding: 6px 8px 6px 30px;  /* even smaller */
    border: 2px solid #d9d9d9;
    border-radius: 0px;
    font-size: 12px;            /* smaller font */
    height: 36px;               /* shorter height */
    transition: all 0.25s;
}

.form-group input:focus {
    outline: none;
    border-color: #2A5176;
    box-shadow: 0 0 0 3px rgba(42, 81, 118, 0.1);
}

.input-icon {
    position: absolute;
    left: 9px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-size: 12px;        /* smaller icon */
    opacity: 0.8;
}


/*Image size*/

.chat-image {
    max-width: 160px;
    width: auto;
    border-radius: 8px;
    margin: 5px 0;
}


/* Submit Button */
.submit-btn {
    width: 100%;
    padding: 8px 10px;        /* smaller padding */
    background: linear-gradient(135deg, #F0CA9C 0%, #e8b786 100%);
    color: #2A5176;
    border: none;
    border-radius: 0px;       /* smaller round corner */
    font-size: 13px;          /* reduced text size */
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 34px;             /* ↓ shorter button */
    transition: 0.25s ease;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(240, 202, 156, 0.4);
}

.privacy-note {
    text-align: center;
    margin-top: 12px;
    font-size: 11px;
    color: #888;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 0px;
}



/* Input Area - FIXED AT BOTTOM */
.input-area {
    padding: 12px;
    background: white;
    border-top: 1px solid #eee;
    display: none;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0; /* Fixed at bottom */
}

/* Emoji Picker */
.emoji-picker {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 14px;
    padding: 12px;
    display: none;
    position: absolute;
    bottom: 70px;
    right: 12px;
    z-index: 1002;
    box-shadow: 0 8px 35px rgba(0, 0, 0, 0.1);
}

.emoji-list {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.emoji-list span {
    font-size: 22px;
    cursor: pointer;
    text-align: center;
    padding: 6px;
    border-radius: 8px;
    transition: background 0.2s;
}

.emoji-list span:hover {
    background: #f5f5f5;
}



/* New Input Row */
.input-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Tools Left */
.input-tools {
    display: flex;
    gap: 6px;
}

.tool-btn {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 13px;
}
.tool-btn:hover {
    background: #2A5176;
    color: white;
    border-color: #2A5176;
}

.chat-input {
    flex: 1;
    padding: 7px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    font-size: 13px;
    height: 32px;
    width: 0px;
}



/* Text Input - FIXED AT BOTTOM */
.text-input {
    display: flex;
    gap: 8px;
    align-items: center;
}

.text-input input {
    flex: 1;
    padding: 8px 12px;       /* ↓ pehle 13px 16px tha */
    border: 2px solid #e0e0e0;
    border-radius: 18px;     /* ↓ chhota look */
    font-size: 13px;         /* ↓ smaller font */
    height: 34px;            /* NEW → textbox height */
}

.text-input input:focus {
    outline: none;
    border-color: #2A5176;
    box-shadow: 0 0 0 3px rgba(42, 81, 118, 0.1);
}

.send-btn {
    background: linear-gradient(135deg, #2A5176 0%, #3a6ba5 100%);
    color: white;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: 0.3s;
}


.send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(42, 81, 118, 0.3);
}

/* Quick Replies - ABOVE INPUT AREA */
.quick-replies {
    padding: 5px;
    background: white;
    border-top: 1px solid #eee;
    display: none;
    flex-wrap: wrap;
    gap: 8px;
    flex-shrink: 0; /* Fixed above input */
}

.quick-btn {
    background: #f0f2f5;
    border: none;
    padding: 6px 12px;
    border-radius: 18px;
    font-size: 12px;
    color: #2A5176;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.quick-btn:hover {
    background: #2A5176;
    color: white;
    transform: translateY(-1px);
}

/* Scrollbar Styling */
.messages::-webkit-scrollbar {
    width: 6px;
}

.messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.messages::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Auto-scroll to bottom for new messages */
.messages {
    scroll-behavior: smooth;
}

/* Responsive - Mobile */
@media (max-width: 480px) {
    .chatbox {
        width: 92vw;
        height: 70vh;
        bottom: 15px;
        right: 4vw;
    }
    
    .floating-chat-btn {
        bottom: 15px;
        right: 15px;
        padding: 12px 16px;
        font-size: 13px;
    }
    
    .floating-chat-btn span {
        display: none;
    }
    
    .floating-chat-btn i {
        font-size: 22px;
    }
    
    .messages {
        padding: 12px;
    }
}


/* Language Selector */
.language-selector {
    margin-left: auto;
    margin-right: 15px;
}

.language-selector select {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    min-width: 120px;
}

.language-selector select option {
    background: #2A5176;
    color: white;
    padding: 8px;
}

.language-selector select:focus {
    outline: none;
    border-color: #F0CA9C;
}

/******************************/
.chat-bubble {
    margin: 6px 0;
    max-width: 80%;
    padding: 8px 12px;
    border-radius: 10px;
    background: #f1f1f1;
}

.chat-bubble.right {
    margin-left: auto;
    background: #dff0ff;
    text-align: right;
}

.chat-bubble.left {
    margin-right: auto;
}

.sender {
    font-size: 11px;
    opacity: 0.6;
    margin-bottom: 2px;
}


/* CHAT OPTIONS */
.option-wrap{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    margin:10px 0;
}
.chat-option{
    background:#F0CA9C;
    border:none;
    padding:8px 14px;
    border-radius:20px;
    cursor:pointer;
    font-size:13px;
    transition:.2s;
}
.chat-option:hover{
    background:#2A5176;
    color:#fff;
}

/* TYPING */
.typing{
    font-size:12px;
    color:#777;
    margin:5px 0;
}
.typing span{
    animation: blink 1.4s infinite both;
}
.typing span:nth-child(2){animation-delay:.2s;}
.typing span:nth-child(3){animation-delay:.4s;}

@keyframes blink{
    0%{opacity:.2}
    20%{opacity:1}
    100%{opacity:.2}
}


.bot-options{
    margin-left: 60px;
    margin-top: 0px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.option-btn {
    padding: 0px 5px;
    border-radius: 0px;
    border: none;
    background: #2A5176;
    cursor: pointer;
    font-size: 12px;
    color: #ffffff
}


.option-btn:hover{
    color:#ffffff;
    background:#E6A861 ;
}
