﻿/* wwwroot/css/app-footer.css */

.app-footer {
    user-select: none;
    -webkit-user-select: none;
    min-height: 3rem;
    padding: 0;
    background-color: var(--rz-base-100, var(--rz-base-background-color, #fff));
    border-top: 1px solid var(--rz-base-300, rgba(0, 0, 0, 0.1));
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.06);
    contain: layout paint;
    transform: translateZ(0);
}

.footer-stack {
    direction: rtl;
    unicode-bidi: plaintext;
    width: 100%;
    flex-wrap: wrap;
    box-sizing: border-box;
    padding: 0.85rem 1.25rem;
    opacity: 0.6;
    transition: opacity 0.3s cubic-bezier(.2, .8, .2, 1);
}

    .footer-stack.is-ready {
        opacity: 1;
    }

    .footer-stack.is-mobile {
        padding: 0.65rem 0.9rem;
        gap: 0.5rem !important;
    }

.footer-pill {
    background-color: var(--rz-base-200, rgba(0, 0, 0, 0.05));
    border-radius: 999px;
    padding: 0.3rem 0.7rem;
    line-height: 1;
    touch-action: manipulation;
}

/* ✅ transform: translateZ(0) حذف شد: برای هر آیکن یک لایهٔ GPU دائمی می‌ساخت */
.footer-icon {
    font-size: 15px;
}

.footer-icon-primary {
    color: var(--rz-primary);
}

.footer-icon-success {
    color: var(--rz-success);
}

.footer-stack.is-mobile .footer-icon {
    font-size: 13px;
}

.footer-text {
    display: inline-flex;
    align-items: center;
    margin: 0;
    color: var(--rz-text-color, var(--rz-text-secondary-color, #212529));
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
}

.footer-separator {
    display: inline;
    margin: 0 2px;
    color: var(--rz-text-color, #212529);
    font-size: 0.8rem;
    line-height: 1.2;
    opacity: 0.35;
}

.footer-stack.is-mobile .footer-text,
.footer-stack.is-mobile .footer-separator {
    font-size: 0.7rem;
}

.footer-admin-search-icon {
    margin-right: 4px;
    color: var(--rz-success);
    font-size: 12px;
    opacity: 0.7;
}

.admin-online-pill {
    cursor: pointer;
    position: relative;
    /* isolation جای stacking context قبلیِ transform را می‌گیرد (بدون ساخت لایه) */
    isolation: isolate;
    --fp-success-rgb: var(--rz-success-rgb, 25 135 84);
    --fp-success: var(--rz-success, rgb(var(--fp-success-rgb)));
    /* ✅ حالت سکون: بدون translate3d و backface-visibility (قبلاً لایهٔ دائمی بود) */
    transition: background-color 0.25s cubic-bezier(.4, 0, .2, 1), transform 0.25s cubic-bezier(.4, 0, .2, 1);
}

    .admin-online-pill::before {
        content: '';
        position: absolute;
        inset: 0;
        border-radius: 999px;
        box-shadow: 0 4px 12px rgb(var(--fp-success-rgb) / 0.25);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s cubic-bezier(.4, 0, .2, 1);
    }

    .admin-online-pill:hover {
        background-color: rgb(var(--fp-success-rgb) / 0.15) !important;
        transform: translate3d(0, -2px, 0);
    }

        .admin-online-pill:hover::before {
            opacity: 1;
        }

    .admin-online-pill:active {
        transform: none;
        transition-duration: 0.1s;
    }

    /* حلقهٔ پالس: فقط opacity/transform (کامپوزیتی)؛ will-change لازم نیست چون خود انیمیشن لایه می‌سازد */
    .admin-online-pill::after {
        content: '';
        position: absolute;
        inset: -4px;
        border-radius: 999px;
        border: 3px solid rgb(var(--fp-success-rgb) / 0.7);
        opacity: 0;
        pointer-events: none;
        animation: pulseGPU 2s cubic-bezier(.4, 0, .2, 1) infinite;
    }

@keyframes pulseGPU {
    0% {
        opacity: 0.6;
        transform: scale3d(1, 1, 1);
    }

    70% {
        opacity: 0;
        transform: scale3d(1.25, 1.25, 1);
    }

    100% {
        opacity: 0;
        transform: scale3d(1, 1, 1);
    }
}

.stats-container {
    min-width: 85px;
    display: inline-flex;
    justify-content: flex-start;
}

.min-w-online {
    min-width: 55px;
}

.stat-number {
    font-weight: 600;
    animation: fadeIn 0.25s ease-in-out;
}

.stat-skeleton {
    opacity: 0.3;
    letter-spacing: 1px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ✅ نقطه‌های زنده: قبلاً box-shadow انیمیت می‌شد (هر فریم repaint روی main thread، بی‌پایان).
   حالا حلقه یک pseudo-element است که فقط transform/opacity دارد. ظاهر همان است. */
.live-pulse-dot,
.online-indicator-dot {
    position: relative;
    display: inline-block;
    border-radius: 50%;
    flex-shrink: 0;
    animation: pulse-dot 2s ease-in-out infinite;
}

.live-pulse-dot {
    width: 6px;
    height: 6px;
    background-color: #22c55e;
    --ring-scale: 3;
}

.online-indicator-dot {
    width: 8px;
    height: 8px;
    background-color: #10b981;
    --ring-scale: 2.5;
    animation-duration: 1.5s;
}

    .live-pulse-dot::after,
    .online-indicator-dot::after {
        content: '';
        position: absolute;
        inset: 0;
        border-radius: 50%;
        background-color: rgba(34, 197, 94, 0.7);
        opacity: 0;
        pointer-events: none;
        animation: pulse-ring 2s ease-out infinite;
    }

    .online-indicator-dot::after {
        animation-duration: 1.5s;
    }

@keyframes pulse-dot {
    0%, 100% {
        transform: scale(0.95);
    }

    70% {
        transform: scale(1);
    }
}

@keyframes pulse-ring {
    0% {
        opacity: 0.7;
        transform: scale(1);
    }

    70%, 100% {
        opacity: 0;
        transform: scale(var(--ring-scale, 3));
    }
}

@media (max-width: 768px) {
    .app-footer {
        min-height: 2.5rem;
    }

    .footer-pill {
        padding: 0.25rem 0.5rem;
    }

    .footer-stack {
        padding: 0.5rem 0.75rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .admin-online-pill::after,
    .live-pulse-dot,
    .live-pulse-dot::after,
    .online-indicator-dot,
    .online-indicator-dot::after {
        animation: none;
    }

    .admin-online-pill, .admin-online-pill::before, .footer-stack {
        transition: none;
        transform: none;
    }
}

@media print {
    .app-footer {
        display: none !important;
    }
}
