#svac-chat-widget {
    position: fixed !important;
    bottom: 20px !important;
    bottom: calc(20px + env(safe-area-inset-bottom)) !important;
    right: 20px !important;
    left: auto !important;
    z-index: 999999999 !important;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    margin: 0 !important;
    padding: 0 !important;
    width: auto !important;
    height: auto !important;
    -webkit-transform: translateZ(0);
    /* Force hardware acceleration */
    transform: translateZ(0);
}

/* Floating Trigger */
#svac-chat-trigger-wrapper {
    position: relative;
    display: flex;
    flex-direction: row;
    /* Text on left, trigger on right */
    align-items: center;
    gap: 15px;
}

#svac-chat-bubble-text {
    background: white;
    color: #334155;
    padding: 10px 18px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    white-space: nowrap;
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
    position: relative;
}

#svac-chat-bubble-text.show {
    opacity: 1;
    transform: translateX(0);
}

#svac-chat-bubble-text::after {
    content: '';
    position: absolute;
    right: -8px;
    /* Arrow on the right */
    top: 50%;
    transform: translateY(-50%);
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 8px solid white;
    /* Pointing right */
}

#svac-chat-trigger {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

#svac-chat-trigger:hover {
    transform: scale(1.1) rotate(5deg);
}

#svac-notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    font-size: 12px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

#svac-notification-badge.show {
    display: flex;
    animation: svac-pulse 2s infinite;
}

@keyframes svac-pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }

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

/* Chat Container */
#svac-chat-container {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 550px;
    background: white;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    transition: all 0.4s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

#svac-chat-container.svac-hidden {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
}

/* Header */
#svac-chat-header {
    padding: 20px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.svac-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 16px;
}

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

#svac-close-chat {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    opacity: 0.8;
}

/* Team Section */
.svac-team-section {
    background: white;
    padding: 12px 20px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: 12px;
}

.svac-team-avatars {
    display: flex;
    align-items: center;
}

.svac-team-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid white;
    margin-right: -10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background: #e2e8f0;
    object-fit: cover;
}

.svac-team-info {
    font-size: 11px;
    color: #64748b;
    line-height: 1.2;
}

.svac-team-names {
    font-weight: 600;
    color: #334155;
    font-size: 13px;
}

.svac-agent-role {
    font-size: 10px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Messages Area */
#svac-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: #f8fafc;
}

.svac-message {
    max-width: 85%;
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.svac-user {
    align-self: flex-end;
}

.svac-ai {
    align-self: flex-start;
}

.svac-msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
    border: 1px solid rgba(0, 0, 0, 0.05);
    background: white;
}

.svac-message-content {
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
}

.svac-user .svac-message-content {
    background-color: var(--svac-primary);
    color: white;
    border-bottom-right-radius: 4px;
}

/* Typing Indicator */
.svac-typing {
    display: flex;
    gap: 6px;
    padding: 14px 22px;
    background: #f1f5f9;
    border-radius: 20px;
    border-bottom-left-radius: 4px;
    width: fit-content;
    margin: 5px 0 15px 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
    align-items: center;
}

.svac-typing span {
    width: 7px;
    height: 7px;
    background: #cbd5e1;
    border-radius: 50%;
    display: inline-block;
    animation: svac-typing-bounce 1.3s infinite ease-in-out;
}

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

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

@keyframes svac-typing-bounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.6;
    }

    30% {
        transform: translateY(-5px);
        opacity: 1;
    }
}

.svac-ai .svac-message-content {
    background: white;
    color: #334155;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

/* Affiliate Button */
.svac-affiliate-btn {
    display: block;
    margin-top: 15px;
    padding: 12px;
    text-align: center;
    color: #ffffff !important;
    font-weight: 800;
    text-decoration: none !important;
    border-radius: 12px;
    text-transform: uppercase;
    font-size: 13px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
    border: 2px solid rgba(0, 0, 0, 0.1);
}

.svac-affiliate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
    filter: brightness(1.1);
}

/* Input Area */
#svac-chat-input-area {
    padding: 18px 15px;
    background: linear-gradient(to bottom, #ffffff 0%, #f8fafc 100%);
    display: flex;
    gap: 12px;
    align-items: center;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 10;
}

#svac-user-input {
    flex: 1;
    border: 2px solid #f1f5f9;
    padding: 12px 18px;
    border-radius: 24px;
    outline: none;
    font-size: 14px;
    background: #ffffff;
    color: #1e293b;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#svac-user-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

#svac-user-input:focus {
    border-color: rgba(var(--svac-primary-rgb), 0.5);
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(var(--svac-primary-rgb), 0.1),
        0 0 0 4px rgba(var(--svac-primary-rgb), 0.05);
    transform: translateY(-1px);
}

#svac-send-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: linear-gradient(135deg, var(--svac-primary) 0%, #312e81 100%);
    box-shadow: 0 4px 12px rgba(var(--svac-primary-rgb), 0.3);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    flex-shrink: 0;
    padding: 0;
}

#svac-send-btn:hover {
    transform: scale(1.08) rotate(5deg);
    box-shadow: 0 6px 20px rgba(var(--svac-primary-rgb), 0.4);
    filter: brightness(1.1);
}

#svac-send-btn svg {
    width: 20px;
    height: 20px;
    margin-left: 2px;
    transition: transform 0.3s ease;
}

#svac-send-btn:hover svg {
    transform: translate(2px, -2px);
}

#svac-send-btn:active {
    transform: scale(0.95);
}

.svac-footer-credit {
    padding: 8px;
    text-align: center;
    font-size: 10px;
    color: #94a3b8;
    background: #f8fafc;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Premium Scanning Animation */
.svac-scanning {
    min-width: 240px;
    padding: 10px 0;
    position: relative;
}

.svac-scan-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.svac-scan-status {
    font-size: 12px;
    font-weight: 600;
    color: var(--svac-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.svac-scan-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--svac-primary);
    border-radius: 50%;
    display: inline-block;
    animation: svac-pulse 1s infinite;
}

.svac-scan-percentage {
    font-size: 11px;
    color: #64748b;
    font-family: monospace;
}

.svac-scan-bar {
    width: 100%;
    height: 8px;
    background: #f1f5f9;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.svac-scan-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--svac-primary) 0%, #6366f1 100%);
    box-shadow: 0 0 15px var(--svac-primary);
    border-radius: 20px;
    animation: svac-scan-progress 5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.svac-scan-stages {
    margin-top: 8px;
    font-size: 10px;
    color: #94a3b8;
    font-style: italic;
    height: 14px;
    overflow: hidden;
}

@keyframes svac-pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.5);
        opacity: 0.5;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes svac-scan-progress {
    0% {
        width: 0%;
    }

    20% {
        width: 15%;
    }

    50% {
        width: 60%;
    }

    80% {
        width: 85%;
    }

    100% {
        width: 100%;
    }
}

/* Suggestion Chips */
#svac-suggestion-chips {
    display: flex;
    gap: 8px;
    padding: 0 15px 10px;
    overflow-x: auto;
    scrollbar-width: none;
}

#svac-suggestion-chips::-webkit-scrollbar {
    display: none;
}

.svac-chip {
    white-space: nowrap;
    padding: 6px 14px;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.svac-chip:hover {
    background: var(--svac-primary);
    color: white;
    border-color: var(--svac-primary);
}

/* Typing Indicator */
.svac-typing {
    display: flex;
    gap: 4px;
    padding: 10px 0;
}

.svac-typing span {
    width: 6px;
    height: 6px;
    background: #94a3b8;
    border-radius: 50%;
    animation: svac-typing-bounce 1s infinite;
}

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

.svac-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes svac-typing-bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

/* Mobile Adjustments */
@media (max-width: 480px) {
    #svac-chat-widget {
        bottom: 20px !important;
        right: 20px !important;
        left: auto !important;
    }

    #svac-chat-bubble-text {
        font-size: 11px;
        padding: 8px 12px;
        max-width: 180px;
        white-space: normal;
        line-height: 1.3;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    }

    #svac-chat-container {
        width: calc(160% - 20px);
        height: 80vh;
        bottom: 70px;
        right: 10px;
        left: auto;
        border-radius: 15px;
    }

    #svac-chat-messages {
        padding: 15px;
    }

    .svac-message-content {
        font-size: 13px;
    }
}