:root {
    --sys-primary: #1111bb; /* Sysprovider Blue */
    --sys-primary-hover: #0b0b8c;
    --sys-bg-dark: rgba(10, 15, 50, 0.75); /* More transparent for glassmorphism */
    --sys-bg-light: rgba(255, 255, 255, 0.1);
    --sys-text: #ffffff;
    --sys-text-muted: #94a3b8;
    --sys-border: rgba(255, 255, 255, 0.15);
    --sys-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
    --sys-hero-gradient: linear-gradient(135deg, rgba(17, 17, 187, 0.9) 0%, rgba(116, 115, 253, 0.9) 100%);
}

#sysbot-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999999;
    font-family: 'Inter', 'Roboto', sans-serif;
}

#sysbot-button {
    height: 60px;
    padding: 0 20px 0 10px;
    background: var(--sys-hero-gradient);
    border-radius: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(17, 17, 187, 0.4);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
    color: white;
    gap: 12px;
}

#sysbot-button:hover {
    transform: scale(1.05) translateY(-5px);
    box-shadow: 0 8px 25px rgba(17, 17, 187, 0.6);
}

.sysbot-avatar-img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    background: white;
    border: 2px solid white;
}

.sysbot-call-to-action {
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

#sysbot-window {
    position: absolute;
    bottom: 85px;
    right: 0;
    width: 380px; /* Slightly wider */
    height: 550px;
    background: var(--sys-bg-dark);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--sys-border);
    border-radius: 16px;
    box-shadow: var(--sys-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 1;
    transform: translateY(0) scale(1);
    transform-origin: bottom right;
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#sysbot-window.sysbot-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px) scale(0.9);
}

#sysbot-header {
    padding: 16px 20px;
    background: var(--sys-hero-gradient);
    border-bottom: 1px solid var(--sys-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sysbot-title {
    display: flex;
    flex-direction: column;
}

.sysbot-title span {
    color: var(--sys-text);
    font-weight: 600;
    font-size: 16px;
}

.sysbot-status {
    color: #4CAF50;
    font-size: 12px;
    margin-top: 2px;
    display: flex;
    align-items: center;
}

.sysbot-status::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #4CAF50;
    border-radius: 50%;
    margin-right: 6px;
}

#sysbot-close {
    background: none;
    border: none;
    color: var(--sys-text-muted);
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s ease;
    line-height: 1;
}

#sysbot-close:hover {
    color: var(--sys-text);
}

#sysbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Scrollbar styles */
#sysbot-messages::-webkit-scrollbar {
    width: 6px;
}
#sysbot-messages::-webkit-scrollbar-track {
    background: transparent;
}
#sysbot-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.sysbot-message {
    max-width: 85%;
    width: fit-content;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
    white-space: pre-wrap;
    animation: sysbot-fade-in 0.3s ease;
}

.sysbot-message p {
    margin: 0 0 8px 0;
}
.sysbot-message p:last-child {
    margin: 0;
}

.sysbot-ai {
    background: var(--sys-bg-light);
    color: var(--sys-text);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.sysbot-user {
    background: var(--sys-primary);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

#sysbot-input-area {
    padding: 15px;
    border-top: 1px solid var(--sys-border);
    display: flex;
    gap: 10px;
    background: rgba(0, 0, 0, 0.1);
}

#sysbot-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--sys-border);
    border-radius: 20px;
    padding: 10px 15px;
    color: var(--sys-text);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease, background 0.2s ease;
}

#sysbot-input:focus {
    border-color: var(--sys-primary);
    background: rgba(255, 255, 255, 0.1);
}

#sysbot-input::placeholder {
    color: var(--sys-text-muted);
}

#sysbot-send {
    background: var(--sys-primary);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 0 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

#sysbot-send:hover {
    background: var(--sys-primary-hover);
}

.sysbot-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background: var(--sys-bg-light);
    border-radius: 12px;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    width: fit-content;
}

.sysbot-dot {
    width: 6px;
    height: 6px;
    background: var(--sys-text-muted);
    border-radius: 50%;
    animation: sysbot-bounce 1.4s infinite ease-in-out both;
}

.sysbot-dot:nth-child(1) { animation-delay: -0.32s; }
.sysbot-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes sysbot-fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes sysbot-bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

@media (max-width: 480px) {
    #sysbot-window {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
        border: none;
        z-index: 999999;
    }
    #sysbot-container {
        bottom: 20px;
        right: 20px;
    }
}

#sysbot-promo {
    padding: 8px 15px;
    background: rgba(0, 0, 0, 0.2);
    font-size: 11px;
    text-align: center;
    color: var(--sys-text-muted);
    border-top: 1px solid var(--sys-border);
}

#sysbot-promo a {
    color: var(--sys-text);
    text-decoration: underline;
    font-weight: 500;
    transition: color 0.2s ease;
}

#sysbot-promo a:hover {
    color: #7473fd;
}
