﻿/* فونت اصلی — هم‌تراز با نگارچی (IRANYekan WPG Num) */
@import url("wpg-scrollbars.css");

@font-face { font-family: WPGFont; src: url("/fonts/IRANYekanWPGNumFa.woff") format("woff"); font-style: normal; font-weight: 400; font-display: swap; }
@font-face { font-family: WPGFont; src: url("/fonts/IRANYekanWPGNumFa.woff") format("woff"); font-style: normal; font-weight: 700; font-display: swap; }
@font-face { font-family: WPGFont; src: url("/fonts/IRANYekanWPGNumFa.woff") format("woff"); font-style: normal; font-weight: 900; font-display: swap; }

body { font-family: WPGFont, "Segoe UI", system-ui, sans-serif; direction: rtl; }
/* لودرهای بخش‌بخش داشبورد */
.loader-section {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 10;
    background: rgba(255,255,255,0.7);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: .35rem;
    border-radius: inherit;
}

.loader-section.is-active {
    display: flex !important;
}

.loader-section .loader-spinner {
    width: 2.25rem !important;
    height: 2.25rem !important;
    border-width: .2em;
}

/* --- استایل‌های کلی سایت و هدر و سایدبار (منتقل شده از مسترپیج) --- */
body.wpg-app { background: var(--wpg-bg, #f5f6fa); }

body.wpg-app .loader-section {
    background: var(--wpg-loader-overlay, rgba(255,255,255,0.7));
    backdrop-filter: blur(4px);
}

body.wpg-app .card-body {
    position: relative;
}

body.wpg-app .main-header {
    background: var(--wpg-header-glass, #fff);
    border-bottom-color: var(--wpg-border, #e9ecef);
}
.main-header .logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2b2d42;
}
.main-header .logo i {
    font-size: 2rem;
    margin-left: 0.5rem;
    color: #008FFB;
}
.sidebar {
    background: #fff;
    border-left: 1px solid #e9ecef;
    min-height: 100vh;
    width: 240px;
    position: fixed;
    top: 56px;
    right: 0;
    z-index: 1040;
    padding-top: 1rem;
    transition: width 0.2s;
}
.sidebar ul { list-style: none; padding: 0; margin: 0; }
.sidebar ul li { margin: 0; }
.sidebar ul li a {
    display: flex;
    align-items: center;
    padding: 0.85rem 1.5rem;
    color: #333;
    text-decoration: none;
    font-size: 1.1rem;
    transition: background 0.2s, color 0.2s;
    border-radius: 0 20px 20px 0;
}
.sidebar ul li a i { margin-left: 0.7rem; font-size: 1.3rem; }
.sidebar ul li a.active, .sidebar ul li a:hover {
    background: #f1f3f9;
    color: #008FFB;
}
.main-content {
    margin-right: 240px;
    padding: 2rem 2rem 2rem 1rem;
    min-height: 100vh;
    transition: margin-right 0.2s;
}
@media (max-width: 991px) {
    .sidebar {
        width: 220px;
        right: -220px;
        top: 56px;
        transition: right 0.3s;
        box-shadow: 0 0 20px 0 rgba(0,0,0,0.08);
        display: block;
    }
    .sidebar.open { right: 0; }
    .main-content { margin-right: 0 !important; padding: 1rem; overflow-x: hidden; }
    .main-header .logo span { font-size: 1.1rem; }
}
@media (max-width: 600px) {
    .main-header { padding: 0.5rem 0.7rem;}
    .sidebar { width: 180px; right: -180px; top: 48px; }
    .sidebar.open { right: 0; }
    .main-content { padding: 0.5rem; margin-right: 0 !important; overflow-x: hidden; }
    .online-users-card { padding: 1.2rem 0.5rem 1rem 0.5rem; }
    .online-count-box { min-width: 120px; }
    .current-pages-box { min-width: 120px; max-width: 100vw; }
    .current-pages-list {
        overflow-x: auto;
        max-width: 95vw;
        word-break: break-all;
        direction: rtl;
        text-align: right;
    }
    .current-pages-list .badge {
        max-width: 80vw;
        overflow: hidden;
        display: inline-block;
    }
}
html, body {
    max-width: 100vw;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* --- کارت‌های آمار مدرن و مینیمال به سبک Google Analytics --- */
.stat-card {
    border-radius: 10px;
    border: none;
    box-shadow: 0 4px 12px 0 rgba(60,72,100,0.07), 0 1.5px 4px 0 rgba(60,72,100,0.04);
    background: #f9f9f9;
    transition: box-shadow 0.2s;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}
.stat-card:hover {
    box-shadow: 0 8px 32px 0 rgba(60,72,100,0.13), 0 2px 8px 0 rgba(60,72,100,0.08);
}
.stat-card .card-title {
    font-size: 1.05rem;
    color: #6c757d;
    font-weight: 500;
    margin-bottom: 0.5rem;
    letter-spacing: 0.01em;
    background: none;
    border: none;
    text-align: center;
}
.stat-card .card-text {
    font-size: 2.7rem;
    font-weight: 800;
    color: #222;
    margin-bottom: 0;
    letter-spacing: 0.01em;
    text-align: center;
}
.stat-card i {
    font-size: 2.2rem;
    color: #008FFB;
    margin-bottom: 0.5rem;
    display: block;
}

/* رنگ‌بندی کارت‌ها (در صورت نیاز) */
.stat-card.bg-primary i { color: #008FFB; }
.stat-card.bg-success i { color: #00E396; }
.stat-card.bg-info i { color: #00B8D9; }

/* هدر کارت‌ها مینیمال */
.card-header {
    background: transparent;
    border: none;
    padding: 1.1rem 1.5rem 0.5rem 1.5rem;
    font-weight: 600;
    font-size: 1.08rem;
    color: #222;
    letter-spacing: 0.01em;
}

/* جدول و چارت مدرن */
.table {
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 8px 0 rgba(60,72,100,0.04);
}
.table th, .table td {
    border: none;
    padding: 0.75rem 1rem;
}
.chart-container {
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 2px 8px 0 rgba(60,72,100,0.04);
    padding: 1.2rem 0.5rem 0.5rem 0.5rem;
}

.chart-container.position-relative {
    min-height: 220px;
}

body.wpg-app .wpg-table-wrap {
    position: relative;
}

/* --- نمایش نفرات آنلاین به سبک Google Analytics --- */
.online-users-card {
    background: linear-gradient(135deg, #f8fafc 60%, #f1f3f9 100%);
    box-shadow: 0 4px 24px 0 rgba(60,72,100,0.07), 0 1.5px 4px 0 rgba(60,72,100,0.04);
    border-radius: 18px;
    border: none;
    min-height: 120px;
    margin-bottom: 1.5rem;
    padding: 2rem 1.5rem 1.5rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.online-count-box {
    min-width: 160px;
}
.online-icon {
    font-size: 2.5rem;
    color: #008FFB;
    margin-bottom: 0.5rem;
}
.online-number {
    font-size: 3.8rem;
    font-weight: 800;
    color: #222;
    margin-bottom: 0.2rem;
    letter-spacing: 0.01em;
}
.online-label {
    font-size: 1.1rem;
    color: #6c757d;
    font-weight: 500;
}
.current-pages-box {
    min-width: 180px;
}
.current-pages-title {
    font-size: 1rem;
    color: #888;
    margin-bottom: 0.3rem;
    display: block;
}
.current-pages-list {
    justify-content: flex-end;
    font-size: 0.83rem;
    direction: rtl;
    text-align: right;
    margin-bottom: 0.2rem;
}
.current-pages-list .badge {
    background: #f1f3f9;
    color: #222;
    border-radius: 7px;
    font-size: 0.88rem;
    padding: 0.22em 0.7em;
    margin: 0 0.08em 0.08em 0;
    box-shadow: 0 1px 3px 0 rgba(60,72,100,0.04);
}
#showAllPagesBtn {
    color: #008FFB;
    font-weight: 500;
    text-decoration: underline;
    margin-right: 0.2rem;
    margin-top: 0.1rem;
}
#showAllPagesBtn:focus { box-shadow: none; }