/**
 * Arshia — "Product in action" demo section
 * ---------------------------------------------------------------------------
 * Effects and layout patterns adapted from liara.ir (a reference for strong
 * Persian RTL B2B UI), re-skinned with Arshia's own brand tokens:
 *   --brand-blue #352070 | --brand-gold #EEBB66
 *
 * Implements:
 *   1. Mock product window  — the "terminal" idea, translated for an ERP
 *      vendor: a live-looking app window instead of a CLI.
 *   2. Live activity feed   — Liara's deployment-feed pattern: status pills,
 *      version tags, timestamps, and a per-row action. Items are generated
 *      client-side by js/liara-effects.js so no backend is required.
 *   3. Ambient orbs         — soft brand-tinted background accents.
 *   4. Tilt + lift          — pointer-driven card depth (skipped on touch and
 *      when prefers-reduced-motion is set).
 *
 * Constitution: I.1 (Vazirmatn everywhere, no other font), IV (assets are
 * enqueued and versioned, never inline).
 */

/* ─────────────────────────────────────────────────────────────
   Section shell
   ───────────────────────────────────────────────────────────── */

.liara-demo {
    position: relative;
    overflow: hidden;
    background: var(--ar-bg-alt, #faf9fd);
    padding: 72px 0 80px;
}

.liara-demo .demo-head {
    text-align: center;
    max-width: 640px;
    margin: 0 auto 44px;
}

.liara-demo .demo-eyebrow {
    display: inline-block;
    padding: 5px 16px;
    border-radius: 999px;
    background: rgba(238, 187, 102, .18);
    border: 1px solid rgba(238, 187, 102, .5);
    color: #352070;
    font-size: 12.5px;
    font-weight: 700;
    margin-bottom: 14px;
}

.liara-demo .demo-title {
    font-size: clamp(1.5rem, 3.4vw, 2.1rem);
    font-weight: 800;
    color: #1a1a2e;
    margin: 0 0 12px;
    line-height: 1.5;
}

.liara-demo .demo-sub {
    font-size: 15px;
    color: #4b5563;
    line-height: 2;
    margin: 0;
}

.liara-demo .demo-grid {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 24px;
    align-items: start;
}

/* ─────────────────────────────────────────────────────────────
   1. Mock product window (the "terminal" idea, for an ERP vendor)
   ───────────────────────────────────────────────────────────── */

.mock-window {
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(160deg, #2a1a5a 0%, #352070 55%, #241548 100%);
    box-shadow: 0 24px 60px rgba(53, 32, 112, .28);
    border: 1px solid rgba(238, 187, 102, .22);
}

.mock-chrome {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(0, 0, 0, .22);
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.mock-dots {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.mock-dots i {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: block;
}

.mock-dots i:nth-child(1) { background: #f09595; }
.mock-dots i:nth-child(2) { background: #efb729; }
.mock-dots i:nth-child(3) { background: #5dca8b; }

.mock-url {
    flex: 1;
    text-align: center;
    font-size: 11.5px;
    color: rgba(255, 255, 255, .55);
    background: rgba(0, 0, 0, .25);
    border-radius: 8px;
    padding: 5px 12px;
    direction: ltr;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mock-tabs {
    display: flex;
    gap: 4px;
    padding: 10px 14px 0;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.mock-tab {
    appearance: none;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, .55);
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    font-size: 12.5px;
    font-weight: 700;
    padding: 8px 14px;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    transition: background .2s, color .2s;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.mock-tab:hover { color: #fff; background: rgba(255, 255, 255, .06); }

.mock-tab[aria-selected="true"] {
    color: #fff;
    background: rgba(238, 187, 102, .14);
    border-bottom-color: #EEBB66;
}

.mock-tab:focus-visible {
    outline: 2px solid #EEBB66;
    outline-offset: -2px;
}

.mock-body {
    padding: 18px 18px 20px;
    min-height: 268px;
}

/* Table of recent invoices — the "product proves itself" content */
.mock-table { width: 100%; }

.mock-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 12px;
    align-items: center;
    padding: 11px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .04);
    margin-bottom: 8px;
    transition: background .25s, transform .25s;
}

.mock-row:hover {
    background: rgba(255, 255, 255, .09);
    transform: translateX(-4px);
}

.mock-row:last-child { margin-bottom: 0; }

.mock-row-id {
    font-size: 12.5px;
    color: rgba(255, 255, 255, .92);
    font-weight: 700;
    direction: ltr;
    text-align: right;
}

.mock-row-amt {
    font-size: 12.5px;
    color: #EEBB66;
    font-weight: 700;
    white-space: nowrap;
}

.mock-pill {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    white-space: nowrap;
}

.mock-pill.is-paid     { background: rgba(93, 202, 139, .18); color: #7fe0a8; }
.mock-pill.is-pending  { background: rgba(239, 183, 41, .18);  color: #f5cf7a; }
.mock-pill.is-draft    { background: rgba(255, 255, 255, .12); color: rgba(255, 255, 255, .7); }
.mock-pill.is-canceled { background: rgba(240, 149, 149, .18); color: #f5a8a8; }

/* Command line — Liara's terminal, translated to an Arshia action */
.mock-cli {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(0, 0, 0, .32);
    border: 1px solid rgba(238, 187, 102, .16);
    font-size: 12.5px;
    direction: ltr;
    text-align: left;
    color: rgba(255, 255, 255, .9);
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mock-cli .prompt { color: #EEBB66; flex-shrink: 0; }

.mock-cli .typed {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mock-cli .caret {
    display: inline-block;
    width: 8px;
    height: 15px;
    background: #EEBB66;
    flex-shrink: 0;
    animation: ar-caret-blink 1.05s steps(2, start) infinite;
}

@keyframes ar-caret-blink { to { visibility: hidden; } }

/* ─────────────────────────────────────────────────────────────
   2. Live activity feed (Liara's deployment feed)
   ───────────────────────────────────────────────────────────── */

.demo-feed {
    background: #fff;
    border: 1px solid #eceaf3;
    border-radius: 16px;
    box-shadow: 0 12px 36px rgba(53, 32, 112, .08);
    overflow: hidden;
}

.demo-feed-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 18px;
    border-bottom: 1px solid #f0eef6;
}

.demo-feed-title {
    font-size: 13.5px;
    font-weight: 800;
    color: #352070;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.demo-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #1e7e4f;
    flex-shrink: 0;
    animation: ar-pulse 1.8s ease-in-out infinite;
}

@keyframes ar-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: .45; transform: scale(.8); }
}

.demo-feed-count {
    font-size: 11.5px;
    color: var(--text-muted);
    background: #f5f3fa;
    border-radius: 999px;
    padding: 2px 10px;
    white-space: nowrap;
}

.demo-feed-list {
    list-style: none;
    margin: 0;
    padding: 8px;
    max-height: 320px;
    overflow: hidden;
}

.demo-feed-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 10px 10px;
    border-radius: 10px;
    transition: background .2s;
}

.demo-feed-item:hover { background: #faf9fd; }

.demo-feed-item + .demo-feed-item { border-top: 1px solid #f6f4fb; }

.demo-feed-item.is-new { animation: ar-feed-in .5s ease both; }

@keyframes ar-feed-in {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: none; }
}

.demo-feed-ico {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
    background: rgba(53, 32, 112, .08);
    color: #352070;
}

/* روی تینت هم‌رنگ، #1e7e4f فقط ۴٫۳۱:۱ و #b45309 فقط ۴٫۴۲:۱ می‌داد
   (زیرِ حد ۴٫۵). همان ته‌رنگ، دو پله تیره‌تر: ۶٫۱۰:۱ و ۶٫۲۵:۱. */
.demo-feed-ico.is-ok   { background: rgba(30, 126, 79, .12);  color: var(--ok-ink); }
.demo-feed-ico.is-warn { background: rgba(217, 119, 6, .12);  color: var(--warn-ink); }
.demo-feed-ico.is-info { background: rgba(53, 32, 112, .1);   color: #352070; }

.demo-feed-text { min-width: 0; }

.demo-feed-label {
    display: block;
    font-size: 12.5px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.demo-feed-meta {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.6;
    direction: ltr;
    text-align: right;
}

.demo-feed-act {
    font-size: 11px;
    font-weight: 700;
    color: #352070;
    background: rgba(238, 187, 102, .16);
    border: 1px solid rgba(238, 187, 102, .4);
    border-radius: 8px;
    padding: 4px 10px;
    cursor: pointer;
    white-space: nowrap;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    transition: background .2s, transform .2s;
}

.demo-feed-act:hover {
    background: rgba(238, 187, 102, .3);
    transform: translateY(-1px);
}

.demo-feed-act:focus-visible {
    outline: 2px solid #352070;
    outline-offset: 2px;
}

/* ─────────────────────────────────────────────────────────────
   3. Ambient orbs
   ───────────────────────────────────────────────────────────── */

.liara-demo .orb {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.liara-demo .orb-a {
    width: 380px; height: 380px;
    top: -140px; left: -120px;
    background: radial-gradient(circle, rgba(53, 32, 112, .09), transparent 68%);
}

.liara-demo .orb-b {
    width: 320px; height: 320px;
    bottom: -130px; right: -100px;
    background: radial-gradient(circle, rgba(238, 187, 102, .14), transparent 68%);
}

.liara-demo .container { position: relative; z-index: 1; }

/* ─────────────────────────────────────────────────────────────
   4. Reveal + tilt
   ───────────────────────────────────────────────────────────── */

.liara-demo .demo-reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .7s ease, transform .7s ease;
}

.liara-demo .demo-reveal.is-visible {
    opacity: 1;
    transform: none;
}

.liara-demo .demo-reveal.d-1 { transition-delay: .1s; }
.liara-demo .demo-reveal.d-2 { transition-delay: .2s; }

.liara-demo .tilt {
    transition: transform .18s ease-out, box-shadow .18s ease-out;
    transform-style: preserve-3d;
    will-change: transform;
}

/* ─────────────────────────────────────────────────────────────
   Responsive
   ───────────────────────────────────────────────────────────── */

@media (max-width: 960px) {
    .liara-demo .demo-grid { grid-template-columns: 1fr; }
    .liara-demo .demo-feed-list { max-height: 300px; }
}

@media (max-width: 640px) {
    .liara-demo { padding: 52px 0 60px; }
    .mock-row { grid-template-columns: 1fr auto; }
    .mock-row .mock-pill { grid-column: 1 / -1; justify-self: start; }
    .mock-tabs { overflow-x: auto; }
    .demo-feed-item { grid-template-columns: auto 1fr; }
    .demo-feed-item .demo-feed-act { grid-column: 2; justify-self: start; }
}

/* ─────────────────────────────────────────────────────────────
   Reduced motion — disable all animation, keep content visible
   ───────────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    .liara-demo .demo-reveal,
    .liara-demo .demo-reveal.is-visible {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .liara-demo .tilt { transition: none; transform: none !important; }
    .liara-demo .demo-live-dot,
    .liara-demo .mock-cli .caret { animation: none; }
    .liara-demo .demo-feed-item.is-new { animation: none; }
    .liara-demo .mock-row:hover { transform: none; }
}
