/* ============================ */
/* LEFT CHATBOT WIDGET STYLES */
/* ============================ */

.chatbot-widget-left {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9999;
}

.chat-toggle-btn-left {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a237e, #3949ab);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(26, 35, 126, 0.4);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    position: relative;
    will-change: transform;
}

.chat-toggle-btn-left:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 6px 20px rgba(26, 35, 126, 0.6);
}

.chat-toggle-btn-left:active {
    transform: scale(0.95);
}

.chat-toggle-btn-left svg {
    width: 30px;
    height: 30px;
    fill: white;
    transition: all 0.3s ease;
}

.chat-toggle-btn-left.active {
    transform: rotate(90deg);
}

.chat-icon {
    transition: all 0.3s ease;
}

.chat-toggle-btn-left.active .chat-icon {
    opacity: 0;
    transform: scale(0) rotate(180deg);
}

.close-icon {
    position: absolute;
    font-size: 30px;
    color: white;
    font-weight: 300;
    opacity: 0;
    transform: scale(0) rotate(-180deg);
    transition: all 0.3s ease;
}

.chat-toggle-btn-left.active .close-icon {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

/* DESKTOP CHAT WINDOW (1024px and above) */
.chat-window-left {
    position: fixed;
    bottom: 90px;
    left: 20px;
    width: 500px;
    height: 650px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 30px rgba(0,0,0,0.3);
    display: none;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transform-origin: bottom left;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    will-change: transform, opacity;
}

.chat-window-left.active {
    display: flex;
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Backdrop blur effect */
.chat-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    z-index: 9998;
    pointer-events: none;
    opacity: 0;
    transition: all 0.3s ease;
    display: none;
}

.chat-backdrop.active {
    display: block;
    pointer-events: auto;
}

.chat-header {
    background: linear-gradient(135deg, #1a237e, #3949ab);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    animation: slideDown 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.chat-header-info h3 {
    font-size: 18px;
    margin: 0;
    animation: fadeIn 0.5s ease 0.1s both;
}

.chat-status {
    font-size: 12px;
    opacity: 0;
    animation: fadeIn 0.5s ease 0.2s both;
}

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

.minimize-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    animation: fadeIn 0.5s ease 0.3s both;
}

.minimize-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: rotate(90deg) scale(1.1);
}

.minimize-btn:active {
    transform: rotate(90deg) scale(0.9);
}

.chat-messages {
    flex: 1;
    padding: 0 25px 25px 25px;
    overflow-y: auto;
    background: #f9f9f9;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
    opacity: 0;
    animation: fadeInUp 0.5s ease 0.2s both;
    display: flex;
    flex-direction: column;
}

/* Messages wrapper to push content to bottom */
.chat-messages::before {
    content: '';
    flex: 1;
    min-height: 0;
}

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

/* Custom Scrollbar */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
    transition: background 0.3s ease;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.message {
    margin-bottom: 15px;
    display: flex;
    gap: 10px;
    opacity: 0;
    transform: translateY(10px);
    animation: messageSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    flex-shrink: 0;
}

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

.message.bot {
    justify-content: flex-start;
}

.message.user {
    justify-content: flex-end;
}

.message-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.message:hover .message-avatar {
    transform: scale(1.1);
}

.message-content {
    padding: 12px 16px;
    border-radius: 15px;
    max-width: 70%;
    word-wrap: break-word;
    line-height: 1.5;
    transition: all 0.3s ease;
}

.message-content:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.message-content p {
    margin: 0;
    margin-bottom: 5px;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message.bot .message-content {
    background: white;
    color: #333;
    border: 1px solid #e0e0e0;
    border-top-left-radius: 5px;
}

.message.user .message-content {
    background: #1a237e;
    color: white;
    border-top-right-radius: 5px;
}
.message.user .message-content p {
    
    color: white;
   
}

.typing-indicator {
    padding: 10px 20px;
    display: none;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.typing-indicator.active {
    display: flex;
    opacity: 1;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: typing 1.4s ease-in-out infinite;
}

.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);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

.chat-input-container {
    padding: 15px;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    opacity: 0;
    animation: slideUp 0.5s ease 0.3s both;
}

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

.chat-input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chat-input:focus {
    border-color: #1a237e;
    box-shadow: 0 0 0 3px rgba(26, 35, 126, 0.1);
    transform: scale(1.02);
}

.send-button {
    background: #1a237e;
    color: white;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    flex-shrink: 0;
}

.send-button:hover {
    background: #3949ab;
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 4px 15px rgba(26, 35, 126, 0.4);
}

.send-button:active {
    transform: scale(0.9);
}

.send-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* FULLSCREEN TABLET (768px to 1023px) */
@media (max-width: 1023px) and (min-width: 768px) {
    .chatbot-widget-left {
        bottom: 15px;
        left: 15px;
    }
    
    .chat-toggle-btn-left {
        width: 58px;
        height: 58px;
    }
    
    .chat-window-left {
        width: 100vw;
        height: 100vh;
        left: 0;
        bottom: 0;
        border-radius: 0;
        max-width: 100vw;
        max-height: 100vh;
        transform: scale(0.9);
        transform-origin: center;
    }
    
    .chat-window-left.active {
        transform: scale(1);
    }
    
    .chat-backdrop.active {
        background: rgba(0, 0, 0, 0.3);
        opacity: 1;
    }
    
    .chat-header {
        padding: 18px 24px;
    }
    
    .chat-header-info h3 {
        font-size: 19px;
    }
    
    .minimize-btn {
        width: 36px;
        height: 36px;
        font-size: 24px;
    }
    
    .chat-messages {
        padding: 0 20px 24px 20px;
    }
    
    .message-content {
        max-width: 75%;
        font-size: 16px;
        padding: 13px 17px;
    }
    
    .message-avatar {
        width: 38px;
        height: 38px;
        font-size: 20px;
    }
    
    .chat-input-container {
        padding: 18px 20px;
        gap: 12px;
    }
    
    .chat-input {
        padding: 14px 18px;
        font-size: 16px;
    }
    
    .send-button {
        width: 48px;
        height: 48px;
    }
}

/* FULLSCREEN MOBILE (up to 767px) */
@media (max-width: 767px) {
    .chatbot-widget-left {
        bottom: 15px;
        left: 15px;
    }
    
    .chat-toggle-btn-left {
        width: 55px;
        height: 55px;
    }
    
    .chat-toggle-btn-left svg {
        width: 26px;
        height: 26px;
    }
    
    .chat-window-left {
        width: 100vw;
        height: 100vh;
        left: 0;
        bottom: 0;
        border-radius: 0;
        max-width: 100vw;
        max-height: 100vh;
        transform: translateY(100%);
        transform-origin: bottom;
    }
    
    .chat-window-left.active {
        transform: translateY(0);
    }
    
    .chat-backdrop.active {
        background: rgba(0, 0, 0, 0.4);
        opacity: 1;
    }
    
    .chat-header {
        padding: 16px 20px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
    
    .chat-header-info h3 {
        font-size: 17px;
    }
    
    .chat-status {
        font-size: 11px;
    }
    
    .minimize-btn {
        width: 35px;
        height: 35px;
        font-size: 22px;
    }
    
    .chat-messages {
        padding: 0 16px 20px 16px;
    }
    
    .message-content {
        max-width: 80%;
        font-size: 15px;
        padding: 11px 15px;
    }
    
    .message-avatar {
        width: 34px;
        height: 34px;
        font-size: 18px;
    }
    
    .message {
        margin-bottom: 12px;
    }
    
    .chat-input-container {
        padding: 16px;
        gap: 10px;
        box-shadow: 0 -2px 8px rgba(0,0,0,0.05);
    }
    
    .chat-input {
        padding: 12px 16px;
        font-size: 15px;
    }
    
    .send-button {
        width: 44px;
        height: 44px;
    }
}

/* Extra Small Mobile (up to 375px) */
@media (max-width: 375px) {
    .chat-header {
        padding: 14px 16px;
    }
    
    .chat-header-info h3 {
        font-size: 16px;
    }
    
    .chat-messages {
        padding: 0 12px 16px 12px;
    }
    
    .message-content {
        max-width: 82%;
        font-size: 14px;
        padding: 10px 14px;
    }
    
    .message-avatar {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    .chat-input-container {
        padding: 14px;
    }
    
    .chat-input {
        padding: 11px 14px;
        font-size: 14px;
    }
    
    .send-button {
        width: 42px;
        height: 42px;
    }
}

/* Prevent body scroll when chat is open on mobile/tablet */
@media (max-width: 1023px) {
    body.chat-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
    }
}

/* Pulse animation for new messages */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.message.new {
    animation: messageSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), pulse 0.6s ease 0.4s;
}












/* ============================================================
   1. WIDGET POSITIONING & TOGGLE BUTTON
   ============================================================ */

.chatbot-widget-left {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: auto;
    z-index: 9999;
}

/* Base button reset - no circle, no rotation */
.chat-toggle-btn-left {
    width: auto !important;
    height: auto !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: transform 0.3s ease;
    transform: rotate(0deg) !important;
}

/* Image Logo Styling */
.chat-logo-icon {
    width: 140px; 
    height: auto;
    display: block;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.1));
    transition: filter 0.3s ease, transform 0.3s ease;
}

/* Hover Glow & Scale (No Rotation) */
.chat-toggle-btn-left:hover {
    transform: scale(1.05) !important;
}

.chat-toggle-btn-left:hover .chat-logo-icon {
    filter: drop-shadow(0 0 8px rgba(26, 115, 232, 0.7)) 
            drop-shadow(0 0 12px rgba(26, 115, 232, 0.4));
}

/* State when chat is open */
.chat-toggle-btn-left.active .chat-logo-icon {
    opacity: 0;
    transform: scale(0);
}

.close-icon {
    position: absolute;
    font-size: 35px;
    color: #1a237e;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s ease;
}

.chat-toggle-btn-left.active .close-icon {
    opacity: 1;
    transform: scale(1);
}


/* ============================================================
   3. CHAT WINDOW (RETAINED FROM ORIGINAL)
   ============================================================ */

.chat-window-left {
    position: fixed;
    bottom: 90px;
    left: 20px;
    width: 450px;
    height: 600px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 30px rgba(0,0,0,0.3);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
}

.chat-window-left.active {
    display: flex;
}














/* ============================================================
   STABLE ATTENTION BADGE (Pop-Up Style)
   ============================================================ */

.chat-attention-badge {
    /* Position */
    position: absolute;
    bottom: 95px; /* Adjust height above button */
    left: 20px;
    z-index: 9999;

    /* Appearance */
    background: white;
    color: #1a237e;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);

    /* SIZING FIX: Give it a healthy range */
    width: auto;
    min-width: 250px;  /* Prevents "Squashed" look */
    max-width: 300px;  /* Prevents "Too Wide" look */
    height: auto;      /* Allows growing for 2-3 lines of text */

    /* Animation Setup (Hidden State) */
    opacity: 0;
    transform: translateY(10px) scale(0.95);
    transform-origin: bottom left;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    
    /* Layout */
    display: flex;
    flex-direction: column; /* Better for bubble tail positioning */
    pointer-events: none; /* Click-through when hidden */
}

/* The Triangle Tail */
.chat-attention-badge::before {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 20px;
    width: 0; 
    height: 0; 
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid white;
}

/* Inner Layout */
.chat-attention-badge-content {
    display: flex;
    align-items: center; /* Vertically center items */
    gap: 12px;
    padding: 14px 16px;
    width: 100%;
    box-sizing: border-box;
}

/* Text Styling - FORCE WRAP */
#badgeText {
    flex: 1;
    white-space: normal !important; /* Forces text to wrap */
    word-wrap: break-word;
    line-height: 1.4;
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    color: #1a237e;
}

.emoji {
    font-size: 20px;
    flex-shrink: 0; /* Prevents emoji from getting crushed */
}

/* ============================
   ANIMATION STATE
   ============================ */

/* When the JS adds this class, it pops up */
.chat-attention-badge.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto; /* Re-enable clicking */
}

/* Mobile Tweak */
@media (max-width: 480px) {
    .chat-attention-badge {
        min-width: auto;
        width: 85vw; /* Fit mobile screen */
        left: 15px;
        bottom: 85px;
    }
}