/* ----------------------------------------------------
   NIBIRU AI CHATBOT WIDGET - PREMIUM DESIGN SYSTEM
   ---------------------------------------------------- */

/* Reset & variables for Chatbot context */
:root {
    --chatbot-primary: #196aea;
    --chatbot-primary-dark: #0a2e6b;
    --chatbot-accent: #00d4ff; /* Neon Electric Cyan matching the Nibiru sphere logo */
    --chatbot-bg-dark: rgba(9, 17, 31, 0.95);
    --chatbot-border-light: rgba(116, 168, 255, 0.2);
    --chatbot-text-light: #f5f9ff;
    --chatbot-text-muted: #8396b5;
}

/* LAUNCHER TRIGGER BUTTON */
.nibiru-chatbot-launcher {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: radial-gradient(circle, #eef5ff 0%, #d5e6ff 100%);
    border: 4px solid var(--chatbot-accent);
    box-shadow: 0px 8px 30px rgba(0, 0, 0, 0.35);
    cursor: pointer;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: nibiru-glow-pulse 2.5s infinite;
}

.nibiru-chatbot-launcher:hover {
    transform: scale(1.1) rotate(8deg);
    border-color: #00f5ff; /* Glowing cyan hover highlight */
    animation-play-state: paused;
    box-shadow: 0px 12px 35px rgba(0, 212, 255, 0.4);
}

.nibiru-chatbot-launcher i {
    font-size: 32px;
    color: #09111f;
    transition: all 0.3s ease;
}

.nibiru-chatbot-launcher:hover i {
    color: var(--chatbot-primary);
}

/* Pulsing Badge notification */
.nibiru-chatbot-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 14px;
    height: 14px;
    background-color: #ff4d4d;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 8px rgba(255, 77, 77, 0.8);
}

/* GLOW PULSE KEYFRAMES */
@keyframes nibiru-glow-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 212, 255, 0.6), 0px 8px 30px rgba(0, 0, 0, 0.35);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(0, 212, 255, 0), 0px 8px 30px rgba(0, 0, 0, 0.35);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 212, 255, 0), 0px 8px 30px rgba(0, 0, 0, 0.35);
    }
}

/* CHATBOT MAIN WINDOW */
.nibiru-chatbot-window {
    position: fixed;
    bottom: 110px;
    right: 30px;
    width: 380px;
    height: 560px;
    max-height: calc(100vh - 150px);
    max-width: calc(100vw - 60px);
    border-radius: 24px;
    background: var(--chatbot-bg-dark);
    border: 1px solid var(--chatbot-border-light);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(30px) scale(0.9);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.nibiru-chatbot-window.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* CHAT WINDOW HEADER */
.nibiru-chatbot-header {
    background: linear-gradient(135deg, var(--chatbot-primary-dark) 0%, #09111f 100%);
    padding: 16px 20px;
    border-bottom: 1px solid var(--chatbot-border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.nibiru-chatbot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #eef5ff;
    border: 2px solid var(--chatbot-accent);
    display: flex;
    align-items: center;
    justify-content: center;
}

.nibiru-chatbot-avatar i {
    font-size: 22px;
    color: #09111f;
}

.nibiru-chatbot-title-container {
    display: flex;
    flex-direction: column;
}

.nibiru-chatbot-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--chatbot-text-light);
    margin: 0;
    line-height: 1.2;
}

.nibiru-chatbot-status {
    font-size: 11px;
    color: var(--chatbot-text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 2px;
}

.nibiru-chatbot-status-dot {
    width: 7px;
    height: 7px;
    background-color: #2ec4b6;
    border-radius: 50%;
    box-shadow: 0 0 8px #2ec4b6;
    animation: status-pulse 1.8s infinite;
}

@keyframes status-pulse {
    0% { transform: scale(0.9); opacity: 0.6; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.6; }
}

.nibiru-chatbot-close-btn {
    background: transparent;
    border: none;
    color: var(--chatbot-text-muted);
    font-size: 24px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.nibiru-chatbot-close-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    transform: rotate(90deg);
}

/* CHAT MESSAGES PANEL */
.nibiru-chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: radial-gradient(circle at top right, rgba(25, 106, 234, 0.05), transparent);
}

/* Custom Scrollbar for Chat Messages */
.nibiru-chatbot-messages::-webkit-scrollbar {
    width: 6px;
}
.nibiru-chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}
.nibiru-chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(116, 168, 255, 0.2);
    border-radius: 10px;
}
.nibiru-chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(116, 168, 255, 0.4);
}

/* CHAT BUBBLES */
.nibiru-chat-msg {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.45;
    animation: bubble-slide-up 0.4s cubic-bezier(0.215, 0.61, 0.355, 1) forwards;
    word-break: break-word;
}

@keyframes bubble-slide-up {
    0% { opacity: 0; transform: translateY(15px) scale(0.95); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.nibiru-chat-msg.bot {
    align-self: flex-start;
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--chatbot-text-light);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top-left-radius: 2px;
}

.nibiru-chat-msg.user {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--chatbot-primary) 0%, #104c9e 100%);
    color: #ffffff;
    border-top-right-radius: 2px;
    box-shadow: 0px 4px 15px rgba(25, 106, 234, 0.2);
}

.nibiru-chat-time {
    font-size: 10px;
    color: var(--chatbot-text-muted);
    margin-top: 4px;
    display: block;
    text-align: right;
}

.nibiru-chat-msg.bot .nibiru-chat-time {
    text-align: left;
}

/* QUICK REPLIES CONTAINER */
.nibiru-chatbot-quick-replies {
    padding: 0 20px 15px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: transparent;
}

.nibiru-quick-chip {
    background: rgba(25, 106, 234, 0.08);
    border: 1.5px solid var(--chatbot-accent);
    color: var(--chatbot-accent);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    outline: none;
}

.nibiru-quick-chip:hover {
    background: var(--chatbot-accent);
    color: #09111f;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.4);
}

.nibiru-quick-chip:active {
    transform: translateY(0);
}

/* CHATBOT INPUT AREA */
.nibiru-chatbot-input-container {
    padding: 16px 20px;
    border-top: 1px solid var(--chatbot-border-light);
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(9, 17, 31, 0.98);
}

.nibiru-chatbot-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 50px !important;
    padding: 10px 18px !important;
    color: #fff !important;
    font-size: 14px !important;
    outline: none !important;
    transition: all 0.3s ease;
}

.nibiru-chatbot-input:focus {
    border-color: var(--chatbot-accent) !important;
    background: rgba(255, 255, 255, 0.08) !important;
    outline: 1px solid var(--chatbot-accent) !important;
}

.nibiru-chatbot-send-btn {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 50%;
    background-color: var(--chatbot-accent);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 212, 255, 0.25);
}

.nibiru-chatbot-send-btn:hover {
    background-color: #00f5ff;
    transform: scale(1.08) rotate(-15deg);
    box-shadow: 0 6px 15px rgba(0, 245, 255, 0.45);
}

.nibiru-chatbot-send-btn i {
    font-size: 18px;
    color: #09111f;
}

/* TYPING INDICATOR */
.nibiru-typing-bubble {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 18px !important;
}

.nibiru-typing-dot {
    width: 7px;
    height: 7px;
    background-color: var(--chatbot-text-muted);
    border-radius: 50%;
    animation: typing-bounce 1.4s infinite ease-in-out both;
}

.nibiru-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.nibiru-typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing-bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}

/* RESPONSIVE STYLING FOR MOBILE DEVICE VIEWPORT */
@media (max-width: 576px) {
    .nibiru-chatbot-launcher {
        bottom: 20px;
        right: 20px;
        width: 55px;
        height: 55px;
    }
    
    .nibiru-chatbot-launcher i {
        font-size: 26px;
    }
    
    .nibiru-chatbot-window {
        bottom: 85px;
        right: 20px;
        width: calc(100vw - 40px);
        height: 480px;
        max-height: calc(100vh - 120px);
    }
    
    .nibiru-quick-chip {
        font-size: 12px;
        padding: 5px 10px;
    }
}
