/* ================================================================
   CHATBOT WIDGET — Hero Section
   Premium glassmorphism AI chat interface + Spline Robot Head
   ================================================================ */

/* ── HIDE SPLINE WATERMARK ───────────────────────────────── */
.chatbot-robot-head spline-viewer::part(logo),
.chatbot-robot-head #logo {
    display: none !important;
}

/* ── LAYOUT: text LEFT, chatbot RIGHT ────────────────────── */
#hero-split {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    text-align: left !important;
    gap: 3rem;
    justify-content: space-between;
}

#hero-split .hero-content {
    flex: 1 1 0;
    min-width: 0;
}

#hero-split .hero-buttons {
    justify-content: flex-start !important;
}

#hero-split .hero-description {
    text-align: left !important;
    max-width: none !important;
}

#hero-split .social-links {
    justify-content: flex-start !important;
}

/* Mobile: stack vertically */
@media (max-width: 960px) {
    #hero-split {
        flex-direction: column !important;
        text-align: center !important;
        gap: 2rem;
    }

    #hero-split .hero-content {
        flex: none;
        width: 100%;
    }

    #hero-split .hero-buttons {
        justify-content: center !important;
    }

    #hero-split .social-links {
        justify-content: center !important;
    }
}

/* ── CHATBOT WIDGET ──────────────────────────────────────── */
.hero-chatbot {
    flex: 0 0 400px;
    width: 400px;
    display: flex;
    flex-direction: column;
    background: rgba(5, 9, 21, 0.85);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 24px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow:
        0 0 0 1px rgba(168, 85, 247, 0.08),
        0 24px 70px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    overflow: hidden;
    position: relative;
}

/* Animated top gradient border */
.hero-chatbot::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #a855f7, #06b6d4, #a855f7);
    background-size: 200% 100%;
    animation: borderShimmer 3s linear infinite;
    z-index: 2;
}

@keyframes borderShimmer {
    0% {
        background-position: 0% 0%;
    }

    100% {
        background-position: 200% 0%;
    }
}

/* ── ROBOT HEAD (Spline embed, cropped) ──────────────────── */
.chatbot-robot-head {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
    background: #050915;
    border-bottom: 1px solid rgba(168, 85, 247, 0.15);
    flex-shrink: 0;
}

.chatbot-robot-head spline-viewer {
    position: absolute;
    width: 100% !important;
    height: 420px !important;
    top: -80px;
    left: 0;
    pointer-events: none;
}

/* Name + status bar over robot head */
.chatbot-head-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.6rem 1rem;
    background: linear-gradient(to top, rgba(5, 9, 21, 0.95), transparent);
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 3;
}

.chatbot-head-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: #f1f5f9;
    letter-spacing: 0.03em;
}

.chatbot-online {
    font-size: 0.68rem;
    font-weight: 700;
    color: #4ade80;
    letter-spacing: 0.1em;
}

/* ── MESSAGES ────────────────────────────────────────────── */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0.85rem 0.9rem 0.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    min-height: 180px;
    max-height: 220px;
    scroll-behavior: smooth;
}

.chatbot-messages::-webkit-scrollbar {
    width: 3px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(168, 85, 247, 0.3);
    border-radius: 4px;
}

/* Chat bubbles */
.chat-msg {
    max-width: 85%;
    padding: 0.6rem 0.9rem;
    border-radius: 14px;
    font-size: 0.85rem;
    line-height: 1.5;
    word-break: break-word;
    animation: msgPop 0.22s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes msgPop {
    from {
        opacity: 0;
        transform: scale(0.85) translateY(8px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.chat-msg--bot {
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.22);
    color: #e2e8f0;
    align-self: flex-start;
    border-bottom-left-radius: 3px;
}

.chat-msg--user {
    background: linear-gradient(135deg, rgba(168, 85, 247, .28), rgba(6, 182, 212, .18));
    border: 1px solid rgba(6, 182, 212, .28);
    color: #f1f5f9;
    align-self: flex-end;
    border-bottom-right-radius: 3px;
    text-align: right;
}

/* Typing indicator */
.chat-typing {
    align-self: flex-start;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0.55rem 0.85rem;
    background: rgba(168, 85, 247, .1);
    border: 1px solid rgba(168, 85, 247, .2);
    border-radius: 14px;
    border-bottom-left-radius: 3px;
}

.chat-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #a855f7;
    animation: typingDot 1.2s ease-in-out infinite;
}

.chat-typing span:nth-child(2) {
    animation-delay: .2s;
}

.chat-typing span:nth-child(3) {
    animation-delay: .4s;
}

@keyframes typingDot {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: .4;
    }

    30% {
        transform: translateY(-6px);
        opacity: 1;
    }
}

/* ── INPUT AREA ──────────────────────────────────────────── */
.chatbot-input-area {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 0.9rem;
    border-top: 1px solid rgba(168, 85, 247, .12);
    background: rgba(0, 0, 0, .25);
    flex-shrink: 0;
}

#chatbot-input {
    flex: 1;
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(168, 85, 247, .22);
    border-radius: 50px;
    padding: 0.55rem 0.9rem;
    font-size: 0.85rem;
    color: #f1f5f9;
    outline: none;
    font-family: 'Inter', sans-serif;
    transition: border-color .2s, box-shadow .2s;
}

#chatbot-input::placeholder {
    color: rgba(203, 213, 225, .3);
}

#chatbot-input:focus {
    border-color: rgba(168, 85, 247, .65);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, .1);
}

#chatbot-send {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #a855f7, #06b6d4);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform .2s, box-shadow .2s;
    box-shadow: 0 0 12px rgba(168, 85, 247, .5);
}

#chatbot-send:hover {
    transform: scale(1.1);
    box-shadow: 0 0 22px rgba(168, 85, 247, .8);
}

#chatbot-send:disabled {
    opacity: .5;
    cursor: not-allowed;
    transform: none;
}

/* ── CHATBOT RESPONSIVE ──────────────────────────────────── */
@media (max-width: 960px) {
    .hero-chatbot {
        flex: none !important;
        width: 100% !important;
        max-width: 100% !important;
    }
}