/* SalesCloud Chatbot Styles */
#scbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* Toggle Button */
#scbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--scbot-primary, #2AB9AD);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

#scbot-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

#scbot-toggle svg {
    width: 28px;
    height: 28px;
}

/* Chat Window */
#scbot-window {
    position: absolute;
    bottom: 75px;
    right: 0;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 520px;
    max-height: calc(100vh - 120px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.scbot-closed #scbot-window {
    display: none;
}

.scbot-open #scbot-window {
    display: flex;
    animation: scbot-slide-up 0.3s ease;
}

.scbot-open #scbot-icon-chat {
    display: none;
}

.scbot-open #scbot-icon-close {
    display: block !important;
}

@keyframes scbot-slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
#scbot-header {
    background: var(--scbot-primary, #2AB9AD);
    color: white;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.scbot-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scbot-avatar svg {
    width: 24px;
    height: 24px;
}

.scbot-title {
    font-weight: 600;
    font-size: 16px;
}

.scbot-subtitle {
    font-size: 12px;
    opacity: 0.9;
}

#scbot-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

#scbot-close:hover {
    opacity: 1;
}

#scbot-close svg {
    width: 20px;
    height: 20px;
}

/* Messages */
#scbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.scbot-message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.scbot-message-user {
    align-self: flex-end;
    background: var(--scbot-primary, #2AB9AD);
    color: white;
    border-bottom-right-radius: 4px;
}

.scbot-message-bot {
    align-self: flex-start;
    background: #f0f2f5;
    color: #1c1e21;
    border-bottom-left-radius: 4px;
}

/* Typing Indicator */
#scbot-typing {
    padding: 0 16px 8px;
}

.scbot-typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background: #f0f2f5;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
}

.scbot-typing-indicator span {
    width: 8px;
    height: 8px;
    background: #90949c;
    border-radius: 50%;
    animation: scbot-typing 1.4s infinite ease-in-out both;
}

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

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

@keyframes scbot-typing {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.6;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Form */
#scbot-form {
    display: flex;
    padding: 12px;
    gap: 8px;
    border-top: 1px solid #e4e6eb;
}

#scbot-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e4e6eb;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

#scbot-input:focus {
    border-color: var(--scbot-primary, #2AB9AD);
}

#scbot-send {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--scbot-primary, #2AB9AD);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: background 0.2s;
}

#scbot-send:hover {
    background: var(--scbot-primary-dark, #239990);
}

#scbot-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#scbot-send svg {
    width: 20px;
    height: 20px;
}

/* Footer */
#scbot-footer {
    padding: 8px;
    text-align: center;
    font-size: 11px;
    color: #90949c;
    background: #f8f9fa;
}

#scbot-footer a {
    color: var(--scbot-primary, #2AB9AD);
    text-decoration: none;
}

/* Responsive */
@media (max-width: 480px) {
    #scbot-container {
        bottom: 10px;
        right: 10px;
    }

    #scbot-window {
        width: calc(100vw - 20px);
        height: calc(100vh - 100px);
        bottom: 70px;
        right: -10px;
        border-radius: 12px;
    }

    #scbot-toggle {
        width: 54px;
        height: 54px;
    }
}
