/* WebAI Solution AI Chatbot Stylesheet */

/* Floating AI Chatbot Button (Positioned above WhatsApp) */
.floating-chatbot {
    position: fixed;
    bottom: 105px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #00f0ff 0%, #7000ff 100%);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7rem;
    z-index: 9999;
    box-shadow: 0 8px 25px rgba(0, 240, 255, 0.45);
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease, background 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.floating-chatbot:hover {
    transform: scale(1.1) translateY(-4px);
    box-shadow: 0 14px 35px rgba(0, 240, 255, 0.7);
    background: linear-gradient(135deg, #33f3ff 0%, #8b1aff 100%);
}

.floating-chatbot .chatbot-online-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    background: #10b981;
    border: 2px solid #0b0f19;
    border-radius: 50%;
    box-shadow: 0 0 8px #10b981;
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Tooltip Callout Bubble */
.chatbot-tooltip-bubble {
    position: fixed;
    bottom: 115px;
    right: 100px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 240, 255, 0.3);
    color: #00f0ff;
    padding: 8px 14px;
    border-radius: 12px;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 1;
    transition: opacity 0.4s ease, transform 0.4s ease;
    animation: bounce-horizontal 2.5s infinite;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chatbot-tooltip-bubble::after {
    content: '';
    position: absolute;
    right: -7px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 6px 0 6px 7px;
    border-style: solid;
    border-color: transparent transparent transparent rgba(0, 240, 255, 0.4);
}

@keyframes bounce-horizontal {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-6px); }
}

/* AI Chatbot Window Widget */
.chat-widget-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 390px;
    max-width: 92vw;
    height: 580px;
    max-height: 82vh;
    background: rgba(11, 15, 25, 0.96);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(0, 240, 255, 0.35);
    border-radius: 22px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85), 0 0 40px rgba(0, 240, 255, 0.15);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(30px) scale(0.95);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-family: 'Outfit', sans-serif;
}

.chat-widget-container.active {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0) scale(1);
}

/* Header */
.chat-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.12) 0%, rgba(112, 0, 255, 0.15) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.chat-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00f0ff, #7000ff);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.3rem;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.4);
    position: relative;
}

.chat-avatar::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 11px;
    height: 11px;
    background: #10b981;
    border: 2px solid #0b0f19;
    border-radius: 50%;
}

.chat-header-text h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.3px;
}

.chat-header-text p {
    margin: 2px 0 0 0;
    font-size: 0.76rem;
    color: #00f0ff;
    display: flex;
    align-items: center;
    gap: 5px;
}

.chat-close-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #94a3b8;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s ease;
}

.chat-close-btn:hover {
    background: rgba(255, 0, 85, 0.2);
    border-color: #ff0055;
    color: #ff0055;
    transform: rotate(90deg);
}

/* Chat Scrollable Body */
.chat-body {
    flex: 1;
    padding: 18px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    scroll-behavior: smooth;
    background: radial-gradient(circle at top right, rgba(0, 240, 255, 0.03), transparent 60%);
}

.chat-body::-webkit-scrollbar {
    width: 5px;
}

.chat-body::-webkit-scrollbar-thumb {
    background: rgba(0, 240, 255, 0.3);
    border-radius: 4px;
}

/* Message Bubbles */
.chat-msg {
    display: flex;
    flex-direction: column;
    max-width: 85%;
    animation: fadeInMsg 0.3s ease-out forwards;
}

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

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

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

.chat-bubble {
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 0.9rem;
    line-height: 1.55;
    word-break: break-word;
}

.bot-msg .chat-bubble {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
    border-bottom-left-radius: 4px;
}

.user-msg .chat-bubble {
    background: linear-gradient(135deg, #00f0ff 0%, #0099ff 100%);
    color: #0b0f19;
    font-weight: 500;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 15px rgba(0, 240, 255, 0.3);
}

.chat-msg-time {
    font-size: 0.68rem;
    color: #64748b;
    margin-top: 4px;
    padding: 0 4px;
}

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

/* Quick Action Chips */
.chat-quick-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.chip-btn {
    background: rgba(0, 240, 255, 0.1);
    border: 1px solid rgba(0, 240, 255, 0.3);
    color: #00f0ff;
    padding: 7px 13px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.chip-btn:hover {
    background: #00f0ff;
    color: #0b0f19;
    font-weight: 700;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 240, 255, 0.4);
}

/* Embedded Form inside Chat */
.chat-embed-form {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(0, 240, 255, 0.3);
    border-radius: 14px;
    padding: 14px;
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-embed-form input, .chat-embed-form textarea {
    width: 100%;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #fff;
    font-size: 0.85rem;
    outline: none;
    box-sizing: border-box;
}

.chat-embed-form input:focus, .chat-embed-form textarea:focus {
    border-color: #00f0ff;
    background: rgba(255, 255, 255, 0.08);
}

.chat-embed-form button {
    padding: 10px;
    background: linear-gradient(135deg, #00f0ff, #7000ff);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
}

.chat-embed-form button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Typing Indicator Animation */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    width: fit-content;
}

.typing-dot {
    width: 7px;
    height: 7px;
    background: #00f0ff;
    border-radius: 50%;
    animation: typingBlink 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBlink {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1.1); opacity: 1; }
}

/* Chat Footer / Input Controls */
.chat-footer {
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.9);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    gap: 10px;
    align-items: center;
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 25px;
    color: #ffffff;
    font-size: 0.88rem;
    outline: none;
    transition: all 0.2s ease;
}

.chat-input::placeholder {
    color: #64748b;
}

.chat-input:focus {
    border-color: #00f0ff;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.2);
}

.chat-send-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00f0ff 0%, #7000ff 100%);
    border: none;
    color: #ffffff;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 240, 255, 0.3);
}

.chat-send-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 18px rgba(0, 240, 255, 0.5);
}

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Mobile Screen Responsiveness */
@media (max-width: 768px) {
    .floating-chatbot {
        bottom: 78px;
        right: 18px;
        width: 52px;
        height: 52px;
        font-size: 1.45rem;
    }
    .chatbot-tooltip-bubble {
        bottom: 85px;
        right: 80px;
        font-size: 0.75rem;
        padding: 6px 10px;
    }
    .chat-widget-container {
        bottom: 12px;
        right: 4vw;
        left: 4vw;
        width: 92vw;
        height: 82vh;
        max-height: 85vh;
        border-radius: 18px;
    }
}
