/* AI Customer Floating Chat Widget - Light Only Indigo */
.landing-ai-widget {
    --bs-primary: #6366f1;
    --bs-primary-rgb: 99, 102, 241;
}

#ai-customer-wrapper {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    font-family: 'Inter', sans-serif;
}

#ai-customer-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--bs-primary), rgba(var(--bs-primary-rgb), 0.8));
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(var(--bs-primary-rgb), 0.25);
    transition: all 0.3s ease;
}

#ai-customer-btn lottie-player {
    width: 45px !important;
    height: 45px !important;
    margin: auto !important;
    display: block !important;
}

#ai-customer-btn:hover {
    transform: scale(1.1) rotate(5deg);
}

#ai-customer-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 500px;
    background: #f8fafc;
    border-radius: 20px;
    display: none;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 15px 50px rgba(15, 23, 42, 0.12);
    border: 1px solid #e2e8f0;
}

#ai-customer-header {
    background: #ffffff;
    padding: 20px;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    border-bottom: 1px solid #e2e8f0;
}

#ai-customer-header > div {
    display: flex !important;
    align-items: center !important;
}

#ai-customer-header > div:first-child lottie-player {
    margin-left: 8px !important;
    margin-right: 8px !important;
}

#ai-customer-header > div:last-child {
    gap: 12px !important;
}

#ai-customer-header .title {
    color: #0f172a;
    font-weight: 600;
}

#ai-customer-body {
    display: flex !important;
    flex-direction: column !important;
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8fafc;
}

.ai-chat-msg {
    margin-bottom: 15px;
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 15px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    word-break: normal;
}

.ai-chat-msg.ai {
    background: #ffffff;
    color: #334155;
    align-self: flex-start;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 2px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    width: fit-content;
}

.ai-msg-content {
    flex: 1;
    min-width: 0;
}

.ai-msg-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 1px solid #cbd5e1;
}

.ai-chat-msg.user {
    background: linear-gradient(135deg, var(--bs-primary), rgba(var(--bs-primary-rgb), 0.8));
    color: #ffffff;
    align-self: flex-end;
    margin-left: auto;
    border-bottom-right-radius: 2px;
}

#ai-customer-footer {
    padding: 15px;
    background: #ffffff;
    display: flex;
    gap: 10px;
    border-top: 1px solid #e2e8f0;
}

#ai-customer-input {
    flex: 1;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    padding: 10px 15px;
    color: #0f172a;
    font-size: 14px;
}

#ai-customer-input::placeholder {
    color: #94a3b8;
}

#ai-customer-input:focus {
    outline: none;
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.15);
}

#ai-customer-send {
    background: linear-gradient(135deg, var(--bs-primary), rgba(var(--bs-primary-rgb), 0.8));
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: #ffffff;
    cursor: pointer;
}

.ai-typing {
    display: flex;
    gap: 4px;
    margin-top: 5px;
}

.ai-typing span {
    width: 6px;
    height: 6px;
    background: var(--bs-primary);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.ai-typing-text {
    transition: all 0.3s ease;
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(2px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

.ai-typing span:nth-child(1) {
    animation-delay: -0.32s;
}

.ai-typing span:nth-child(2) {
    animation-delay: -0.16s;
}

/* Home View Styles */
.ai-view {
    display: none;
    flex-direction: column;
    height: 100%;
}

.ai-view.active {
    display: flex;
}

#ai-view-home {
    background: #f8fafc;
}

.ai-home-hero {
    background: linear-gradient(135deg, var(--bs-primary), rgba(var(--bs-primary-rgb), 0.8));
    padding: 30px 20px;
    text-align: center;
    color: #ffffff;
}

.ai-home-hero > div:first-child {
    text-align: right !important;
    display: block !important;
    margin-bottom: 10px !important;
    width: 100% !important;
}

#ai-home-close {
    font-size: 20px !important;
    cursor: pointer !important;
    display: inline-block !important;
}

.ai-home-hero i:not(#ai-home-close) {
    font-size: 50px;
    margin-bottom: 15px;
    display: block;
}

.ai-home-hero h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 10px;
}

.ai-home-hero p {
    font-size: 14px;
    opacity: 0.95;
}

.ai-home-content {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

.ai-home-btn {
    width: 100%;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 15px;
    color: #0f172a;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 15px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.ai-home-btn:hover {
    background: #f1f5f9;
    transform: translateY(-2px);
}

.ai-home-btn i {
    width: 40px;
    height: 40px;
    background: rgba(var(--bs-primary-rgb), 0.1);
    color: var(--bs-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-home-btn.primary {
    background: linear-gradient(135deg, var(--bs-primary) 0%, rgba(var(--bs-primary-rgb), 0.7) 100%) !important;
    border: none;
    color: #ffffff !important;
}

.ai-home-btn.primary i {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.ai-home-section-title {
    font-size: 12px;
    text-transform: uppercase;
    color: #64748b;
    letter-spacing: 1px;
    margin-bottom: 10px;
    margin-top: 10px;
}

.ai-history-item {
    padding: 12px;
    border-bottom: 1px solid #e2e8f0;
    cursor: pointer;
    transition: background 0.2s;
}

.ai-history-item:hover {
    background: #f1f5f9;
}

.ai-history-item .time {
    font-size: 11px;
    color: #94a3b8;
    float: right;
}

.ai-history-item .msg {
    font-size: 13px;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 4px;
}

.ai-view-footer {
    padding: 15px;
    text-align: center;
    font-size: 11px;
    color: #64748b;
    border-top: 1px solid #e2e8f0;
    background: #ffffff;
}

#ai-customer-back {
    cursor: pointer;
    margin-right: 15px;
    font-size: 18px;
    color: #64748b;
}

#ai-customer-back:hover {
    color: #0f172a;
}

/* AI Message Links & Buttons */
.ai-chat-msg.ai a {
    color: var(--bs-primary);
    text-decoration: underline;
    transition: color 0.2s;
}

.ai-chat-msg.ai a:hover {
    color: var(--bs-primary);
}

.ai-order-btn {
    display: block;
    width: 100%;
    margin-top: 10px;
    background: linear-gradient(135deg, var(--bs-primary), rgba(var(--bs-primary-rgb), 0.8));
    border: none;
    color: #ffffff !important;
    font-weight: 600;
    text-decoration: none !important;
    text-align: center;
    padding: 8px 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(var(--bs-primary-rgb), 0.2);
}

.ai-order-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(var(--bs-primary-rgb), 0.3);
    filter: brightness(1.05);
}

/* Mobile Responsiveness */
@media screen and (max-width: 768px) {
    #ai-customer-btn {
        display: none !important;
    }

    .landing-ai-widget #ai-customer-btn {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 50px !important;
        height: 50px !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .landing-ai-widget #ai-customer-btn lottie-player {
        width: 38px !important;
        height: 38px !important;
        margin: auto !important;
        display: block !important;
    }

    #ai-customer-window {
        width: 100% !important;
        height: 100% !important;
        position: fixed !important;
        bottom: 0 !important;
        right: 0 !important;
        border-radius: 0 !important;
        z-index: 10000;
    }

    #ai-customer-wrapper {
        bottom: 0;
        right: 0;
    }

    #ai-customer-wrapper.landing-ai-widget {
        bottom: 20px;
        right: 20px;
    }
}

/* Dark Mode Support */
[data-pc-theme="dark"] #ai-customer-window {
    background: #1a232e;
    border-color: #303f50;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.4);
}

[data-pc-theme="dark"] #ai-customer-header,
[data-pc-theme="dark"] #ai-customer-footer,
[data-pc-theme="dark"] .ai-view-footer {
    background: #263240;
    border-color: #303f50;
}

[data-pc-theme="dark"] #ai-customer-header .title,
[data-pc-theme="dark"] #ai-customer-input,
[data-pc-theme="dark"] .ai-home-btn {
    color: #e2e8f0;
}

[data-pc-theme="dark"] #ai-customer-body,
[data-pc-theme="dark"] #ai-view-home,
[data-pc-theme="dark"] #ai-customer-input {
    background: #1a232e;
}

[data-pc-theme="dark"] .ai-chat-msg.ai,
[data-pc-theme="dark"] .ai-home-btn:not(.primary) {
    background: #263240;
    border-color: #303f50;
    color: #cbd5e1;
}

[data-pc-theme="dark"] #ai-customer-input {
    border-color: #303f50;
}

[data-pc-theme="dark"] .ai-home-btn:hover,
[data-pc-theme="dark"] .ai-history-item:hover {
    background: #303f50;
}

[data-pc-theme="dark"] .ai-history-item {
    border-color: #303f50;
}

[data-pc-theme="dark"] .ai-history-item .msg {
    color: #94a3b8;
}

[data-pc-theme="dark"] .ai-home-section-title,
[data-pc-theme="dark"] #ai-customer-back {
    color: #94a3b8;
}