/* ==================================================================
   پوسته‌ی اپلیکیشنی Ai صدا — نوار «خانه / همه ابزارهای AI»
   ==================================================================
   این فایل هم در صفحه‌ی خانه بارگذاری می‌شود و هم در صفحه‌های بخش
   ابزارها. همه‌ی نام‌ها پیشوند asx دارند تا با هیچ کلاسی از خود صفحه‌ها
   قاطی نشوند، و هیچ قانونی روی عناصر خود صفحه نوشته نشده مگر جابه‌جا
   کردن چند عنصر شناور که زیر نوار می‌ماندند.
   موبایل: نوار پایین، مثل اپلیکیشن.   کامپیوتر: داکِ شناور شیشه‌ای.
   ================================================================== */

/* فونت جدا و با نام جدا — تا فونت خود صفحه‌ها دست نخورد */
@font-face {
    font-family: 'AsxVazir';
    src: url('/assets/fonts/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: 700; font-style: normal; font-display: swap;
}

.asx-nav, .asx-nav * { box-sizing: border-box; }

.asx-nav {
    --asx-a: #4A6CFA;
    --asx-b: #0FD4A8;
    --asx-ink: #1A202C;
    --asx-mute: #7A869A;
    position: fixed; z-index: 70;
    left: 0; right: 0; bottom: 0;
    direction: rtl;
    padding: 0 12px env(safe-area-inset-bottom);
    font-family: 'AsxVazir', 'Vazirmatn', system-ui, 'Segoe UI', Tahoma, sans-serif;
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: blur(18px) saturate(1.6);
    backdrop-filter: blur(18px) saturate(1.6);
    border-top: 1px solid rgba(26, 32, 44, 0.07);
    box-shadow: 0 -12px 32px -20px rgba(26, 32, 44, 0.45);
    transition: transform 0.28s cubic-bezier(.22,.68,.32,1), opacity 0.2s;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}
/* خط نور بالای نوار */
.asx-nav::before {
    content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 1px;
    background: linear-gradient(to left, transparent, var(--asx-b), var(--asx-a), transparent);
    opacity: 0.55; pointer-events: none;
}

.asx-nav__in {
    display: grid; grid-template-columns: 1fr 1fr;
    max-width: 520px; height: 62px; margin: 0 auto;
}

.asx-tab {
    position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    color: var(--asx-mute); text-decoration: none;
    font-size: 0.72rem; font-weight: 700; line-height: 1.2; white-space: nowrap;
    border: 0; background: none; cursor: pointer;
    transition: color 0.2s;
}
.asx-tab:focus-visible { outline: 2.5px solid var(--asx-a); outline-offset: -4px; border-radius: 16px; }

.asx-ic {
    display: grid; place-items: center;
    width: 58px; height: 30px; border-radius: 999px;
    transition: background 0.25s, box-shadow 0.25s, transform 0.2s cubic-bezier(.22,.68,.32,1);
}
.asx-ic svg {
    width: 22px; height: 22px; display: block;
    fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
}
.asx-ic .asx-logo {
    width: 24px; height: 24px; display: block; border-radius: 8px; object-fit: cover;
    background: #fff; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.9), 0 3px 8px -3px rgba(26, 32, 44, 0.45);
    filter: saturate(0.25) opacity(0.8); transition: filter 0.25s;
}
.asx-tab.is-on .asx-logo, .asx-tab:hover .asx-logo { filter: none; }
.asx-tab:active .asx-ic { transform: scale(0.92); }

.asx-tab.is-on { color: var(--asx-ink); }
.asx-tab.is-on .asx-ic {
    color: #fff;
    background: linear-gradient(120deg, var(--asx-a), var(--asx-b));
    box-shadow: 0 8px 18px -8px rgba(74, 108, 250, 0.75);
}

/* جا برای نوار، تا انتهای صفحه زیرش نماند */
html.asx-on body { padding-bottom: calc(70px + env(safe-area-inset-bottom)) !important; }

/* وقتی کیبورد موبایل باز است نوار کنار می‌رود تا جای نوشتن را نگیرد */
html.asx-kb .asx-nav { transform: translateY(120%); opacity: 0; pointer-events: none; }

/* عناصر شناورِ خود صفحه‌ها که زیر نوار می‌ماندند */
html.asx-on #alphaUpCta { bottom: calc(76px + env(safe-area-inset-bottom)) !important; }
html.asx-on.asx-host .toast { bottom: calc(80px + env(safe-area-inset-bottom)) !important; }

/* در بخش ابزارها خرید اشتراک با پلن‌های همین سایت است؛ قیمتِ داخل پنجره‌ی
   «سهمیه تمام شد» نمایش داده نمی‌شود تا با پلن‌های این‌جا دوگانه نشود. */
html.asx-host #alphaPayBox .apprice { display: none !important; }

/* ---------- پیام کوتاه ---------- */
.asx-toast {
    position: fixed; z-index: 2147483000;
    left: 50%; bottom: calc(86px + env(safe-area-inset-bottom));
    transform: translate(-50%, 14px);
    width: max-content; max-width: min(92vw, 30rem);
    padding: 0.8rem 1.15rem; border-radius: 18px;
    direction: rtl; text-align: center;
    font-family: 'AsxVazir', 'Vazirmatn', system-ui, 'Segoe UI', Tahoma, sans-serif;
    font-size: 0.86rem; font-weight: 700; line-height: 1.9; color: #fff;
    background: linear-gradient(135deg, #1A202C, #2B3550);
    box-shadow: 0 22px 44px -18px rgba(26, 32, 44, 0.7);
    opacity: 0; pointer-events: none;
    transition: opacity 0.3s, transform 0.3s cubic-bezier(.22,.68,.32,1);
}
.asx-toast.is-on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.asx-toast.is-good { background: linear-gradient(135deg, #0B8F74, #0FD4A8); }

/* ==================================================================
   کامپیوتر — داک شناور
   ================================================================== */
@media (min-width: 960px) {
    .asx-nav {
        left: 50%; right: auto; bottom: 22px;
        transform: translateX(-50%);
        padding: 6px;
        border-radius: 999px;
        border: 1px solid rgba(255, 255, 255, 0.85);
        background: rgba(255, 255, 255, 0.78);
        -webkit-backdrop-filter: blur(22px) saturate(1.8);
        backdrop-filter: blur(22px) saturate(1.8);
        box-shadow:
            0 0 0 1px rgba(74, 108, 250, 0.10),
            0 26px 60px -22px rgba(26, 32, 44, 0.55),
            0 8px 20px -12px rgba(74, 108, 250, 0.35);
        animation: asx-rise 0.6s cubic-bezier(.22,.68,.32,1) both;
    }
    .asx-nav::before { display: none; }
    @keyframes asx-rise {
        from { opacity: 0; transform: translate(-50%, 26px); }
        to   { opacity: 1; transform: translate(-50%, 0); }
    }

    .asx-nav__in { display: flex; gap: 6px; height: auto; max-width: none; }

    .asx-tab {
        flex-direction: row; gap: 0.55rem;
        padding: 0.66rem 1.35rem; border-radius: 999px;
        font-size: 0.93rem;
        transition: color 0.2s, background 0.25s, box-shadow 0.25s, transform 0.2s cubic-bezier(.22,.68,.32,1);
    }
    .asx-ic, .asx-tab.is-on .asx-ic { width: auto; height: auto; background: none; box-shadow: none; color: inherit; }
    .asx-ic svg { width: 20px; height: 20px; }
    .asx-ic .asx-logo { width: 22px; height: 22px; border-radius: 7px; }

    .asx-tab:not(.is-on):hover { color: var(--asx-ink); background: rgba(74, 108, 250, 0.09); transform: translateY(-1px); }
    .asx-tab.is-on {
        color: #fff;
        background: linear-gradient(120deg, var(--asx-a), var(--asx-b));
        box-shadow: 0 12px 26px -12px rgba(74, 108, 250, 0.85);
    }
    .asx-tab:focus-visible { outline-offset: 3px; border-radius: 999px; }

    html.asx-on body { padding-bottom: 96px !important; }
    html.asx-kb .asx-nav { transform: translateX(-50%); opacity: 1; pointer-events: auto; }
    html.asx-on #alphaUpCta { bottom: 22px !important; }
    html.asx-on.asx-host .toast { bottom: 100px !important; }
    .asx-toast { bottom: 104px; }
}

@media (prefers-reduced-motion: reduce) {
    .asx-nav, .asx-tab, .asx-ic, .asx-toast { transition: none !important; animation: none !important; }
}
@media print { .asx-nav, .asx-toast { display: none !important; } }

/* ==================================================================
   ورود با گوگل — دکمه، پیام و نوار بالای ابزارها
   ================================================================== */
.asx-gbtn {
    position: relative;
    display: inline-flex; align-items: center; justify-content: center; gap: 0.7rem;
    min-height: 52px; padding: 0.7rem 1.5rem;
    border: 1.5px solid #DADCE0; border-radius: 999px;
    background: #fff; color: #1F2937; cursor: pointer;
    font-family: 'AsxVazir', 'Vazirmatn', system-ui, 'Segoe UI', Tahoma, sans-serif;
    font-size: 1rem; font-weight: 700; line-height: 1.4; white-space: nowrap;
    box-shadow: 0 10px 24px -14px rgba(26, 32, 44, 0.45);
    transition: transform 0.18s cubic-bezier(.22,.68,.32,1), box-shadow 0.22s, border-color 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.asx-gbtn:hover { transform: translateY(-2px); border-color: #4A6CFA; box-shadow: 0 16px 30px -14px rgba(74, 108, 250, 0.55); }
.asx-gbtn:active { transform: scale(0.97); }
.asx-gbtn:focus-visible { outline: 2.5px solid #4A6CFA; outline-offset: 3px; }
.asx-gbtn__ic { display: grid; place-items: center; width: 24px; height: 24px; flex-shrink: 0; }
.asx-gbtn__ic svg { width: 22px; height: 22px; display: block; }
.asx-gbtn__sp {
    display: none; width: 18px; height: 18px; border-radius: 50%;
    border: 2.5px solid rgba(74, 108, 250, 0.25); border-top-color: #4A6CFA;
    animation: asx-spin 0.7s linear infinite;
}
.asx-gbtn.is-busy { cursor: progress; opacity: 0.85; }
.asx-gbtn.is-busy .asx-gbtn__sp { display: block; }
@keyframes asx-spin { to { transform: rotate(360deg); } }

/* ---------- پنجره‌ی پیام ---------- */
.asx-gate, .asx-gate * { box-sizing: border-box; }
.asx-gate {
    position: fixed; inset: 0; z-index: 2147482400;
    display: flex; align-items: flex-end; justify-content: center;
    padding: 0; direction: rtl;
    background: rgba(18, 24, 38, 0.55);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    font-family: 'AsxVazir', 'Vazirmatn', system-ui, 'Segoe UI', Tahoma, sans-serif;
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity 0.25s, visibility 0.25s;
}
.asx-gate.is-on { opacity: 1; visibility: visible; pointer-events: auto; }
.asx-gate__box {
    position: relative; width: 100%; max-width: 440px;
    padding: 1.9rem 1.4rem calc(1.4rem + env(safe-area-inset-bottom));
    border-radius: 28px 28px 0 0; text-align: center;
    background:
        radial-gradient(120% 70% at 100% 0%, rgba(74, 108, 250, 0.13), transparent 60%),
        radial-gradient(110% 70% at 0% 0%, rgba(15, 212, 168, 0.14), transparent 55%),
        #fff;
    box-shadow: 0 -30px 80px -30px rgba(18, 24, 38, 0.6);
    transform: translateY(40px);
    transition: transform 0.35s cubic-bezier(.22,.68,.32,1);
}
.asx-gate.is-on .asx-gate__box { transform: none; }
.asx-gate__x {
    position: absolute; top: 12px; left: 14px;
    width: 36px; height: 36px; border: 0; border-radius: 50%;
    background: rgba(26, 32, 44, 0.06); color: #626F86;
    font-size: 1.35rem; line-height: 1; cursor: pointer;
}
.asx-gate__x:hover { background: rgba(26, 32, 44, 0.12); color: #1A202C; }
.asx-gate__grip { display: block; width: 44px; height: 5px; margin: -0.9rem auto 1.1rem; border-radius: 99px; background: rgba(26, 32, 44, 0.14); }
.asx-gate__badge {
    width: 76px; height: 76px; margin: 0 auto 1.05rem; border-radius: 26px; padding: 3px;
    background: linear-gradient(135deg, #4A6CFA, #0FD4A8);
    box-shadow: 0 20px 38px -18px rgba(74, 108, 250, 0.85);
}
.asx-gate__badge span { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 23px; background: #fff; }
.asx-gate__badge svg { width: 36px; height: 36px; display: block; }
.asx-gate h3 { margin: 0 0 0.55rem; font-size: 1.2rem; font-weight: 700; line-height: 1.8; color: #1A202C; }
.asx-gate__tx { margin: 0 0 1.25rem; font-size: 0.92rem; font-weight: 400; line-height: 2.05; color: #626F86; font-family: 'Vazirmatn', system-ui, 'Segoe UI', Tahoma, sans-serif; }
.asx-gate .asx-gbtn { width: 100%; }
.asx-gate__no {
    margin-top: 0.5rem; padding: 0.55rem 1.2rem; border: 0; background: none; cursor: pointer;
    font-family: inherit; font-size: 0.88rem; color: #8A94A6;
}
.asx-gate__no:hover { color: #1A202C; }
html.asx-lock, html.asx-lock body { overflow: hidden !important; }

/* ---------- خانه: وضعیت اشتراک قابل کلیک ---------- */
.asx-sublink { cursor: pointer; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 4px; }
.asx-sublink:hover { filter: brightness(0.92); }

@media (min-width: 640px) {
    .asx-gate { align-items: center; padding: 1.2rem; }
    .asx-gate__grip { display: none; }
    .asx-gate__box { border-radius: 28px; padding: 2.1rem 1.9rem 1.5rem; box-shadow: 0 40px 90px -30px rgba(18, 24, 38, 0.65); transform: translateY(18px) scale(0.97); }
}
@media (prefers-reduced-motion: reduce) {
    .asx-gate, .asx-gate__box, .asx-gbtn { transition: none !important; animation: none !important; }
}
@media print { .asx-gate { display: none !important; } }
