/* aGo AI, Chat Widget Stylesheet */

#ago-ai-widget {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    box-sizing: border-box;
}

#ago-ai-widget *, #ago-ai-widget *:before, #ago-ai-widget *:after {
    box-sizing: border-box;
}

/* Toggle Button Styles */
.ago-ai-toggle {
    position: fixed;
    bottom: 20px;
    z-index: 999999;
    border: none;
    outline: none;
    cursor: pointer;
    border-radius: 28px;
    height: 56px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease, background 0.2s ease;
}

.ago-ai-toggle:hover {
    transform: scale(1.05);
}

.ago-ai-toggle.right {
    right: 20px;
}

.ago-ai-toggle.left {
    left: 20px;
}

.ago-ai-toggle.ago-offset-1 {
    bottom: 80px;
}

.ago-ai-toggle.ago-offset-2 {
    bottom: 140px;
}

.ago-ai-toggle svg {
    width: 24px;
    height: 24px;
    fill: #fff;
    flex-shrink: 0;
}

.ago-ai-help-label {
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
}

/* Chat Window Box */
.ago-ai-window {
    position: fixed;
    bottom: 90px;
    z-index: 999999;
    width: 380px;
    height: 520px;
    max-height: 80vh;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px) scale(0.95);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.ago-ai-window.right {
    right: 20px;
}

.ago-ai-window.left {
    left: 20px;
}

.ago-ai-window.ago-offset-1 {
    bottom: 150px;
}

.ago-ai-window.ago-offset-2 {
    bottom: 210px;
}

.ago-ai-window.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

/* Chat Header */
.ago-ai-header {
    padding: 14px 16px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.ago-ai-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background: #fff;
    flex-shrink: 0;
}

.ago-ai-header-info {
    flex-grow: 1;
    overflow: hidden;
}

.ago-ai-header-info h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ago-ai-header-info span {
    font-size: 12px;
    opacity: 0.85;
}

.ago-ai-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.ago-ai-close:hover {
    opacity: 1;
}

/* Chat Messages Area */
.ago-ai-messages {
    flex-grow: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f9f9f9;
}

.ago-ai-msg {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13.5px;
    line-height: 1.45;
    word-break: break-word;
}

.ago-ai-msg.user {
    align-self: flex-end;
    color: #fff;
    border-bottom-right-radius: 2px;
}

.ago-ai-msg.bot {
    align-self: flex-start;
    background: #e9ecef;
    color: #212529;
    border-bottom-left-radius: 2px;
}

/* Chat Input Footer Area */
.ago-ai-input-area {
    padding: 12px;
    background: #fff;
    border-top: 1px solid #eaeaea;
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.ago-ai-input {
    flex-grow: 1;
    padding: 10px 14px;
    border: 1px solid #ced4da;
    border-radius: 20px;
    outline: none;
    font-size: 13.5px;
    transition: border-color 0.2s;
}

.ago-ai-input:focus {
    border-color: #2271b1;
}

.ago-ai-send {
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: opacity 0.2s;
}

.ago-ai-send:hover {
    opacity: 0.9;
}

.ago-ai-send svg {
    width: 16px;
    height: 16px;
    fill: #fff;
}

/* Lead Capture Task Form Container */
.ago-ai-task-form {
    background: #fff;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    margin-top: 4px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
}

.ago-ai-task-form h4 {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.ago-ai-task-form input,
.ago-ai-task-form textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
}

.ago-ai-task-form input:focus,
.ago-ai-task-form textarea:focus {
    border-color: #2271b1;
}

.ago-task-send-btn {
    padding: 8px;
    border: none;
    border-radius: 6px;
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.ago-task-send-btn:hover {
    opacity: 0.9;
}

.ago-ai-task-sent {
    text-align: center;
    padding: 10px;
    font-weight: 600;
    color: #28a745;
    background: #e8f5e9;
    border-radius: 6px;
    font-size: 13px;
}

/* ==========================================================
   MOBILE BODY LOCK & FULLSCREEN CHAT OVERLAY STYLES
   ========================================================== */
@media screen and (max-width: 480px) {
    body.ago-chat-active {
        overflow: hidden !important;
        position: fixed !important;
        width: 100% !important;
        height: 100% !important;
    }

    .ago-ai-window.open {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100% !important;
        max-height: 100% !important;
        border-radius: 0 !important;
        transform: none !important;
        display: flex !important;
        flex-direction: column !important;
        z-index: 99999999 !important;
    }

    .ago-ai-messages {
        flex: 1 1 auto !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .ago-ai-input-area {
        flex: 0 0 auto !important;
        background: #fff !important;
        padding-bottom: 20px !important;
    }
}