/**
 * SCITBOSS Portfolio - Interactive Floating Widgets
 * Bottom-Left Animated WhatsApp Button & Bottom-Right Interactive Chatbot
 */

/* ==========================================================================
   FLOATING WHATSAPP BUTTON (BOTTOM-LEFT)
   ========================================================================== */
.whatsapp-widget-float {
    position: fixed;
    bottom: 28px;
    left: 28px;
    z-index: 998;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.whatsapp-button-pulse {
    position: relative;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    box-shadow: 0 10px 25px -4px rgba(37, 211, 102, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 30px;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.whatsapp-button-pulse:hover {
    transform: scale(1.1);
    box-shadow: 0 14px 30px -4px rgba(37, 211, 102, 0.65);
}

/* Pulsing Ripple Rings */
.whatsapp-button-pulse::before,
.whatsapp-button-pulse::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid #25D366;
    opacity: 0.8;
    animation: whatsappPulse 2.4s ease-out infinite;
    pointer-events: none;
}

.whatsapp-button-pulse::after {
    animation-delay: 1.2s;
}

@keyframes whatsappPulse {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.35); opacity: 0; }
    100% { transform: scale(1.5); opacity: 0; }
}

.whatsapp-tooltip {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    backdrop-filter: blur(8px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
    white-space: nowrap;
}

.whatsapp-widget-float:hover .whatsapp-tooltip {
    opacity: 1;
    transform: translateX(0);
}

/* ==========================================================================
   FLOATING CHATBOT WIDGET (BOTTOM-RIGHT)
   ========================================================================== */
.chatbot-widget-float {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 999;
    font-family: var(--font-sans, 'Outfit', sans-serif);
}

.chatbot-toggle-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%);
    box-shadow: 0 10px 30px -5px rgba(99, 102, 241, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    cursor: pointer;
    border: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

.chatbot-toggle-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 15px 35px -5px rgba(99, 102, 241, 0.65);
}

.chatbot-ping-dot {
    position: absolute;
    top: 0;
    right: 0;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #10b981;
    border: 2px solid #08090d;
    box-shadow: 0 0 10px #10b981;
}

/* Chatbot Popup Window */
.chatbot-window {
    position: absolute;
    bottom: 74px;
    right: 0;
    width: 380px;
    height: 540px;
    max-height: calc(100vh - 120px);
    background: rgba(11, 15, 23, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 40px rgba(99, 102, 241, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: bottom right;
}

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

/* Chat Header */
.chat-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.18) 0%, rgba(6, 182, 212, 0.12) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.chat-bot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #6366f1;
}

.chat-bot-name {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
}

.chat-bot-status {
    font-size: 11.5px;
    color: #10b981;
    display: flex;
    align-items: center;
    gap: 5px;
}

.chat-bot-status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
    display: inline-block;
}

.chat-close-btn {
    background: transparent;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: 20px;
    padding: 4px;
    transition: color 0.2s;
}

.chat-close-btn:hover {
    color: #ffffff;
}

/* Chat Messages Stream */
.chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    scroll-behavior: smooth;
}

.chat-msg {
    max-width: 85%;
    font-size: 13.5px;
    line-height: 1.5;
    padding: 12px 16px;
    border-radius: 16px;
    word-break: break-word;
}

.chat-msg.bot {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #e5e7eb;
    border-bottom-left-radius: 4px;
}

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

/* Typing Indicator */
.typing-dots {
    display: none;
    align-self: flex-start;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    border-bottom-left-radius: 4px;
}

.typing-dots.active {
    display: flex;
    gap: 4px;
    align-items: center;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: #9ca3af;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

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

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
}

/* Quick Question Suggestions */
.chat-suggestions {
    padding: 8px 16px 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.chat-suggestion-chip {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 12px;
    color: #c7d2fe;
    font-size: 11.5px;
    padding: 5px 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.chat-suggestion-chip:hover {
    background: #6366f1;
    color: #ffffff;
}

/* Chat Input Bar */
.chat-input-bar {
    padding: 12px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-input-field {
    flex-grow: 1;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 9px 14px;
    color: #ffffff;
    font-size: 13.5px;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s;
}

.chat-input-field:focus {
    border-color: #6366f1;
}

.chat-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #6366f1;
    border: none;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}

.chat-send-btn:hover {
    background: #4f46e5;
}

@media (max-width: 480px) {
    .chatbot-window {
        width: calc(100vw - 32px);
        right: -12px;
        bottom: 70px;
        height: 480px;
    }
    .whatsapp-widget-float {
        bottom: 20px;
        left: 20px;
    }
    .chatbot-widget-float {
        bottom: 20px;
        right: 20px;
    }
}
