#chatbot-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

#chatbot-bubble {
    background: linear-gradient(135deg, #1a73e8, #4285f4);
    color: white;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 20px rgba(26, 115, 232, 0.3);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    outline: none;
}

#chatbot-bubble:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(26, 115, 232, 0.4);
}

#chatbot-bubble:active {
    transform: scale(0.95);
}

#chatbot-box {
    position: fixed;
    bottom: 6rem;
    right: 1.5rem;
    width: min(22rem, 85vw);
    height: min(32rem, 75vh);
    background: #ffffff;
    border-radius: 1rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.hidden {
    display: none !important;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

#chatbot-header {
    background: linear-gradient(135deg, #1a73e8, #4285f4);
    color: white;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 500;
    font-size: 1rem;
    letter-spacing: 0.2px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#chatbot-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 1.125rem;
    cursor: pointer;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

#chatbot-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

#chatbot-messages {
    flex: 1;
    padding: 1.25rem;
    overflow-y: auto;
    background: #fafbfc;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

#chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

#chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

#chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.message-wrapper {
    display: flex;
    margin-bottom: 4px;
}

.message-wrapper.user {
    justify-content: flex-end;
}

.message-wrapper.bot {
    justify-content: flex-start;
    align-items: flex-start;
}

.avatar {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    margin-right: 0.5rem;
    flex-shrink: 0;
    object-fit: cover;
}

.chat-message {
    max-width: 80%;
    padding: 0.75rem 1rem;
    border-radius: 1.25rem;
    line-height: 1.5;
    word-wrap: break-word;
    font-size: 0.875rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: relative;
}

.chat-message.user {
    background: linear-gradient(135deg, #1a73e8, #4285f4);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.chat-message.bot {
    background: #ffffff;
    color: #202124;
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

#chatbot-input-container {
    display: flex;
    border-top: 1px solid #e8eaed;
    background: #ffffff;
    padding: 0;
}

#chatbot-input {
    flex: 1;
    border: none;
    padding: 1rem 1.25rem;
    font-size: 0.875rem;
    outline: none;
    background: transparent;
    color: #202124;
    font-family: inherit;
}

#chatbot-input::placeholder {
    color: #9aa0a6;
}

#chatbot-send {
    background: #1a73e8;
    color: white;
    border: none;
    padding: 0 1.25rem;
    cursor: pointer;
    font-size: 1rem;
    border-radius: 0;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#chatbot-send:hover {
    background: #1557b0;
}

#chatbot-send:disabled {
    background: #dadce0;
    cursor: not-allowed;
}

/* Typing Animation */
.typing {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.75rem 1rem;
    background: #ffffff;
    border-radius: 1.25rem;
    max-width: 70%;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.dot {
    width: 0.375rem;
    height: 0.375rem;
    background: #1a73e8;
    border-radius: 50%;
    animation: blink 1.4s infinite ease-in-out;
}

.dot:nth-child(2) { animation-delay: 0.2s; }
.dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes blink {
    0%, 60%, 100% { opacity: 0.4; transform: scale(0.8); }
    30% { opacity: 1; transform: scale(1); }
}

/* Responsive adjustments */
@media (max-width: 1366px) {
    #chatbot-box {
        width: min(80vw, 20rem);
        height: min(65vh, 28rem);
        bottom: 5rem;
        right: 1.25rem;
        left: auto;
        max-width: 20rem;
    }
    
    #chatbot-bubble {
        bottom: 1.25rem;
        right: 1.25rem;
        width: 3.25rem;
        height: 3.25rem;
        font-size: 1.25rem;
    }
    
    #chatbot-header {
        padding: 1rem 1.125rem;
        font-size: 0.9rem;
    }
    
    #chatbot-close {
        width: 1.625rem;
        height: 1.625rem;
        font-size: 0.95rem;
    }
    
    #chatbot-messages {
        padding: 1rem;
        gap: 0.625rem;
    }
    
    .chat-message {
        max-width: 85%;
        font-size: 0.8125rem;
        padding: 0.625rem 0.875rem;
    }
    
    .avatar {
        width: 1.875rem;
        height: 1.875rem;
        margin-right: 0.375rem;
    }
    
    #chatbot-input {
        padding: 0.875rem 1.125rem;
        font-size: 0.95rem;
    }
    
    #chatbot-send {
        padding: 0 0.95rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 1024px) {
    #chatbot-box {
        width: min(82vw, 18rem);
        height: min(68vh, 26rem);
        bottom: 4.5rem;
        right: 1.125rem;
        left: auto;
        max-width: 18rem;
    }
    
    #chatbot-bubble {
        bottom: 1.125rem;
        right: 1.125rem;
        width: 3rem;
        height: 3rem;
        font-size: 1.2rem;
    }
    
    #chatbot-header {
        padding: 0.9rem 1rem;
        font-size: 0.875rem;
    }
    
    #chatbot-close {
        width: 1.5rem;
        height: 1.5rem;
        font-size: 0.9rem;
    }
    
    #chatbot-messages {
        padding: 0.9rem;
        gap: 0.5625rem;
    }
    
    .chat-message {
        max-width: 85%;
        font-size: 0.8rem;
        padding: 0.5625rem 0.8125rem;
    }
    
    .avatar {
        width: 1.75rem;
        height: 1.75rem;
        margin-right: 0.35rem;
    }
    
    #chatbot-input {
        padding: 0.8125rem 1rem;
        font-size: 0.925rem;
    }
    
    #chatbot-send {
        padding: 0 0.9rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 768px) {
    #chatbot-box {
        width: min(85vw, 16rem);
        height: min(70vh, 24rem);
        bottom: 4.25rem;
        right: 1rem;
        left: auto;
        max-width: 16rem;
    }
    
    #chatbot-bubble {
        bottom: 1rem;
        right: 1rem;
        width: 2.75rem;
        height: 2.75rem;
        font-size: 1.125rem;
    }
    
    #chatbot-header {
        padding: 0.8125rem 0.9375rem;
        font-size: 0.8125rem;
    }
    
    #chatbot-close {
        width: 1.375rem;
        height: 1.375rem;
        font-size: 0.8125rem;
    }
    
    #chatbot-messages {
        padding: 0.8125rem;
        gap: 0.5rem;
    }
    
    .chat-message {
        max-width: 87%;
        font-size: 0.75rem;
        padding: 0.5rem 0.75rem;
    }
    
    .avatar {
        width: 1.625rem;
        height: 1.625rem;
        margin-right: 0.3125rem;
    }
    
    #chatbot-input {
        padding: 0.75rem 0.9375rem;
        font-size: 0.9rem;
    }
    
    #chatbot-send {
        padding: 0 0.8125rem;
        font-size: 0.8125rem;
    }
}

@media (max-width: 480px) {
    #chatbot-container {
        bottom: 0.9375rem;
        right: 0.9375rem;
    }
    
    #chatbot-box {
        width: min(85vw, 20rem);
        height: min(70vh, 30rem);
        bottom: 4.6875rem;
        right: 0.9375rem;
        left: auto;
        max-width: 20rem;
        border-radius: 0.75rem;
    }
    
    #chatbot-bubble {
        bottom: 0.9375rem;
        right: 0.9375rem;
        width: 3.25rem;
        height: 3.25rem;
        font-size: 1.25rem;
    }
    
    #chatbot-header {
        padding: 0.875rem 1rem;
        font-size: 0.875rem;
    }
    
    #chatbot-close {
        width: 1.5rem;
        height: 1.5rem;
        font-size: 0.875rem;
    }
    
    #chatbot-messages {
        padding: 0.75rem;
        gap: 0.5rem;
    }
    
    .chat-message {
        max-width: 90%;
        font-size: 0.8125rem;
        padding: 0.5rem 0.75rem;
    }
    
    .avatar {
        width: 1.75rem;
        height: 1.75rem;
        margin-right: 0.375rem;
    }
    
    #chatbot-input {
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }
    
    #chatbot-send {
        padding: 0 0.875rem;
        font-size: 0.875rem;
    }
    
    .typing {
        padding: 0.625rem 0.875rem;
    }
}
