/* Chatbot Floating Action Button */
.chatbot-trigger {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #004ac6;
    color: #ffffff;
    box-shadow: 0 10px 30px rgba(0, 74, 198, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9999;
    border: none;
    outline: none;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
}

.chatbot-trigger:hover {
    transform: scale(1.08) rotate(8deg);
    box-shadow: 0 15px 35px rgba(0, 74, 198, 0.5);
}

.chatbot-trigger:active {
    transform: scale(0.95);
}

.chatbot-trigger .material-symbols-outlined {
    font-size: 28px;
    transition: transform 0.3s ease;
}

.chatbot-trigger.active .material-symbols-outlined {
    transform: rotate(90deg);
}

/* Pulse waves around the trigger button */
.chatbot-trigger::before,
.chatbot-trigger::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(0, 74, 198, 0.4);
    z-index: -1;
    animation: trigger-pulse 3s infinite;
}

.chatbot-trigger::after {
    animation-delay: 1.5s;
}

@keyframes trigger-pulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* Chatbox Window Container */
.chatbot-box {
    position: fixed;
    bottom: 96px;
    right: 24px;
    width: 380px;
    max-width: calc(100vw - 48px);
    height: 520px;
    max-height: calc(100vh - 140px);
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(11, 28, 48, 0.15);
    border: 1px solid rgba(0, 74, 198, 0.08);
    display: flex;
    flex-direction: column;
    z-index: 9998;
    overflow: hidden;
    opacity: 0;
    transform: scale(0.9) translateY(20px);
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), 
                transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chatbot-box.open {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}

/* Glassmorphic Header */
.chatbot-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(240, 244, 255, 0.9) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 74, 198, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chatbot-bot-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-avatar {
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    max-width: 38px;
    max-height: 38px;
    aspect-ratio: 1 / 1;
    flex-shrink: 0;
    border-radius: 50%;
    background: #004ac6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    position: relative;
    box-shadow: 0 4px 10px rgba(0, 74, 198, 0.2);
}

.chatbot-avatar .material-symbols-outlined {
    font-size: 20px;
    font-variation-settings: 'FILL' 1;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-status-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    background: #10b981;
    border: 2px solid #ffffff;
    border-radius: 50%;
}

.chatbot-meta h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #0b1c30;
}

.chatbot-meta span {
    font-size: 11px;
    color: #10b981;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
}

.chatbot-action-btn,
.chatbot-close-btn {
    background: none;
    border: none;
    color: #737686;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, color 0.2s;
}

.chatbot-action-btn:hover,
.chatbot-close-btn:hover {
    background: rgba(115, 118, 134, 0.1);
    color: #0b1c30;
}

/* Scrollable Messages Area */
.chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background-color: #f8f9ff;
}

.chat-bubble a {
    color: #004ac6;
    text-decoration: underline;
    font-weight: 600;
}

.chat-msg.user .chat-bubble a {
    color: #ffffff;
    text-decoration: underline;
}

.chatbot-input:disabled {
    background-color: #f1f3f9;
    color: #888;
    cursor: not-allowed;
    border-color: #e2e4ed;
}

.chatbot-send-btn:disabled {
    background: #a0aec0;
    cursor: not-allowed;
    transform: none !important;
}

/* Message Bubble Styles */
.chat-msg {
    display: flex;
    gap: 8px;
    max-width: 85%;
    align-items: flex-start;
}

.chat-msg.bot {
    align-self: flex-start;
}

.chat-msg.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-msg .chatbot-avatar {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    min-height: 28px !important;
    max-width: 28px !important;
    max-height: 28px !important;
    aspect-ratio: 1 / 1 !important;
    flex-shrink: 0 !important;
    align-self: flex-start;
    border-radius: 50% !important;
    margin-top: 4px;
}

.chat-msg .chatbot-avatar .material-symbols-outlined {
    font-size: 16px !important;
    line-height: 1 !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-bubble {
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 13.5px;
    line-height: 1.5;
    word-break: break-word;
    box-shadow: 0 2px 4px rgba(11, 28, 48, 0.02);
}

.chat-msg.bot .chat-bubble {
    background: #ffffff;
    color: #0b1c30;
    border-top-left-radius: 4px;
    border: 1px solid rgba(0, 74, 198, 0.04);
}

.chat-msg.user .chat-bubble {
    background: #004ac6;
    color: #ffffff;
    border-top-right-radius: 4px;
}

/* Suggestion Quick Chips */
.chatbot-suggestions {
    padding: 10px 16px;
    background: #f8f9ff;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    border-top: 1px solid rgba(0, 74, 198, 0.04);
    scrollbar-width: none; /* Firefox */
}

.chatbot-suggestions::-webkit-scrollbar {
    display: none; /* Safari & Chrome */
}

.chip-btn {
    flex-shrink: 0;
    padding: 8px 14px;
    background: #ffffff;
    border: 1px solid rgba(0, 74, 198, 0.1);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: #004ac6;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chip-btn:hover {
    background: #004ac6;
    color: #ffffff;
    border-color: #004ac6;
    transform: translateY(-1px);
}

/* Input Area */
.chatbot-input-area {
    padding: 14px 16px;
    background: #ffffff;
    border-top: 1px solid rgba(0, 74, 198, 0.08);
    display: flex;
    gap: 10px;
    align-items: center;
}

.chatbot-input {
    flex: 1;
    border: 1.5px solid #c3c6d7;
    border-radius: 999px;
    padding: 10px 18px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
    color: #0b1c30;
}

.chatbot-input:focus {
    border-color: #004ac6;
}

.chatbot-send-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #004ac6;
    color: #ffffff;
    border: none;
    outline: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background-color 0.2s;
}

.chatbot-send-btn:hover {
    background: #003ea8;
    transform: scale(1.05);
}

.chatbot-send-btn:active {
    transform: scale(0.95);
}

.chatbot-send-btn .material-symbols-outlined {
    font-size: 18px;
    margin-left: 2px;
}

/* Typing Indicator Animation */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 4px 8px;
    align-items: center;
    justify-content: center;
    height: 12px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: #737686;
    border-radius: 50%;
    animation: typing-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 typing-bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* Scrollbar Customization */
.chatbot-messages::-webkit-scrollbar {
    width: 4px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 74, 198, 0.15);
    border-radius: 4px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 74, 198, 0.3);
}

/* Mobile responsive adjustments */
@media (max-width: 480px) {
    .chatbot-box {
        bottom: 0;
        right: 0;
        width: 100%;
        height: 100%;
        max-height: 100%;
        max-width: 100%;
        border-radius: 0;
        border: none;
    }
    
    .chatbot-box.open {
        transform: translateY(0);
    }
}
