/* aGo AI Chatbot Pro, Widget styles */

#ago-ai-widget { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-size: 14px; }
#ago-ai-widget *, #ago-ai-widget *::before, #ago-ai-widget *::after { box-sizing: border-box; }
#ago-ai-widget [hidden] { display: none !important; }

.ago-ai-toggle {
    position: fixed;
    bottom: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    z-index: 99998;
    background: var(--ago-c, #2271b1);
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.2s;
}
.ago-ai-toggle.right { right: 24px; }
.ago-ai-toggle.left  { left:  24px; }
.ago-ai-toggle.ago-offset-1 { bottom: 92px; }
.ago-ai-toggle.ago-offset-2 { bottom: 160px; }
.ago-ai-toggle:hover { transform: scale(1.06); }
.ago-ai-toggle:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

.ago-ai-pulse {
    position: absolute; inset: 0; border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(34,113,177,0.5);
    animation: ago-pulse 2s infinite;
    pointer-events: none;
}
@keyframes ago-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(34,113,177,0.45); }
    70%  { box-shadow: 0 0 0 12px rgba(34,113,177,0); }
    100% { box-shadow: 0 0 0 0 rgba(34,113,177,0); }
}

.ago-ai-panel {
    position: fixed;
    bottom: 92px;
    width: 360px;
    max-height: 72vh;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.25);
    display: flex; flex-direction: column;
    z-index: 99999;
    overflow: hidden;
    animation: ago-pop 0.22s ease-out;
}
.ago-ai-panel.right { right: 24px; }
.ago-ai-panel.left  { left:  24px; }
.ago-ai-panel.ago-offset-1 { bottom: 160px; }
.ago-ai-panel.ago-offset-2 { bottom: 228px; }
@keyframes ago-pop { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 600px) {
    .ago-ai-panel { width: 100%; max-height: 100vh; height: 100vh; bottom: 0; right: 0; left: 0; border-radius: 0; }
}

.ago-ai-header {
    color: #fff;
    padding: 10px 14px;
    display: flex; align-items: center; gap: 10px;
    min-height: 52px;
}
.ago-ai-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.ago-ai-title  { flex: 1; font-weight: 600; font-size: 15px; line-height: 1.2; }
.ago-ai-actions { display: flex; gap: 2px; align-items: center; }
.ago-ai-actions button {
    background: transparent; border: none; color: #fff;
    width: 30px; height: 30px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; padding: 0;
    transition: background .15s;
}
.ago-ai-actions button:hover { background: rgba(255,255,255,0.18); }
.ago-ai-actions button:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }

.ago-ai-messages { flex: 1; padding: 14px; overflow-y: auto; background: #f6f7f8; }
.ago-ai-msg {
    padding: 8px 12px; margin: 6px 0; border-radius: 14px; max-width: 80%;
    line-height: 1.45; word-wrap: break-word; white-space: pre-wrap;
}
.ago-ai-msg-bot  { background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.07); margin-right: auto; }
.ago-ai-msg-user { background: var(--ago-c, #2271b1); color: #fff; margin-left: auto; }

.ago-ai-typing { display: inline-flex; gap: 4px; padding: 12px; max-width: none; }
.ago-ai-typing span { width: 6px; height: 6px; background: #999; border-radius: 50%; animation: ago-dot 1.2s infinite; }
.ago-ai-typing span:nth-child(2) { animation-delay: 0.2s; }
.ago-ai-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes ago-dot { 0%, 60%, 100% { opacity: 0.3; } 30% { opacity: 1; } }

.ago-ai-form { display: flex; gap: 6px; padding: 10px; border-top: 1px solid #eee; background: #fff; }
.ago-ai-input { flex: 1; padding: 8px 12px; border: 1px solid #ddd; border-radius: 18px; font-size: 14px; outline: none; min-width: 0; }
.ago-ai-input:focus { border-color: var(--ago-c, #2271b1); }
.ago-ai-send, .ago-ai-voice {
    background: var(--ago-c, #2271b1); color: #fff; border: none; width: 36px; height: 36px; border-radius: 50%; cursor: pointer;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.ago-ai-voice { background: #555; }
.ago-ai-voice.listening { background: #d63638; animation: ago-pulse-red 1.2s infinite; }
@keyframes ago-pulse-red { 0%, 100% { box-shadow: 0 0 0 0 rgba(214,54,56,0.6); } 50% { box-shadow: 0 0 0 8px rgba(214,54,56,0); } }

.ago-ai-credit { text-align: center; padding: 6px; font-size: 11px; color: #888; }
.ago-ai-credit a { color: inherit; text-decoration: none; }

/* Lead form rendered as inline card, NOT centered modal */
.ago-ai-lead {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-left: 4px solid var(--ago-c, #2271b1);
    border-radius: 10px;
    padding: 16px;
    margin: 10px 0;
    max-width: 100%;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.ago-ai-lead-title {
    font-weight: 600;
    margin-bottom: 12px;
    color: #1d2327;
    font-size: 14px;
}
.ago-ai-lead input[type="text"],
.ago-ai-lead input[type="email"],
.ago-ai-lead input[type="tel"] {
    display: block;
    width: 100%;
    padding: 10px 12px;
    margin: 8px 0;
    border: 1px solid #c3c4c7;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    color: #1d2327;
    box-sizing: border-box;
    line-height: 1.4;
}
.ago-ai-lead input::placeholder { color: #757575; }
.ago-ai-lead input:focus {
    outline: none;
    border-color: var(--ago-c, #2271b1);
    box-shadow: 0 0 0 2px rgba(34,113,177,.18);
}
.ago-ai-lead .ago-ai-hp { position: absolute; left: -9999px; top: -9999px; }
.ago-ai-lead-actions { display: flex; gap: 8px; margin-top: 12px; }
.ago-ai-lead-actions button {
    padding: 9px 16px; border: none; border-radius: 6px;
    cursor: pointer; font-size: 14px; font-weight: 600;
    transition: opacity .15s, background .15s;
}
.ago-ai-lead-send { background: var(--ago-c, #2271b1); color: #fff; }
.ago-ai-lead-send:hover { opacity: .9; }
.ago-ai-lead-send:disabled { opacity: .6; cursor: wait; }
.ago-ai-lead-skip { background: #f0f0f1; color: #50575e; }
.ago-ai-lead-skip:hover { background: #dcdcde; }
.ago-ai-lead-done { color: #00733d; font-weight: 600; font-size: 14px; }

@media (prefers-color-scheme: dark) {
    .ago-ai-panel { background: #1d2327; }
    .ago-ai-messages { background: #14181a; }
    .ago-ai-msg-bot { background: #2c3338; color: #e0e0e0; }
    .ago-ai-form { background: #1d2327; border-top-color: #333; }
    .ago-ai-input { background: #2c3338; color: #e0e0e0; border-color: #444; }
    .ago-ai-lead { background: #2c3338; border-color: #3c434a; color: #e0e0e0; }
    .ago-ai-lead-title { color: #e0e0e0; }
    .ago-ai-lead input { background: #1d2327; color: #e0e0e0; border-color: #50575e; }
    .ago-ai-lead input::placeholder { color: #a7aaad; }
    .ago-ai-lead-skip { background: #3c434a; color: #e0e0e0; }
    .ago-ai-lead-skip:hover { background: #50575e; }
}
