/* ATG Chatbot - Front-end Styles */

:root {
    --atg-chat-width: 450px;
    --atg-chat-height: 520px;
    --atg-header-height: 56px;
    --atg-border-radius: 16px;
    --atg-transition-speed: 0.3s;
}

/* Popup container */
#atg-chatbot-popup {
    display: none;
    position: fixed;
    bottom: 32px;
    width: var(--atg-chat-width);
    height: var(--atg-chat-height);
    background: #fff;
    border-radius: var(--atg-border-radius);
    box-shadow: 0 18px 40px -5px rgba(0, 0, 0, 0.2),
                0 15px 20px -5px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    opacity: 0;
    transform: scale(0.95);
    transition: all var(--atg-transition-speed) ease-in-out;
    z-index: 999999;
}

#atg-chatbot-popup.atg-chatbot-right {
    right: 32px;
    transform-origin: bottom right;
}

#atg-chatbot-popup.atg-chatbot-left {
    left: 32px;
    transform-origin: bottom left;
}

#atg-chatbot-popup.atg-chatbot-visible {
    display: block;
    opacity: 1;
    transform: scale(1);
}

/* Header */
#atg-chatbot-header {
    padding: 16px 20px;
    height: var(--atg-header-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.atg-chatbot-header-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    font-weight: 500;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.atg-chatbot-header-buttons {
    display: flex;
    gap: 12px;
    align-items: center;
}

.atg-chatbot-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: inherit;
}

.atg-chatbot-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.atg-chatbot-btn:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* Web Chat area */
#atg-chatbot-webchat {
    height: calc(100% - var(--atg-header-height));
    background-color: #f9fafb;
    position: relative;
}

#atg-chatbot-webchat > div {
    position: relative;
    z-index: 2;
}

#atg-chatbot-webchat .webchat__basic-transcript__content {
    white-space: pre-wrap !important;
    word-break: break-word !important;
}

#atg-chatbot-webchat .webchat__bubble__content {
    padding: 8px 12px !important;
}

#atg-chatbot-webchat .webchat__bubble:not(.webchat__bubble--from-user) .webchat__bubble__content {
    border-radius: 10px !important;
}

#atg-chatbot-webchat .webchat__bubble {
    max-width: 85% !important;
    margin: 8px !important;
}

#atg-chatbot-webchat .webchat__basic-transcript__content ul,
#atg-chatbot-webchat .webchat__basic-transcript__content ol,
#atg-chatbot-webchat .webchat__bubble__content ul,
#atg-chatbot-webchat .webchat__bubble__content ol {
    padding-left: 24px !important;
    margin: 8px 0 !important;
    list-style-position: outside !important;
}

#atg-chatbot-webchat .webchat__basic-transcript__content li,
#atg-chatbot-webchat .webchat__bubble__content li {
    margin: 4px 0 !important;
    padding-left: 4px !important;
}

/* Open chat button */
#atg-chatbot-open {
    position: fixed;
    bottom: 32px;
    width: 64px;
    height: 64px;
    padding: 0;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all var(--atg-transition-speed) ease-in-out;
    z-index: 999998;
}

#atg-chatbot-open.atg-chatbot-right {
    right: 32px;
}

#atg-chatbot-open.atg-chatbot-left {
    left: 32px;
}

#atg-chatbot-open.atg-chatbot-hidden {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
    pointer-events: none;
}

#atg-chatbot-open:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

#atg-chatbot-open:focus {
    outline: 3px solid rgba(79, 70, 229, 0.5);
    outline-offset: 2px;
}

#atg-chatbot-open svg {
    width: 28px;
    height: 28px;
    color: #fff;
    transition: transform 0.2s ease;
}

/* Mobile responsive */
@media (max-width: 768px) {
    #atg-chatbot-popup {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0 !important;
        left: 0 !important;
        border-radius: 0;
    }
}
