/* ÙˆÛŒØ¬Øª Ú†Øª Ù¾Ø´ØªÛŒØ¨Ø§Ù†ÛŒ Ø¢Ù¾Ø³Ø¦Ùˆ | v2.0.1 */

@font-face {
    font-family: 'UpseoChatYekan';
    src: url('/theme/upseo/fonts/YekanBakhFaNum-Light.woff2') format('woff2'),
         url('/theme/upseo/fonts/YekanBakhFaNum-Light.woff') format('woff');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'UpseoChatYekan';
    src: url('/theme/upseo/fonts/YekanBakhFaNum-Bold.woff2') format('woff2'),
         url('/theme/upseo/fonts/YekanBakhFaNum-Bold.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

#geminiChatWidget {
    position: fixed !important;
    left: 24px !important;
    right: auto !important;
    bottom: 24px !important;
    top: auto !important;
    z-index: 99999 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    direction: rtl;
    width: auto !important;
    height: auto !important;
    pointer-events: none !important; /* ÙÙ‚Ø· Ø®ÙˆØ¯ Ø¯Ú©Ù…Ù‡ Ùˆ Ù¾Ù†Ø¬Ø±Ù‡ Ù‚Ø§Ø¨Ù„ Ú©Ù„ÛŒÚ© Ø¨Ø§Ø´Ù†Ø¯ ØªØ§ Ø§Ù„Ù…Ø§Ù†â€ŒÙ‡Ø§ÛŒ Ø²ÛŒØ±ÛŒÙ† Ù‚ÙÙ„ Ù†Ø´ÙˆÙ†Ø¯ */
    font-weight: 300;

    --uc-primary: #7c3aed;
    --uc-primary-2: #4f46e5;
    --uc-accent: #14b8a6;
    --uc-success: #22c55e;
    --uc-danger: #f43f5e;
    --uc-grad: linear-gradient(135deg, var(--uc-primary), var(--uc-primary-2));
    --uc-radius: 22px;

    /* ØªÙ… ØªÛŒØ±Ù‡ */
    --uc-bg: #0b1120;
    --uc-surface: #0f172a;
    --uc-surface-2: #1e293b;
    --uc-messages-bg: #070d1c;
    --uc-border: rgba(148, 163, 184, .18);
    --uc-text: #e5e7eb;
    --uc-text-strong: #ffffff;
    --uc-muted: #94a3b8;
    --uc-input-bg: #020617;
    --uc-bubble-agent: #1e293b;
    --uc-bubble-agent-text: #e5e7eb;
    --uc-link: #c4b5fd;
    --uc-chip-bg: rgba(124, 58, 237, .14);
    --uc-chip-border: rgba(167, 139, 250, .35);
    --uc-chip-text: #ddd6fe;
    --uc-shadow: 0 28px 80px rgba(2, 6, 23, .5);
}

#geminiChatWidget[data-theme="light"] {
    --uc-bg: #ffffff;
    --uc-surface: #ffffff;
    --uc-surface-2: #f1f5f9;
    --uc-messages-bg: #f8fafc;
    --uc-border: rgba(15, 23, 42, .09);
    --uc-text: #1e293b;
    --uc-text-strong: #0f172a;
    --uc-muted: #64748b;
    --uc-input-bg: #f1f5f9;
    --uc-bubble-agent: #ffffff;
    --uc-bubble-agent-text: #1e293b;
    --uc-link: #6d28d9;
    --uc-chip-bg: #f5f3ff;
    --uc-chip-border: #ddd6fe;
    --uc-chip-text: #5b21b6;
    --uc-shadow: 0 24px 64px rgba(15, 23, 42, .18);
}

#geminiChatWidget,
#geminiChatWidget * {
    box-sizing: border-box;
    font-family: 'UpseoChatYekan', Tahoma, sans-serif;
    -webkit-font-smoothing: antialiased;
}

#geminiChatWidget strong,
#geminiChatWidget button,
#geminiChatWidget b { font-weight: 700; }

/* ===== Ù¾Ù†Ø¬Ø±Ù‡ Ú†Øª ===== */
.uc-window {
    width: min(390px, calc(100vw - 32px));
    height: min(620px, calc(100vh - 112px));
    margin-bottom: 14px;
    display: none; /* ÙˆÙ‚ØªÛŒ Ø¨Ø³ØªÙ‡ Ø§Ø³Øª Ù‡ÛŒÚ† ÙØ¶Ø§ Ùˆ Ø§Ø±ØªÙØ§Ø¹ÛŒ Ø§Ø´ØºØ§Ù„ Ù†Ù…ÛŒâ€ŒÚ©Ù†Ø¯ */
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--uc-border);
    border-radius: var(--uc-radius);
    background: var(--uc-surface);
    box-shadow: var(--uc-shadow);
    transform-origin: bottom left;
    transform: translateY(12px) scale(.96);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform .22s ease, opacity .22s ease, visibility .22s ease;
}

#geminiChatWidget.is-open .uc-window {
    display: flex !important;
    transform: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto !important;
}

.uc-header {
    padding: 14px 16px;
    color: #fff;
    background: var(--uc-grad);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
}
.uc-brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.uc-logo-wrap { position: relative; flex: 0 0 auto; }
.uc-logo {
    width: 42px; height: 42px;
    border-radius: 14px;
    display: grid; place-items: center;
    background: rgba(255, 255, 255, .18);
    border: 1px solid rgba(255, 255, 255, .24);
}
.uc-logo img { width: 100%; height: 100%; object-fit: cover; border-radius: 13px; }
.uc-logo svg { width: 22px; height: 22px; }
.uc-online-dot {
    position: absolute; right: -2px; bottom: -2px;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: var(--uc-success);
    border: 2px solid #5b3fd8;
}
.uc-title strong { display: block; font-size: 14px; line-height: 1.6; }
.uc-title span { display: block; font-size: 11px; line-height: 1.6; color: rgba(237, 233, 254, .88); }
.uc-icon-btn {
    width: 36px; height: 36px;
    border: 0; border-radius: 12px;
    display: grid; place-items: center;
    color: #fff;
    background: rgba(255, 255, 255, .14);
    cursor: pointer;
    transition: background .2s;
    pointer-events: auto;
}
.uc-icon-btn:hover { background: rgba(255, 255, 255, .24); }
.uc-icon-btn svg { width: 18px; height: 18px; }

/* ===== Ù¾ÛŒØ§Ù…â€ŒÙ‡Ø§ ===== */
.uc-messages {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 16px 14px 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--uc-messages-bg);
    scroll-behavior: smooth;
    pointer-events: auto;
}
.uc-row { display: flex; gap: 8px; align-items: flex-end; width: 100%; }
.uc-row.is-client { justify-content: flex-start; }
.uc-row.is-agent { justify-content: flex-end; }
.uc-stack { max-width: 82%; display: flex; flex-direction: column; gap: 4px; }
.uc-row.is-client .uc-stack { align-items: flex-start; }
.uc-row.is-agent .uc-stack { align-items: flex-end; }
.uc-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; background: var(--uc-surface-2); }

.uc-bubble {
    padding: 9px 13px;
    border-radius: 18px;
    font-size: 13.5px;
    line-height: 1.9;
    white-space: pre-wrap;
    word-break: break-word;
    animation: ucPop .18s ease-out;
}
@keyframes ucPop { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.uc-row.is-client .uc-bubble {
    color: #fff;
    background: var(--uc-grad);
    border-bottom-right-radius: 6px;
}
.uc-row.is-agent .uc-bubble {
    color: var(--uc-bubble-agent-text);
    background: var(--uc-bubble-agent);
    border: 1px solid var(--uc-border);
    border-bottom-left-radius: 6px;
}
.uc-bubble a { color: var(--uc-link); text-decoration: underline; text-underline-offset: 3px; word-break: break-all; }
.uc-row.is-client .uc-bubble a { color: #fff; }
.uc-bubble b { font-weight: 700; }
.uc-row.is-pending .uc-bubble { opacity: .7; }
.uc-row.is-failed .uc-bubble { outline: 1px solid var(--uc-danger); }
.uc-time { font-size: 10px; color: var(--uc-muted); padding: 0 4px; }

.uc-attachment {
    margin-top: 6px; padding: 8px;
    border-radius: 12px;
    background: rgba(148, 163, 184, .1);
    border: 1px solid var(--uc-border);
    font-size: 12px;
    white-space: normal;
}
.uc-attachment img { display: block; max-width: 200px; max-height: 160px; border-radius: 10px; margin-bottom: 6px; }

/* ===== Ù¾Ø§Ø³Ø®â€ŒÙ‡Ø§ÛŒ Ø³Ø±ÛŒØ¹ ===== */
.uc-quick {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 7px;
    padding: 2px 0 4px;
}
.uc-chip {
    border: 1px solid var(--uc-chip-border);
    background: var(--uc-chip-bg);
    color: var(--uc-chip-text);
    border-radius: 999px;
    padding: 7px 13px;
    font-size: 12.5px;
    cursor: pointer;
    transition: transform .1s, background .2s, border-color .2s;
    pointer-events: auto;
}
.uc-chip:hover { border-color: var(--uc-primary); }
.uc-chip:active { transform: scale(.96); }

/* ===== Ø¯Ø± Ø­Ø§Ù„ ØªØ§ÛŒÙ¾ ===== */
.uc-typing { display: none; justify-content: flex-end; padding: 0 14px 8px; background: var(--uc-messages-bg); }
.uc-typing.is-visible { display: flex; }
.uc-typing-dots {
    display: inline-flex; gap: 4px;
    padding: 10px 14px;
    border-radius: 16px;
    background: var(--uc-bubble-agent);
    border: 1px solid var(--uc-border);
}
.uc-typing-dots i {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--uc-muted);
    animation: ucDot 1.2s infinite ease-in-out;
}
.uc-typing-dots i:nth-child(2) { animation-delay: .15s; }
.uc-typing-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes ucDot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

/* ===== ÙØ±Ù… Ø§Ø±Ø³Ø§Ù„ ===== */
.uc-composer {
    padding: 10px 12px 12px;
    background: var(--uc-surface);
    border-top: 1px solid var(--uc-border);
    flex-shrink: 0;
    pointer-events: auto;
}
.uc-form { display: flex; align-items: flex-end; gap: 8px; }
.uc-input {
    flex: 1;
    min-height: 44px;
    max-height: 120px;
    resize: none;
    border: 1px solid var(--uc-border);
    border-radius: 14px;
    padding: 11px 13px;
    color: var(--uc-text);
    background: var(--uc-input-bg);
    font-size: 14px;
    line-height: 1.6;
    outline: none;
    transition: border-color .2s;
    pointer-events: auto;
}
.uc-input::placeholder { color: var(--uc-muted); }
.uc-input:focus { border-color: var(--uc-primary); }
.uc-send {
    width: 44px; height: 44px;
    flex: 0 0 auto;
    border: 0; border-radius: 14px;
    display: grid; place-items: center;
    color: #fff;
    background: var(--uc-grad);
    cursor: pointer;
    transition: opacity .2s, transform .1s;
    pointer-events: auto;
}
.uc-send svg { width: 18px; height: 18px; transform: scaleX(-1); }
.uc-send:active { transform: scale(.95); }
.uc-send:disabled { opacity: .5; cursor: not-allowed; }
.uc-error { min-height: 0; color: var(--uc-danger); font-size: 11px; text-align: center; }
.uc-error:not(:empty) { margin-top: 6px; }

/* ===== ÙØ±Ù… Ù„ÛŒØ¯ Ø¯Ø±ÙˆÙ† Ú†Øª ===== */
.uc-card {
    width: 100%;
    max-width: 270px;
    margin-top: 6px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-radius: 16px;
    background: var(--uc-bubble-agent);
    border: 1px solid var(--uc-border);
    color: var(--uc-text);
    pointer-events: auto;
}
.uc-card-title { font-size: 12.5px; font-weight: 700; line-height: 1.7; color: var(--uc-text-strong); }
.uc-card input {
    width: 100%; height: 40px;
    border: 1px solid var(--uc-border);
    border-radius: 11px;
    padding: 0 11px;
    color: var(--uc-text);
    background: var(--uc-input-bg);
    font-size: 13px;
    outline: none;
    pointer-events: auto;
}
.uc-card input:focus { border-color: var(--uc-primary); }
.uc-card-btn {
    height: 38px;
    border: 0; border-radius: 11px;
    color: #fff;
    font-size: 13px;
    background: var(--uc-grad);
    cursor: pointer;
    pointer-events: auto;
}
.uc-card-btn:disabled { opacity: .55; cursor: not-allowed; }
.uc-card-error { min-height: 14px; font-size: 11px; color: var(--uc-danger); }
.uc-card-success { font-size: 12.5px; line-height: 1.8; color: var(--uc-success); }
.uc-stars { display: flex; justify-content: center; gap: 4px; direction: ltr; font-size: 26px; }
.uc-star { cursor: pointer; color: #fbbf24; line-height: 1; transition: transform .1s; background: none; border: 0; padding: 0; font-size: inherit; pointer-events: auto; }
.uc-star:active { transform: scale(1.2); }

/* ===== Ø¯Ú©Ù…Ù‡ Ø´Ù†Ø§ÙˆØ± Ú†Øª ===== */
.uc-launcher-wrap {
    position: relative;
    pointer-events: auto !important; /* ÙÙ‚Ø· Ø®ÙˆØ¯ Ø¯Ú©Ù…Ù‡ Ú©Ù„ÛŒÚ©â€ŒÙ¾Ø°ÛŒØ± Ø¨Ø§Ø´Ø¯ */
}
.uc-launcher {
    width: 60px; height: 60px;
    border: 0; border-radius: 50%;
    display: grid; place-items: center;
    color: #fff;
    background: linear-gradient(135deg, var(--uc-primary), var(--uc-primary-2) 55%, var(--uc-accent));
    box-shadow: 0 10px 28px rgba(91, 33, 182, .38);
    cursor: pointer;
    position: relative;
    transition: transform .25s cubic-bezier(.34, 1.56, .64, 1), box-shadow .25s;
    pointer-events: auto !important;
}
.uc-launcher:hover { transform: scale(1.06) translateY(-1px); box-shadow: 0 16px 36px rgba(91, 33, 182, .48); }
.uc-launcher:active { transform: scale(.96); }
.uc-launcher svg { width: 26px; height: 26px; transition: transform .25s, opacity .2s; }
.uc-launcher .uc-ic-close { position: absolute; opacity: 0; transform: rotate(-90deg); }
#geminiChatWidget.is-open .uc-launcher .uc-ic-chat { opacity: 0; transform: rotate(90deg); }
#geminiChatWidget.is-open .uc-launcher .uc-ic-close { opacity: 1; transform: none; }
.uc-launcher-dot {
    position: absolute; right: 3px; bottom: 3px;
    width: 13px; height: 13px; border-radius: 50%;
    background: var(--uc-success);
    border: 2px solid #fff;
}
.uc-badge {
    position: absolute; top: -6px; right: -6px;
    min-width: 22px; height: 22px; padding: 0 6px;
    border-radius: 11px;
    background: var(--uc-danger);
    color: #fff;
    font-size: 12px; font-weight: 700;
    display: none; align-items: center; justify-content: center;
    box-shadow: 0 2px 8px rgba(244, 63, 94, .4);
}
.uc-badge.is-visible { display: flex; }

.uc-teaser {
    position: absolute;
    bottom: 72px;
    left: 0;
    width: max-content;
    max-width: min(270px, calc(100vw - 40px));
    padding: 12px 14px 12px 34px;
    border-radius: 16px 16px 16px 6px;
    background: var(--uc-surface);
    color: var(--uc-text);
    border: 1px solid var(--uc-border);
    box-shadow: var(--uc-shadow);
    font-size: 13px;
    line-height: 1.8;
    cursor: pointer;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity .25s, transform .25s;
}
.uc-teaser.is-visible { opacity: 1; transform: none; pointer-events: auto !important; }
.uc-teaser-close {
    position: absolute; top: 8px; left: 8px;
    width: 20px; height: 20px;
    border: 0; border-radius: 50%;
    background: var(--uc-surface-2);
    color: var(--uc-muted);
    font-size: 13px; line-height: 20px;
    cursor: pointer;
    pointer-events: auto;
}
#geminiChatWidget.is-open .uc-teaser { display: none; }

/* ===== Ù…ÙˆØ¨Ø§ÛŒÙ„ ===== */
@media (max-width: 520px) {
    #geminiChatWidget {
        left: 14px !important;
        right: auto !important;
        bottom: calc(14px + env(safe-area-inset-bottom, 0px)) !important;
    }
    .uc-window {
        position: fixed;
        inset: 0;
        width: 100%;
        height: 100vh;
        height: 100dvh;
        margin: 0;
        border: 0;
        border-radius: 0;
        transform-origin: bottom center;
    }
    .uc-header { padding-top: calc(14px + env(safe-area-inset-top, 0px)); }
    .uc-composer { padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
    .uc-input, .uc-card input { font-size: 16px; }
    .uc-launcher { width: 54px; height: 54px; }
    .uc-teaser { bottom: 66px; }
    #geminiChatWidget.is-open .uc-launcher-wrap { display: none; }
    .uc-stack { max-width: 86%; }
}
html.uc-scroll-lock, html.uc-scroll-lock body { overflow: hidden !important; }

@media (prefers-reduced-motion: reduce) {
    #geminiChatWidget * { animation: none !important; transition: none !important; }
}