/* --- AI GANOS CHAT: FINAL PERFECTED (v7) --- */

/* 1. Global Variables */
:root {
    --agc-color: #4a90e2;
    --agc-white: #ffffff;
    --agc-dark: #1f2937;
    --agc-gray: #f3f4f6;
    --agc-font: 'Inter', system-ui, -apple-system, sans-serif;
    --agc-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.2);
    --agc-z: 2147483647;
}

/* 2. Main Widget Container */
.ai-ganos-chat-widget {
    position: fixed !important;
    bottom: 25px !important;
    right: 25px !important;
    top: auto !important;
    left: auto !important;
    z-index: 2147483647 !important;

    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;

    font-family: var(--agc-font) !important;
    line-height: 1.5 !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: none;
    width: auto !important;
    height: auto !important;
}

.ai-ganos-chat-widget>* {
    pointer-events: auto;
}

.ai-ganos-chat-widget * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: inherit;
}

/* Left Alignment Override */
.ai-ganos-chat-widget.agc-left {
    left: 25px !important;
    right: auto !important;
    align-items: flex-start !important;
}

/* 3. Floating Toggle Button */
.ai-ganos-chat-toggle {
    width: 60px !important;
    height: 60px !important;
    border-radius: 50% !important;
    background: var(--agc-color, #4a90e2) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25) !important;
    cursor: pointer;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: white !important;
    transition: transform 0.2s cubic-bezier(0.3, 1.5, 0.7, 1) !important;
    position: relative;
    z-index: 20;
    margin-top: 10px;
}

.ai-ganos-chat-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3) !important;
}

.ai-ganos-chat-toggle svg {
    width: 30px !important;
    height: 30px !important;
    display: block !important;
    fill: white !important;
    stroke: none !important;
}

.ai-ganos-chat-widget.agc-pulse .ai-ganos-chat-toggle {
    animation: agcPulse 2s infinite;
}

@keyframes agcPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.2);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(0, 0, 0, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
    }
}

/* 4. Chat Window (Absolute) */
.ai-ganos-chat-window {
    position: absolute !important;
    bottom: 80px !important;
    right: 0 !important;
    width: 380px !important;
    height: 600px !important;
    max-width: 90vw !important;
    max-height: 80vh !important;
    background: #ffffff !important;
    border-radius: var(--agc-radius, 24px) !important;
    box-shadow: var(--agc-shadow) !important;
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.08);
    transform-origin: bottom right;
    animation: agcSlide 0.35s cubic-bezier(0.2, 1, 0.3, 1) forwards;
}

.agc-left .ai-ganos-chat-window {
    right: auto !important;
    left: 0 !important;
    transform-origin: bottom left;
}

@keyframes agcSlide {
    from {
        opacity: 0;
        transform: translateY(15px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Header */
.agc-header {
    height: 70px;
    background: linear-gradient(135deg, var(--agc-color, #4a90e2), #2c3e50);
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    flex-shrink: 0;
}

.agc-header-title {
    font-weight: 700;
    font-size: 17px;
}

.agc-header-actions {
    display: flex;
    gap: 8px;
}

.agc-icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: 0.2s;
    padding: 0;
}

.agc-icon-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.agc-icon-btn svg {
    width: 18px !important;
    height: 18px !important;
    stroke: white !important;
    fill: none !important;
    display: block !important;
    stroke-width: 2.5;
}

/* Body */
.agc-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    background: #f8fafc;
}

/* Messages */
.agc-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.agc-messages::-webkit-scrollbar {
    width: 5px;
}

.agc-msg-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    margin-bottom: 5px;
}

.agc-msg-row.user {
    justify-content: flex-end;
}

.agc-msg-row.bot {
    justify-content: flex-start;
}


.agc-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #e2e8f0;
    background-size: cover;
    flex-shrink: 0;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.agc-msg {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14.5px;
    line-height: 1.5;
    max-width: 80%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    word-wrap: break-word;
}

.agc-msg.bot {
    background: white;
    color: var(--agc-dark);
    border-bottom-left-radius: 4px;
}

.agc-msg.user {
    background: var(--agc-color, #4a90e2);
    color: white;
    border-bottom-right-radius: 4px;
}

/* Typing Animation */
.agc-typing-dots {
    display: flex;
    gap: 4px;
    align-items: center;
    justify-content: center;
    height: 24px;
    padding: 0 5px;
    min-width: 40px;
}

.agc-typing-dots span {
    width: 6px;
    height: 6px;
    background: #9ca3af;
    border-radius: 50%;
    animation: agcBounce 1.4s infinite ease-in-out both;
}

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

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

@keyframes agcBounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

/* Footer & Chips (Button Style) */
.agc-footer {
    background: white;
    border-top: 1px solid #eef0f2;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.agc-suggestions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 150px;
    overflow-y: auto;
    padding: 5px;
}

.agc-suggestions::-webkit-scrollbar {
    width: 4px;
}

.agc-chip {
    padding: 10px 16px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 20px !important;
    color: #4b5563;
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.agc-chip:hover {
    background: var(--agc-color);
    color: white;
    border-color: var(--agc-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.agc-chip::after {
    content: '+';
    font-weight: bold;
    font-size: 16px;
    opacity: 0.7;
}

/* Input */
.agc-input-group {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

#agc-input {
    width: 100%;
    height: 52px;
    padding: 0 55px 0 20px;
    border: 2px solid #e2e8f0;
    border-radius: 26px;
    font-size: 15px;
    background: #f8fafc;
    outline: none;
    transition: 0.2s;
    color: #0f172a;
}

#agc-input:focus {
    background: white;
    border-color: var(--agc-color);
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.03);
}

.agc-send-btn {
    position: absolute;
    right: 6px;
    top: 6px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--agc-color, #4a90e2);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: 0.2s;
    z-index: 10;
    padding: 0;
}

.agc-send-btn:hover {
    transform: scale(1.05);
}

.agc-send-btn svg {
    width: 20px !important;
    height: 20px !important;
    stroke: white !important;
    fill: none !important;
    display: block !important;
    margin-left: -2px;
    stroke-width: 2;
}


/* 5. Speed Dial - SIDEWAYS (With Gap Bridge Fix) */
.agc-toggle-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Container for buttons */
.agc-contact-actions {
    position: absolute;
    bottom: 5px;
    right: 70px;
    /* Gap from toggle */

    flex-direction: row-reverse;
    display: flex;
    gap: 12px;
    align-items: center;

    /* FIX: Delay hiding to bridge gap */
    visibility: hidden;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.3s, transform 0.3s, visibility 0s 0.2s;
    /* 0.2s delay before hiding */
    pointer-events: none;
}

/* BRIDGE: Pseudo-element to fill the gap so hover isn't lost */
.agc-contact-actions::before {
    content: '';
    position: absolute;
    top: -20px;
    bottom: -20px;
    right: -20px;
    width: 40px;
    /* Fills space between icons and toggle */
    background: transparent;
    z-index: 1;
}

/* Left Widget Logic */
.agc-left .agc-contact-actions {
    right: auto;
    left: 70px;
    flex-direction: row;
    transform: translateX(-20px);
}

.agc-left .agc-contact-actions::before {
    right: auto;
    left: -20px;
}

/* Hover State - Reset delay */
.agc-toggle-wrapper:hover .agc-contact-actions,
.ai-ganos-chat-widget:hover .agc-contact-actions,
.agc-contact-actions:hover

/* If user manages to reach it */
    {
    visibility: visible;
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
    transition-delay: 0s;
    /* Instant show */
}


/* Contact Buttons */
.agc-contact-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #4b5563;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    text-decoration: none !important;
    transition: 0.2s;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
    /* Above bridge */
}

.agc-contact-btn:hover {
    transform: scale(1.15);
}

.agc-contact-btn svg {
    width: 24px !important;
    height: 24px !important;
    fill: white !important;
    display: block !important;
}

.agc-contact-btn.whatsapp {
    background: #25D366 !important;
}

.agc-contact-btn.phone {
    background: #3b82f6 !important;
}

.agc-contact-btn.email {
    background: #f59e0b !important;
}

.agc-contact-btn.instagram {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%) !important;
}

.agc-contact-btn.youtube {
    background: #FF0000 !important;
}

.agc-contact-btn.linkedin {
    background: #0A66C2 !important;
}

.agc-contact-btn.twitter {
    background: #000000 !important;
}

.agc-contact-btn.tiktok {
    background: #010101 !important;
}

.agc-contact-btn.facebook {
    background: #1877F2 !important;
}

.agc-contact-btn.telegram {
    background: #26A5E4 !important;
}

/* ─── AUTOLINKS IN BOT MESSAGES ─── */
.agc-msg.bot .agc-autolink,
.agc-msg.bot a {
    color: var(--agc-color) !important;
    text-decoration: underline !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    word-break: break-word;
}
.agc-msg.bot .agc-phone-link { color: #16a34a !important; }
.agc-msg.bot .agc-email-link { color: #d97706 !important; }
.agc-msg.bot .agc-autolink:hover { opacity: 0.8; }
.agc-msg.bot .agc-code {
    background: #f1f5f9;
    padding: 1px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
    color: #e11d48;
}

/* ─── TIMESTAMP ─── */
.agc-timestamp {
    font-size: 10px;
    color: #94a3b8;
    margin-top: 4px;
    display: block;
}

/* ─── MSG WRAPPER ─── */
.agc-msg-wrapper {
    display: flex;
    flex-direction: column;
}
.agc-msg-row.bot .agc-msg-wrapper { align-items: flex-start; }
.agc-msg-row.user .agc-msg-wrapper { align-items: flex-end; }

/* ─── MESSAGE ACTIONS ─── */
.agc-msg-actions {
    display: flex;
    gap: 4px;
    margin-top: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}
.agc-msg-row:hover .agc-msg-actions { opacity: 1; }
.agc-action-btn {
    background: none;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 3px 7px;
    font-size: 11px;
    cursor: pointer;
    color: #64748b;
    transition: 0.15s;
}
.agc-action-btn:hover { background: #f1f5f9; color: #1e293b; }

/* ─── REACTION BAR ─── */
.agc-reaction-bar {
    display: flex;
    gap: 4px;
    margin-top: 4px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 4px 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    width: fit-content;
}
.agc-emoji { cursor: pointer; font-size: 16px; transition: transform 0.15s; padding: 2px; }
.agc-emoji:hover { transform: scale(1.3); }
.agc-placed-reaction {
    font-size: 14px;
    margin-left: 4px;
    display: inline-block;
}

/* ─── STATUS DOT ─── */
.agc-status-dot {
    width: 8px; height: 8px;
    background: #22c55e;
    border-radius: 50%;
    display: inline-block;
    margin-left: 8px;
    animation: agc-pulse-dot 2s infinite;
}
@keyframes agc-pulse-dot {
    0%, 100% { opacity: 1; } 50% { opacity: 0.4; }
}
.agc-status-text { font-size: 11px; color: rgba(255,255,255,0.8); margin-left: 4px; }

/* ─── HEADER LAYOUT ─── */
.agc-header { display: flex; justify-content: space-between; align-items: center; }
.agc-header-left { display: flex; align-items: center; }
.agc-header-actions { display: flex; align-items: center; gap: 4px; }
.agc-icon-btn {
    background: rgba(255,255,255,0.15);
    border: none;
    border-radius: 8px;
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    color: white;
    transition: background 0.15s;
}
.agc-icon-btn:hover { background: rgba(255,255,255,0.25); }
.agc-icon-btn svg { width: 15px; height: 15px; }

/* ─── SEARCH BAR ─── */
.agc-search-bar {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 8px 12px;
    display: flex;
    gap: 8px;
    align-items: center;
}
.agc-search-input {
    flex: 1;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 13px;
    outline: none;
}
.agc-search-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    font-size: 14px;
    padding: 4px;
}

/* ─── CHAR COUNT ─── */
.agc-char-count {
    font-size: 10px;
    color: #94a3b8;
    text-align: right;
    padding: 2px 4px 0;
    display: block;
}
.agc-char-count.agc-char-warn { color: #f59e0b; font-weight: 600; }

/* ─── UNREAD BADGE ─── */
.agc-msg-count-badge {
    position: absolute;
    top: -5px; right: -5px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: 700;
    width: 18px; height: 18px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.ai-ganos-chat-toggle { position: relative; }

/* ─── DARK MODE ─── */
#agc-window.agc-dark { background: #1e293b !important; }
#agc-window.agc-dark .agc-messages { background: #1e293b !important; }
#agc-window.agc-dark .agc-msg.bot { background: #334155 !important; color: #e2e8f0 !important; }
#agc-window.agc-dark .agc-msg.user { color: white !important; }
#agc-window.agc-dark .agc-footer { background: #1e293b !important; border-color: #334155 !important; }
#agc-window.agc-dark #agc-input { background: #334155 !important; color: #e2e8f0 !important; border-color: #475569 !important; }


/* 6. Lead Screen - MOBILE IMPROVEMENTS */
.agc-lead-screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    z-index: 50;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 30px;
    text-align: center;
}

.agc-lead-screen h3 {
    margin-bottom: 25px;
    font-size: 20px;
    color: #111827;
    font-weight: 700;
}

.agc-lead-screen input {
    margin-bottom: 15px;
    padding: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    width: 100%;
    outline: none;
    font-size: 15px;
    transition: 0.2s;
}

.agc-lead-screen input:focus {
    border-color: var(--agc-color);
    background: #f8fafc;
}

#agc-start-chat {
    background: var(--agc-color);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    margin-top: 15px;
    width: 100%;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
    transition: 0.2s;
}

#agc-start-chat:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(74, 144, 226, 0.4);
}

/* Mobile Fullscreen Logic */
@media (max-width: 480px) {
    .ai-ganos-chat-widget.agc-mobile-fs .ai-ganos-chat-window {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100% !important;
        max-width: none !important;
        max-height: none !important;
        border-radius: 0 !important;
        margin: 0 !important;
        z-index: 2147483647;
    }

    .agc-lead-screen {
        padding: 40px 25px;
    }

    .agc-lead-screen h3 {
        font-size: 22px;
    }

    display: flex;
    align-items: center;
    justify-content: center;
}

/* Container for buttons */
.agc-contact-actions {
    position: absolute;
    bottom: 5px;
    right: 70px;
    /* Gap from toggle */

    flex-direction: row-reverse;
    display: flex;
    gap: 12px;
    align-items: center;

    .agc-lead-screen input {
        padding: 18px;
        font-size: 16px;
    }
}

/* Container for buttons */
.agc-contact-actions {
    position: absolute;
    bottom: 5px;
    right: 70px;
    flex-direction: row-reverse;
    display: flex;
    gap: 12px;
    align-items: center;

    visibility: hidden;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.3s, transform 0.3s, visibility 0s 0.2s;
    pointer-events: none;
}

/* BRIDGE: Pseudo-element to fill the gap so hover isn't lost */
.agc-contact-actions::before {
    content: '';
    position: absolute;
    top: -20px;
    bottom: -20px;
    right: -20px;
    width: 40px;
    background: transparent;
    z-index: 1;
}

/* Left Widget Logic */
.agc-left .agc-contact-actions {
    right: auto;
    left: 70px;
    flex-direction: row;
    transform: translateX(-20px);
}

.agc-left .agc-contact-actions::before {
    right: auto;
    left: -20px;
}

/* 
   Hover State & Open State 
   - Show on Hover (Desktop)
   - Show when Open (Mobile/Desktop Click)
*/
.agc-toggle-wrapper:hover .agc-contact-actions,
.ai-ganos-chat-widget:hover .agc-contact-actions,
.agc-contact-actions:hover,
.ai-ganos-chat-widget.agc-open .agc-contact-actions {
    visibility: visible;
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
    transition-delay: 0s;
}


/* Contact Buttons */
.agc-contact-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #4b5563;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    text-decoration: none !important;
    transition: 0.2s;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
    /* Above bridge */
}

.agc-contact-btn:hover {
    transform: scale(1.15);
}

.agc-contact-btn svg {
    width: 24px !important;
    height: 24px !important;
    fill: white !important;
    display: block !important;
}

.agc-contact-btn.whatsapp {
    background: #25D366 !important;
}

.agc-contact-btn.phone {
    background: #3b82f6 !important;
}

.agc-contact-btn.email {
    background: #f59e0b !important;
}

.agc-contact-btn.instagram {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%) !important;
}

.agc-contact-btn.youtube {
    background: #FF0000 !important;
}

.agc-contact-btn.linkedin {
    background: #0A66C2 !important;
}

.agc-contact-btn.twitter {
    background: #000000 !important;
}

.agc-contact-btn.tiktok {
    background: #010101 !important;
}

.agc-contact-btn.facebook {
    background: #1877F2 !important;
}

.agc-contact-btn.telegram {
    background: #26A5E4 !important;
}

/* ─── AUTOLINKS IN BOT MESSAGES ─── */
.agc-msg.bot .agc-autolink,
.agc-msg.bot a {
    color: var(--agc-color) !important;
    text-decoration: underline !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    word-break: break-word;
}
.agc-msg.bot .agc-phone-link { color: #16a34a !important; }
.agc-msg.bot .agc-email-link { color: #d97706 !important; }
.agc-msg.bot .agc-autolink:hover { opacity: 0.8; }
.agc-msg.bot .agc-code {
    background: #f1f5f9;
    padding: 1px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
    color: #e11d48;
}

/* ─── TIMESTAMP ─── */
.agc-timestamp {
    font-size: 10px;
    color: #94a3b8;
    margin-top: 4px;
    display: block;
}

/* ─── MSG WRAPPER ─── */
.agc-msg-wrapper {
    display: flex;
    flex-direction: column;
}
.agc-msg-row.bot .agc-msg-wrapper { align-items: flex-start; }
.agc-msg-row.user .agc-msg-wrapper { align-items: flex-end; }

/* ─── MESSAGE ACTIONS ─── */
.agc-msg-actions {
    display: flex;
    gap: 4px;
    margin-top: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}
.agc-msg-row:hover .agc-msg-actions { opacity: 1; }
.agc-action-btn {
    background: none;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 3px 7px;
    font-size: 11px;
    cursor: pointer;
    color: #64748b;
    transition: 0.15s;
}
.agc-action-btn:hover { background: #f1f5f9; color: #1e293b; }

/* ─── REACTION BAR ─── */
.agc-reaction-bar {
    display: flex;
    gap: 4px;
    margin-top: 4px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 4px 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    width: fit-content;
}
.agc-emoji { cursor: pointer; font-size: 16px; transition: transform 0.15s; padding: 2px; }
.agc-emoji:hover { transform: scale(1.3); }
.agc-placed-reaction {
    font-size: 14px;
    margin-left: 4px;
    display: inline-block;
}

/* ─── STATUS DOT ─── */
.agc-status-dot {
    width: 8px; height: 8px;
    background: #22c55e;
    border-radius: 50%;
    display: inline-block;
    margin-left: 8px;
    animation: agc-pulse-dot 2s infinite;
}
@keyframes agc-pulse-dot {
    0%, 100% { opacity: 1; } 50% { opacity: 0.4; }
}
.agc-status-text { font-size: 11px; color: rgba(255,255,255,0.8); margin-left: 4px; }

/* ─── HEADER LAYOUT ─── */
.agc-header { display: flex; justify-content: space-between; align-items: center; }
.agc-header-left { display: flex; align-items: center; }
.agc-header-actions { display: flex; align-items: center; gap: 4px; }
.agc-icon-btn {
    background: rgba(255,255,255,0.15);
    border: none;
    border-radius: 8px;
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    color: white;
    transition: background 0.15s;
}
.agc-icon-btn:hover { background: rgba(255,255,255,0.25); }
.agc-icon-btn svg { width: 15px; height: 15px; }

/* ─── SEARCH BAR ─── */
.agc-search-bar {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 8px 12px;
    display: flex;
    gap: 8px;
    align-items: center;
}
.agc-search-input {
    flex: 1;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 13px;
    outline: none;
}
.agc-search-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    font-size: 14px;
    padding: 4px;
}

/* ─── CHAR COUNT ─── */
.agc-char-count {
    font-size: 10px;
    color: #94a3b8;
    text-align: right;
    padding: 2px 4px 0;
    display: block;
}
.agc-char-count.agc-char-warn { color: #f59e0b; font-weight: 600; }

/* ─── UNREAD BADGE ─── */
.agc-msg-count-badge {
    position: absolute;
    top: -5px; right: -5px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: 700;
    width: 18px; height: 18px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.ai-ganos-chat-toggle { position: relative; }

/* ─── DARK MODE ─── */
#agc-window.agc-dark { background: #1e293b !important; }
#agc-window.agc-dark .agc-messages { background: #1e293b !important; }
#agc-window.agc-dark .agc-msg.bot { background: #334155 !important; color: #e2e8f0 !important; }
#agc-window.agc-dark .agc-msg.user { color: white !important; }
#agc-window.agc-dark .agc-footer { background: #1e293b !important; border-color: #334155 !important; }
#agc-window.agc-dark #agc-input { background: #334155 !important; color: #e2e8f0 !important; border-color: #475569 !important; }


/* 6. Lead Screen - MOBILE IMPROVEMENTS */
.agc-lead-screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    z-index: 50;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 30px;
    text-align: center;
}

.agc-lead-screen h3 {
    margin-bottom: 25px;
    font-size: 20px;
    color: #111827;
    font-weight: 700;
}

.agc-lead-screen input {
    margin-bottom: 15px;
    padding: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    width: 100%;
    outline: none;
    font-size: 15px;
    transition: 0.2s;
}

.agc-lead-screen input:focus {
    border-color: var(--agc-color);
    background: #f8fafc;
}

#agc-start-chat {
    background: var(--agc-color);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    margin-top: 15px;
    width: 100%;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
    transition: 0.2s;
}

#agc-start-chat:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(74, 144, 226, 0.4);
}

/* Mobile Fullscreen Logic */
@media (max-width: 480px) {
    .ai-ganos-chat-widget.agc-mobile-fs .ai-ganos-chat-window {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100% !important;
        max-width: none !important;
        max-height: none !important;
        border-radius: 0 !important;
        margin: 0 !important;
        z-index: 2147483647;
    }

    .agc-lead-screen {
        padding: 40px 25px;
    }

    .agc-lead-screen h3 {
        font-size: 22px;
    }

    .agc-lead-screen input {
        padding: 18px;
        font-size: 16px;
    }

    #agc-start-chat {
        padding: 18px;
        font-size: 18px;
    }
}

/* Toggle Button Text Label (Added Phase 24) */
.agc-toggle-text {
    position: absolute;
    right: 80px;
    /* Position to the left of button */
    top: 50%;
    transform: translateY(-50%);
    background: #ffffff;
    color: #374151;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    opacity: 1;
    visibility: visible;
    transition: all 0.3s ease;
    z-index: 15;
    pointer-events: none;
}

.agc-toggle-text::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 6px 0 6px 6px;
    border-style: solid;
    border-color: transparent transparent transparent #ffffff;
}

/* Hide when hovering wrapper OR when chat is open */
.agc-toggle-wrapper:hover .agc-toggle-text,
.ai-ganos-chat-widget.agc-open .agc-toggle-text {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-50%) translateX(-10px);
}

/* Left Alignment Handling */
.agc-left .agc-toggle-text {
    right: auto;
    left: 80px;
}

.agc-left .agc-toggle-text::after {
    right: auto;
    left: -6px;
    border-width: 6px 6px 6px 0;
    border-color: transparent #ffffff transparent transparent;
}

.agc-left .agc-toggle-wrapper:hover .agc-toggle-text {
    transform: translateY(-50%) translateX(10px);
}
/* Spinner */
.agc-spinner { animation: spin 1s linear infinite; display: inline-block; margin-left: 5px; }
@keyframes spin { 100% { transform: rotate(360deg); } }
