/* shopo-ui.css — چت و دکمه‌های یکپارچه شاپو (همه صفحات) */

:root {
    --shopo-ui-gradient: linear-gradient(135deg, #7C3AED 0%, #6366F1 55%, #4F46E5 100%);
    --shopo-ui-surface: #14141f;
    --shopo-ui-border: rgba(255, 255, 255, 0.1);
    --shopo-ui-glow: 0 8px 32px rgba(124, 58, 237, 0.35);
}

/* ─── دکمه‌های بله / نه / انجام بده (یکسان در همه جا) ─── */
.shopo-btn,
.shopo-gate-yes,
.shopo-gate-no,
.shopo-suggest-yes,
.shopo-suggest-no,
.shopo-coach-tip .coach-tip-ok,
.shopo-coach-tip .coach-tip-skip,
.shopo-page-gate-btns button,
.shopo-suggest-btns button {
    padding: 10px 18px;
    border: none;
    border-radius: 12px;
    font-family: Shabnam, Tahoma, sans-serif;
    font-weight: 800;
    font-size: 0.82rem;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
    line-height: 1.3;
}

.shopo-btn-yes,
.shopo-gate-yes,
.shopo-suggest-yes,
.shopo-coach-tip .coach-tip-ok,
.shopo-page-gate-btns .shopo-gate-yes {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    color: #1a1033;
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.35);
}

.shopo-btn-no,
.shopo-gate-no,
.shopo-suggest-no,
.shopo-coach-tip .coach-tip-skip,
.shopo-page-gate-btns .shopo-gate-no {
    background: rgba(255, 255, 255, 0.1);
    color: #E9E0FF;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.shopo-btn-yes:hover,
.shopo-gate-yes:hover,
.shopo-suggest-yes:hover,
.shopo-coach-tip .coach-tip-ok:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.45);
}

.shopo-btn-no:hover,
.shopo-gate-no:hover,
.shopo-suggest-no:hover,
.shopo-coach-tip .coach-tip-skip:hover {
    background: rgba(255, 255, 255, 0.16);
}

/* ─── مودال gate (بله بریم / فعلاً نه) ─── */
.shopo-page-gate {
    position: fixed;
    inset: 0;
    z-index: 10002;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    font-family: Shabnam, Tahoma, sans-serif;
}

.shopo-page-gate-box {
    max-width: 400px;
    width: 100%;
    padding: 24px;
    border-radius: 20px;
    background: linear-gradient(145deg, #1e1b4b, #312e81);
    border: 2px solid rgba(245, 158, 11, 0.45);
    color: #fff;
    text-align: center;
    animation: shopoUiBubbleIn 0.4s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.shopo-page-gate-box h3 {
    margin: 0 0 10px;
    font-size: 1.05rem;
}

.shopo-page-gate-box p {
    margin: 0 0 16px;
    font-size: 0.85rem;
    color: #E9E0FF;
    line-height: 1.7;
}

.shopo-page-gate-btns {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.shopo-page-gate-box.shopo-guide-box {
    text-align: right;
}

.shopo-page-gate-box.shopo-guide-box .shopo-page-gate-btns {
    justify-content: flex-start;
}

.shopo-page-gate-box.shopo-guide-box .shopo-guide-body p {
    margin: 0 0 16px;
    font-size: 0.85rem;
    color: #E9E0FF;
    line-height: 1.7;
}

@keyframes shopoUiBubbleIn {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ─── پیشنهاد پایان گفتگو ─── */
.shopo-suggest {
    margin-top: 10px;
    padding: 12px 14px;
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.32);
    border-radius: 14px;
    font-size: 0.82rem;
}

.shopo-suggest p {
    margin: 0 0 10px;
    color: #E9E0FF;
    line-height: 1.6;
}

.shopo-suggest-btns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.shopo-suggest.shopo-suggest-accepted {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.35);
}

.shopo-suggest.shopo-suggest-accepted p {
    color: #D1FAE5;
}

.shopo-suggest.shopo-suggest-declined {
    opacity: 0.72;
}

/* ─── حباب شاپو داخل مقاله / پست ─── */
.shopo-content-bubble {
    margin: 36px 0 28px;
    padding: 20px 22px;
    border-radius: 20px;
    background: linear-gradient(145deg, rgba(30, 27, 75, 0.96), rgba(49, 46, 129, 0.92));
    border: 2px solid rgba(139, 92, 246, 0.42);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.32), 0 0 32px rgba(124, 58, 237, 0.12);
    animation: shopoUiBubbleIn 0.5s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.shopo-content-bubble .shopo-guide-head {
    margin-bottom: 14px;
}

.shopo-content-bubble-text {
    margin: 0 0 16px;
    font-size: 0.92rem;
    line-height: 1.75;
    color: #E9E0FF;
}

.shopo-content-bubble-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.shopo-content-bubble--used {
    border-color: rgba(16, 185, 129, 0.35);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
}

/* ─── ویجت چت (صفحات غیر لندینگ) ─── */
.chat-widget-btn {
    position: fixed;
    bottom: 28px;
    left: 28px;
    z-index: 10050;
    width: auto;
    min-width: 64px;
    height: 64px;
    padding: 0 14px 0 6px;
    background: var(--shopo-ui-gradient);
    border: none;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: var(--shopo-ui-glow), 0 8px 24px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.25s ease;
}

.chat-widget-btn:hover {
    transform: scale(1.05);
}

.chat-widget-label {
    font-size: 0.78rem;
    font-weight: 800;
    color: #fff;
    white-space: nowrap;
}

.chat-notif-dot {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 12px;
    height: 12px;
    background: #22C55E;
    border: 2px solid #fff;
    border-radius: 50%;
    display: none;
}

.chat-panel {
    position: fixed;
    bottom: 110px;
    left: 28px;
    width: 360px;
    max-width: calc(100vw - 56px);
    background: var(--shopo-ui-surface, #14141f);
    border: 1px solid var(--shopo-ui-border);
    border-radius: 24px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
    z-index: 10049;
    overflow: hidden;
    display: none;
    flex-direction: column;
    max-height: 520px;
    color: #fff;
}

.chat-panel.open {
    display: flex;
    animation: shopoChatIn 0.35s cubic-bezier(0.34, 1.2, 0.64, 1);
}

@keyframes shopoChatIn {
    from { opacity: 0; transform: translateY(12px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.chat-panel-header {
    background: var(--shopo-ui-gradient);
    color: #fff;
}

.chat-panel-close {
    margin-right: auto;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    line-height: 1;
    padding: 0;
    transition: background 0.15s ease, transform 0.15s ease;
}

.chat-panel-close:hover {
    background: rgba(255, 255, 255, 0.32);
    transform: scale(1.05);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 120px;
}

.chat-msg,
.shopo-msg {
    max-width: 88%;
    padding: 11px 14px;
    border-radius: 14px;
    font-size: 0.84rem;
    line-height: 1.65;
}

.chat-msg.bot,
.shopo-msg.bot {
    align-self: flex-start;
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.22);
    border-radius: 4px 14px 14px 14px;
}

.chat-msg.user,
.shopo-msg.user {
    align-self: flex-end;
    background: linear-gradient(135deg, #7C3AED, #6366F1);
    border-radius: 14px 4px 14px 14px;
}

.chat-input-area {
    display: flex;
    gap: 8px;
    padding: 12px 14px;
    border-top: 1px solid var(--shopo-ui-border);
    background: rgba(0, 0, 0, 0.2);
}

.chat-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 10px 14px;
    color: #fff;
    font-family: inherit;
    font-size: 0.85rem;
}

.chat-input:focus {
    outline: none;
    border-color: rgba(139, 92, 246, 0.5);
}

.chat-send-btn {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #8B5CF6, #6D28D9);
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    flex-shrink: 0;
}

.chat-msg.bot.typing-cursor,
.shopo-msg.bot.typing-cursor {
    border-right: 2px solid rgba(139, 92, 246, 0.85);
    animation: shopoCursorBlink 0.8s step-end infinite;
}

@keyframes shopoCursorBlink {
    50% { border-color: transparent; }
}

.shopo-typing-dots,
.chat-typing-dots {
    display: inline-flex;
    gap: 4px;
    vertical-align: middle;
    margin-right: 6px;
}

.shopo-typing-dots span,
.chat-typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #8B5CF6;
    animation: shopoDotBounce 1.2s ease infinite;
}

.shopo-typing-dots span:nth-child(2),
.chat-typing-dots span:nth-child(2) { animation-delay: 0.15s; }

.shopo-typing-dots span:nth-child(3),
.chat-typing-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes shopoDotBounce {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.45; }
    40% { transform: translateY(-4px); opacity: 1; }
}

@media (max-width: 480px) {
    .chat-widget-btn {
        bottom: 18px;
        left: 18px;
        height: 58px;
    }

    .chat-panel {
        bottom: 88px;
        left: 18px;
        max-width: calc(100vw - 36px);
    }
}
