/* Premium Glassmorphism Chatbot CSS */
.chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000000;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* Chatbot Floating Button */
.chatbot-btn {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: floatChatbot 3s infinite ease-in-out;
    position: relative;
    overflow: hidden;
    z-index: 2;
}

.chatbot-tooltip {
    position: absolute;
    right: 80px;
    bottom: 10px;
    background: rgba(15, 23, 42, 0.9);
    color: white;
    padding: 10px 16px;
    border-radius: 12px;
    border-bottom-right-radius: 2px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transform: translateX(20px);
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border: 1px solid rgba(255,255,255,0.1);
    z-index: 1;
}

.chatbot-tooltip::after {
    content: '';
    position: absolute;
    right: -6px;
    bottom: 8px;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 6px solid rgba(15, 23, 42, 0.9);
}

.chatbot-tooltip.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.chatbot-btn::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
}

.chatbot-btn:hover {
    transform: scale(1.1) translateY(-5px);
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.5);
}

.chatbot-btn:hover::after {
    opacity: 1;
}

@keyframes floatChatbot {
    0% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
    100% { transform: translateY(0); }
}

/* Chatbot Window (Glassmorphism + Dark Mode Compatibility) */
.chatbot-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 360px;
    height: 550px;
    max-height: calc(100vh - 120px);
    background: rgba(15, 23, 42, 0.75); /* Dark transparent background */
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.6), inset 0 0 0 1px rgba(255,255,255,0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transform-origin: bottom right;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
    pointer-events: none;
    z-index: 1000000;
}

.chatbot-window.active {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: all;
}

/* Chatbot Header */
.chatbot-header {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.02) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 18px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
}

.chatbot-header-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    font-size: 16px;
    letter-spacing: 0.5px;
    position: relative;
}

.chatbot-header-title::before {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    background-color: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 8px #22c55e;
    animation: pulseOnline 2s infinite;
}

@keyframes pulseOnline {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
    70% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.chatbot-header-title i {
    font-size: 20px;
    background: linear-gradient(135deg, #818cf8 0%, #c084fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.chatbot-close {
    cursor: pointer;
    font-size: 20px;
    color: #94a3b8;
    transition: all 0.3s;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.chatbot-close:hover {
    color: white;
    background: rgba(255,255,255,0.1);
    transform: rotate(90deg);
}

/* Chatbot Body */
.chatbot-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.2) transparent;
}

/* Scrollbar for Webkit */
.chatbot-body::-webkit-scrollbar {
    width: 4px;
}
.chatbot-body::-webkit-scrollbar-track {
    background: transparent;
}
.chatbot-body::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
}
.chatbot-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.4);
}

/* Messages */
.chat-msg {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14.5px;
    line-height: 1.5;
    word-wrap: break-word;
    animation: messagePop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes messagePop {
    0% { opacity: 0; transform: translateY(10px) scale(0.95); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.chat-msg.bot {
    background: rgba(255, 255, 255, 0.08);
    color: #f8fafc;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(255,255,255,0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.chat-msg.user {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

/* Typing Indicator */
.chat-typing {
    display: flex;
    gap: 5px;
    align-items: center;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    align-self: flex-start;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(255,255,255,0.05);
}

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

/* Chatbot Footer (Input) */
.chatbot-footer {
    padding: 16px;
    background: rgba(15, 23, 42, 0.6);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 12px;
    align-items: center;
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
}

.chatbot-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 16px;
    border-radius: 24px;
    outline: none;
    color: white;
    font-size: 14px;
    transition: all 0.3s;
}

.chatbot-input::placeholder {
    color: #94a3b8;
}

.chatbot-input:focus {
    border-color: #818cf8;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 2px rgba(129, 140, 248, 0.2);
}

.chatbot-send {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 10px rgba(124, 58, 237, 0.3);
}

.chatbot-send:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 6px 15px rgba(124, 58, 237, 0.4);
}

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

.chatbot-send:disabled {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.3);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    .chatbot-window {
        width: calc(100vw - 30px);
        height: 65vh;
        bottom: 80px;
        right: 15px;
    }
    
    .chatbot-btn {
        width: 55px;
        height: 55px;
        font-size: 22px;
        bottom: 15px;
        right: 15px;
    }
}
