/* =========================================================================
   Novin OS — AI Advisor, Smart Blocks & Persian RTL
   ========================================================================= */

:root {
    --ns-ai-bg:      #ffffff;
    --ns-ai-user:    #ede9fe;
    --ns-ai-user-tx: #5b21b6;
    --ns-ai-accent:  #1a56db;
}

/* -------------------------------------------------------------------------
   AI Advisor widget
   ------------------------------------------------------------------------- */
.ns-ai {
    max-width: 560px;
    margin: 0 auto;
    border: 1px solid var(--ns-border, #e2e8f0);
    border-radius: 16px;
    overflow: hidden;
    background: var(--ns-ai-bg);
    font-family: Vazirmatn, Tahoma, var(--ns-font, sans-serif);
}
.ns-ai__head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 18px;
    border-bottom: 1px solid #f1f5f9;
    background: #fafbfc;
}
.ns-ai__dot {
    width: 9px; height: 9px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34,197,94,.18);
}
.ns-ai__title {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    color: #1e293b;
}
.ns-ai__thread {
    padding: 16px 18px;
    max-height: 420px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ns-ai__msg {
    font-size: 14px;
    line-height: 1.85;
    padding: 10px 14px;
    border-radius: 14px;
    max-width: 88%;
}
.ns-ai__msg--bot {
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    color: #1e293b;
    border-bottom-right-radius: 4px;
    align-self: flex-start;
}
.ns-ai__msg--user {
    background: var(--ns-ai-user);
    color: var(--ns-ai-user-tx);
    border-bottom-left-radius: 4px;
    align-self: flex-end;
}
.ns-ai__reason { margin: 0 0 8px; }
.ns-ai__countries {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 8px 0;
}
.ns-ai__country {
    display: flex;
    flex-direction: column;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}
.ns-ai__country strong { font-size: 14px; color: #1e293b; }
.ns-ai__country span { font-size: 13px; color: #64748b; }

.ns-ai__product {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding: 12px 16px;
    background: linear-gradient(0deg, #ecfdf5, #ecfdf5);
    border: 1px solid #a7f3d0;
    border-radius: 12px;
    text-decoration: none;
    transition: background .15s;
}
.ns-ai__product:hover { background: #d1fae5; }
.ns-ai__product-label { font-size: 14px; font-weight: 600; color: #065f46; }
.ns-ai__product-cta { font-size: 13px; font-weight: 600; color: #059669; white-space: nowrap; }

.ns-ai__typing { color: #94a3b8; font-size: 13px; }

.ns-ai__quick {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 18px 12px;
}
.ns-ai__chip {
    font-size: 12px;
    padding: 6px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #fff;
    color: #475569;
    cursor: pointer;
    font-family: inherit;
    transition: all .15s;
}
.ns-ai__chip:hover { background: #f1f5f9; border-color: #cbd5e1; }

.ns-ai__form {
    display: flex;
    gap: 8px;
    padding: 12px 18px 16px;
    border-top: 1px solid #f1f5f9;
}
.ns-ai__input {
    flex: 1;
    padding: 11px 14px;
    font-size: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-family: inherit;
    text-align: right;
}
.ns-ai__input:focus {
    outline: none;
    border-color: var(--ns-ai-accent);
    box-shadow: 0 0 0 3px rgba(26,86,219,.12);
}
.ns-ai__send {
    padding: 11px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: var(--ns-ai-accent);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
}
.ns-ai__send:hover { background: #1648b8; }

/* -------------------------------------------------------------------------
   Smart blocks (auto-injected)
   ------------------------------------------------------------------------- */
.ns-smart-block {
    margin: 28px 0;
    padding: 18px 20px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
}
.ns-smart-block__title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 12px;
    color: #1e293b;
}
.ns-smart-block__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
}
.ns-smart-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    text-decoration: none;
    transition: border-color .15s, transform .15s;
}
.ns-smart-item:hover { border-color: var(--ns-ai-accent); transform: translateY(-1px); }
.ns-smart-item__title { font-size: 14px; font-weight: 600; color: #1e293b; }
.ns-smart-item__meta { font-size: 12px; color: #64748b; }

/* AI suggestion teaser */
.ns-ai-suggest {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin: 24px 0;
    padding: 18px 20px;
    background: #f5f3ff;
    border: 1px solid #ddd6fe;
    border-radius: 14px;
}
.ns-ai-suggest__icon { font-size: 30px; }
.ns-ai-suggest__body { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 3px; }
.ns-ai-suggest__body strong { font-size: 15px; color: #1e293b; }
.ns-ai-suggest__body span { font-size: 13px; color: #64748b; line-height: 1.6; }

/* -------------------------------------------------------------------------
   Smart CTA (behavior-aware)
   ------------------------------------------------------------------------- */
.ns-smart-cta {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 22px;
    border-radius: 12px;
    text-decoration: none;
    text-align: center;
    transition: transform .15s, box-shadow .15s;
}
.ns-smart-cta:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.ns-smart-cta__text { font-size: 15px; font-weight: 700; }
.ns-smart-cta__sub { font-size: 12px; opacity: .85; }

.ns-smart-cta--cold { background: #eff6ff; color: #1648b8; border: 1px solid #bfdbfe; }
.ns-smart-cta--warm { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.ns-smart-cta--hot  { background: var(--ns-ai-accent); color: #fff; }
.ns-smart-cta--hot .ns-smart-cta__sub { opacity: .9; }

/* -------------------------------------------------------------------------
   Global RTL helpers for Persian market
   ------------------------------------------------------------------------- */
[dir="rtl"] .ns-card__meta,
[dir="rtl"] .ns-card__actions { justify-content: flex-start; }
