/* ==========================================================================
   Tecnowelt Sticky Floating AI Chatbot & Knowledge Base Widget Styles
   ========================================================================== */

:root {
    --tw-bot-primary: #6366F1;
    --tw-bot-primary-hover: #4F46E5;
    --tw-bot-dark: #0F172A;
    --tw-bot-dark-surface: #1E293B;
    --tw-bot-light-bg: #F8FAFC;
    --tw-bot-border: #E2E8F0;
    --tw-bot-text-dark: #0F172A;
    --tw-bot-text-muted: #64748B;
    --tw-bot-user-bubble: linear-gradient(135deg, #6366F1 0%, #4F46E5 100%);
    --tw-bot-shadow: 0 20px 45px rgba(15, 23, 42, 0.22);
    --tw-bot-radius: 20px;
    --tw-bot-font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Root Wrapper */
.tecnowelt-chatbot-root {
    position: fixed;
    bottom: 28px;
    z-index: 999999;
    font-family: var(--tw-bot-font);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.tecnowelt-chatbot-root *,
.tecnowelt-chatbot-root *::before,
.tecnowelt-chatbot-root *::after {
    box-sizing: border-box;
}

.tecnowelt-chatbot-root.pos-bottom-right {
    right: 28px;
    align-items: flex-end;
}

.tecnowelt-chatbot-root.pos-bottom-left {
    left: 28px;
    align-items: flex-start;
}

/* Sticky Floating WhatsApp Trigger Button (Positioned directly above AI Chatbot) */
#tecnowelt-whatsapp-trigger.tecnowelt-whatsapp-trigger {
    position: relative !important;
    width: 62px !important;
    height: 62px !important;
    min-width: 62px !important;
    min-height: 62px !important;
    max-width: 62px !important;
    max-height: 62px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%) !important;
    color: #FFFFFF !important;
    border: 2px solid rgba(255, 255, 255, 0.2) !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 10px 25px rgba(37, 211, 102, 0.4) !important;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
    outline: none !important;
    text-decoration: none !important;
    margin: 0 0 14px 0 !important;
    padding: 0 !important;
    z-index: 999999 !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
}

#tecnowelt-whatsapp-trigger.tecnowelt-whatsapp-trigger:hover {
    transform: scale(1.08) translateY(-2px) !important;
    box-shadow: 0 15px 35px rgba(37, 211, 102, 0.6) !important;
    color: #FFFFFF !important;
    text-decoration: none !important;
}

#tecnowelt-whatsapp-trigger.tecnowelt-whatsapp-trigger:active {
    transform: scale(0.96) !important;
}

/* WhatsApp Pulsing Glowing Aura */
#tecnowelt-whatsapp-trigger .whatsapp-trigger-aura {
    position: absolute !important;
    inset: -6px !important;
    border-radius: 50% !important;
    background: radial-gradient(circle, rgba(37, 211, 102, 0.6) 0%, rgba(37, 211, 102, 0) 70%) !important;
    animation: twWhatsAppPulse 2.4s infinite !important;
    z-index: -1 !important;
    pointer-events: none !important;
}

@keyframes twWhatsAppPulse {
    0% { transform: scale(0.9); opacity: 0.8; }
    50% { transform: scale(1.25); opacity: 0.2; }
    100% { transform: scale(0.9); opacity: 0.8; }
}

#tecnowelt-whatsapp-trigger .whatsapp-icon-wrapper {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    color: #FFFFFF !important;
}

#tecnowelt-whatsapp-trigger .whatsapp-icon-wrapper svg {
    width: 30px !important;
    height: 30px !important;
    fill: #FFFFFF !important;
    display: block !important;
}

/* Tooltip for WhatsApp Trigger */
#tecnowelt-whatsapp-trigger .whatsapp-tooltip {
    position: absolute !important;
    right: 74px !important;
    top: 50% !important;
    transform: translateY(-50%) translateX(10px) !important;
    background: #075E54 !important;
    color: #FFFFFF !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    padding: 8px 14px !important;
    border-radius: 10px !important;
    white-space: nowrap !important;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2) !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: all 0.25s ease !important;
    line-height: 1.3 !important;
    z-index: 999999 !important;
}

.pos-bottom-left #tecnowelt-whatsapp-trigger .whatsapp-tooltip {
    right: auto !important;
    left: 74px !important;
    transform: translateY(-50%) translateX(-10px) !important;
}

#tecnowelt-whatsapp-trigger.tecnowelt-whatsapp-trigger:hover .whatsapp-tooltip {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(-50%) translateX(0) !important;
}

.tecnowelt-chatbot-root.is-open #tecnowelt-whatsapp-trigger.tecnowelt-whatsapp-trigger {
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(15px) scale(0.8) !important;
    pointer-events: none !important;
}

/* Sticky Floating Trigger Button */
.tecnowelt-chatbot-trigger {
    position: relative;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
    color: #FFFFFF;
    border: 2px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.35);
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    outline: none;
}

.tecnowelt-chatbot-trigger:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 15px 35px rgba(99, 102, 241, 0.45);
}

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

/* Pulsing Glowing Aura */
.trigger-aura {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.6) 0%, rgba(99, 102, 241, 0) 70%);
    animation: twBotPulse 2.4s infinite;
    z-index: -1;
    pointer-events: none;
}

@keyframes twBotPulse {
    0% { transform: scale(0.9); opacity: 0.8; }
    50% { transform: scale(1.25); opacity: 0.2; }
    100% { transform: scale(0.9); opacity: 0.8; }
}

.trigger-icon-open,
.trigger-icon-close {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.trigger-icon-close {
    position: absolute;
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
}

.tecnowelt-chatbot-root.is-open .trigger-icon-open {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
}

.tecnowelt-chatbot-root.is-open .trigger-icon-close {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.trigger-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #EF4444;
    color: #FFFFFF;
    font-size: 11px;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #FFFFFF;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    animation: twBadgeBounce 1.5s infinite;
}

.tecnowelt-chatbot-root.is-open .trigger-badge {
    display: none;
}

@keyframes twBadgeBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

.trigger-tooltip {
    position: absolute;
    right: 74px;
    top: 50%;
    transform: translateY(-50%) translateX(10px);
    background: #0F172A;
    color: #FFFFFF;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 10px;
    white-space: nowrap;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s ease;
}

.pos-bottom-left .trigger-tooltip {
    right: auto;
    left: 74px;
    transform: translateY(-50%) translateX(-10px);
}

.tecnowelt-chatbot-trigger:hover .trigger-tooltip {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

/* Popup Chat Window Drawer */
.tecnowelt-chatbot-window {
    position: absolute;
    bottom: 78px;
    width: 390px;
    max-width: calc(100vw - 32px);
    height: 600px;
    max-height: calc(100vh - 120px);
    background: #FFFFFF;
    border-radius: var(--tw-bot-radius);
    box-shadow: var(--tw-bot-shadow);
    border: 1px solid var(--tw-bot-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.94);
    transform-origin: bottom right;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 999999;
}

.pos-bottom-right .tecnowelt-chatbot-window {
    right: 0;
    transform-origin: bottom right;
}

.pos-bottom-left .tecnowelt-chatbot-window {
    left: 0;
    transform-origin: bottom left;
}

.tecnowelt-chatbot-root.is-open .tecnowelt-chatbot-window {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Chat Header */
.chatbot-header {
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
    color: #FFFFFF;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

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

.header-avatar {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(135deg, #6366F1 0%, #4F46E5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.bot-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #FFFFFF;
    line-height: 1.2;
}

.bot-status {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 3px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10B981;
    box-shadow: 0 0 8px #10B981;
}

.status-text {
    font-size: 11px;
    color: #94A3B8;
    font-weight: 500;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-btn {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: #CBD5E1;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.header-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #FFFFFF;
}

/* Chat Message Body */
.chatbot-messages-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #F8FAFC;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
}

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

.chatbot-messages-body::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 10px;
}

/* Message Rows */
.chat-row {
    display: flex;
    flex-direction: column;
    max-width: 86%;
}

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

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

.chat-bubble {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.55;
    word-break: break-word;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
}

.user-row .chat-bubble {
    background: var(--tw-bot-user-bubble);
    color: #FFFFFF;
    border-bottom-right-radius: 4px;
}

.bot-row .chat-bubble {
    background: #FFFFFF;
    color: var(--tw-bot-text-dark);
    border: 1px solid var(--tw-bot-border);
    border-bottom-left-radius: 4px;
}

.chat-time {
    font-size: 10px;
    color: #94A3B8;
    margin-top: 4px;
}

.user-row .chat-time {
    text-align: right;
}

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

/* Formatted Text inside Bot Bubble */
.chat-bubble p {
    margin: 0 0 8px 0;
}

.chat-bubble p:last-child {
    margin-bottom: 0;
}

.chat-bubble strong {
    font-weight: 700;
    color: #0F172A;
}

.chat-bubble ul, .chat-bubble ol {
    margin: 6px 0;
    padding-left: 18px;
}

.chat-bubble li {
    margin-bottom: 4px;
}

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

/* Source Link Cards */
.chatbot-sources-wrapper {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.source-card-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748B;
    margin-bottom: 2px;
}

.source-link-pill {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #F1F5F9;
    border: 1px solid #E2E8F0;
    padding: 8px 12px;
    border-radius: 10px;
    text-decoration: none !important;
    color: #0F172A !important;
    transition: all 0.2s ease;
}

.source-link-pill:hover {
    background: #6366F1;
    color: #FFFFFF !important;
    border-color: #6366F1;
    transform: translateX(2px);
}

.source-link-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.source-link-name {
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.source-link-pill:hover .source-link-name {
    color: #FFFFFF;
}

.source-link-type {
    font-size: 10px;
    color: #64748B;
}

.source-link-pill:hover .source-link-type {
    color: rgba(255, 255, 255, 0.8);
}

.source-link-arrow {
    font-weight: bold;
    font-size: 14px;
    margin-left: 8px;
}

/* Starter Suggestion Chips */
.chatbot-prompts-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.prompt-chip {
    background: #FFFFFF;
    border: 1px solid #CBD5E1;
    color: #334155;
    font-size: 12px;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.prompt-chip:hover {
    background: #6366F1;
    color: #FFFFFF;
    border-color: #6366F1;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.25);
}

/* Typing Bouncing Dots */
.typing-bubble {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 12px 18px;
}

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

/* Chat Footer & Input Form */
.chatbot-footer {
    background: #FFFFFF;
    padding: 14px 16px;
    border-top: 1px solid var(--tw-bot-border);
}

.chatbot-form {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #F1F5F9;
    border: 1px solid #CBD5E1;
    padding: 6px 6px 6px 14px;
    border-radius: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.chatbot-form:focus-within {
    border-color: #6366F1;
    background: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.chatbot-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 14px;
    color: #0F172A;
    resize: none;
    max-height: 90px;
    line-height: 1.4;
}

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

.chatbot-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #6366F1 0%, #4F46E5 100%);
    color: #FFFFFF;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.chatbot-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

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

.chatbot-credits {
    text-align: center;
    font-size: 10px;
    color: #94A3B8;
    margin-top: 8px;
}

.chatbot-credits span {
    font-weight: 600;
    color: #64748B;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    .tecnowelt-chatbot-root {
        bottom: 16px;
    }
    .tecnowelt-chatbot-root.pos-bottom-right {
        right: 16px;
    }
    .tecnowelt-chatbot-root.pos-bottom-left {
        left: 16px;
    }
    .tecnowelt-chatbot-window {
        bottom: 74px;
        width: calc(100vw - 32px);
        height: 520px;
    }
}

/* ==========================================================================
   Homepage Hero AI Interactive Prompt Input Component
   ========================================================================== */
.hero-ai-search-wrapper {
    max-width: 680px;
    margin: 40px auto 48px auto;
    width: 100%;
}

.hero-ai-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.hero-ai-input-container {
    display: flex;
    align-items: center;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(99, 102, 241, 0.4);
    border-radius: 50px;
    padding: 6px 8px 6px 18px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.35), 0 0 25px rgba(99, 102, 241, 0.2);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-ai-input-container:focus-within {
    border-color: #6366F1;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.45), 0 0 35px rgba(99, 102, 241, 0.45);
    transform: translateY(-2px);
}

.hero-ai-sparkle {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #818CF8;
    margin-right: 10px;
    flex-shrink: 0;
    animation: twSparkleGlow 2.5s infinite ease-in-out;
}

@keyframes twSparkleGlow {
    0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.8; }
    50% { transform: scale(1.15) rotate(15deg); opacity: 1; color: #A5B4FC; }
}

.hero-ai-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #FFFFFF;
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    padding: 8px 0;
}

.hero-ai-input::placeholder {
    color: #94A3B8;
    font-weight: 400;
}

.hero-ai-submit-btn {
    background: linear-gradient(135deg, #6366F1 0%, #4F46E5 100%);
    color: #FFFFFF;
    border: none;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    padding: 10px 22px;
    border-radius: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.hero-ai-submit-btn:hover {
    transform: scale(1.04);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}

.hero-ai-tags {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12px;
    margin-top: 6px;
    margin-bottom: 8px;
}

.ai-tag-label {
    color: #94A3B8;
    font-weight: 500;
    margin-right: 4px;
}

.hero-ai-tag-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #CBD5E1;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hero-ai-tag-btn:hover {
    background: rgba(99, 102, 241, 0.25);
    border-color: #6366F1;
    color: #FFFFFF;
    transform: translateY(-1px);
}

.hero-trust {
    margin-top: 36px !important;
}

@media (max-width: 640px) {
    .hero-ai-input-container {
        padding: 4px 6px 4px 14px;
    }
    .hero-ai-input {
        font-size: 13px;
    }
    .hero-ai-submit-btn {
        padding: 8px 14px;
        font-size: 13px;
    }
}

