:root {
    /* Palette */
    --admin-primary: #2563eb;
    /* softer blue */
    --admin-primary-600: #1e40af;
    --admin-secondary: #6c757d;
    --admin-success: #16a34a;
    --admin-danger: #dc2626;
    --admin-warning: #f59e0b;
    --admin-info: #0891b2;
    --admin-dark: #0f1724;
    --admin-light: #f8fafc;

    /* Layout */
    --sidebar-width: 250px;
    --page-padding: 28px;
    --card-radius: 12px;
    --card-shadow: 0 6px 20px rgba(12, 20, 39, 0.08);

    /* Typography */
    --base-font-size: 14.5px;
    --muted: #64748b;

    --beytas-accent: #ff7aa2;
    --card-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(0, 0, 0, 0.02));
    --bs-breadcrumb-divider: "»";
}

/* Cards */
.stat-card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    transition: all 0.35s cubic-bezier(.2, .9, .2, 1);
    background: white;
    margin-bottom: 18px;
    overflow: hidden;
    position: relative;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.35s;
    pointer-events: none;
}

.stat-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card .card-body {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
    z-index: 1;
}

.stat-icon-box {
    width: 70px;
    height: 70px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: white;
    flex-shrink: 0;
    position: relative;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transition: all 0.3s;
}

.stat-card:hover .stat-icon-box {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

.stat-icon-box::before {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    bottom: -2px;
    left: -2px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3), transparent);
    z-index: -1;
}

.stat-icon-box.bg-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.stat-icon-box.bg-success {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.stat-icon-box.bg-info {
    background: linear-gradient(135deg, #14b8a6 0%, #0891b2 100%);
}

.stat-icon-box.bg-warning {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
}

.stat-icon-box.bg-danger {
    background: linear-gradient(135deg, #f87171 0%, #dc2626 100%);
}

.stat-content {
    flex: 1;
}

.stat-number {
    font-size: 2.2rem;
    font-weight: 600;
    margin: 0;
    color: var(--admin-dark);
    line-height: 1.1;
}

.stat-label {
    margin: 8px 0 0 0;
    color: var(--muted);
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.stat-label a {
    text-decoration: none;
}

/* Stat card color variants with backgrounds */
.stat-card.card-primary {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-right: 4px solid var(--admin-primary);
}

.stat-card.card-success {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-right: 4px solid var(--admin-success);
}

.stat-card.card-info {
    background: linear-gradient(135deg, #f0fdfa 0%, #ccfbf1 100%);
    border-right: 4px solid var(--admin-info);
}

.stat-card.card-warning {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-right: 4px solid var(--admin-warning);
}

.stat-card.card-danger {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-right: 4px solid var(--admin-danger);
}

/* mahfel */


[data-bs-theme=dark] {
    --border-mahfel-hero: rgba(207, 205, 255, 0.18);
    --border-mahfel-card: rgba(177, 197, 241, 0.08);
    --mahfel-hero-bg: linear-gradient(90deg, rgba(108, 99, 255, 0.12), rgba(255, 122, 162, 0.06));
    --mahfel-card-bg: #212529;
    --box-shadow-color: rgba(51, 58, 76, 0.12);
    --mahfel-title-color: #dee2e6;
    --mahfel-meta-color: #dee2e6;
    --mahfel-snippet-color: #dee2e6;
    --mahfel-badge-color: #dee2e6;
    --text-color: #dee2e6;
    --bs-card-border-color: rgba(207, 205, 255, 0.28);
    --bs-card-bg: #212529;
    --page-card-border: rgba(255, 255, 255, 0.1);
    --page-card-before-bg: linear-gradient(90deg, rgba(108, 99, 255, 0.12), rgba(255, 122, 162, 0.06));
    --main-nav-border-bt: rgba(255, 255, 255, 0.1);

    --home-hero-bg: linear-gradient(to top right, #8d6faf, #918a6d);
    --home-hero-img-box-shadow: rgba(255, 255, 255, 0.1);

    --poet-card-custom-box-shadow: rgba(255, 255, 255, 0.08);
    --poet-card-custom-bg: #3a424a;
    --poet-card-custom-hover-box-shadow: rgba(255, 255, 255, 0.12);
    --poet-link-color: #ff7600;

    --hover-color: #fcc799;
    --link-color: #ff7600;
    --link-hover-color: #fcc799;
    --primary-color: #9c82d4;
    --beytas-primary: #9c82d4;
    --author-img-border-color: rgba(255, 255, 255, .18);
    --beytas-bs-btn-color: rgb(110, 168, 254);
    --beytas-bs-btn-border-color: rgb(110, 168, 254);

    --beytas-bs-btn-hover-color: #fff;
    --beytas-bs-btn-hover-boder-color: rgb(110, 168, 254);

}

[data-bs-theme=light] {
    --border-mahfel-hero: rgba(108, 99, 255, .18);
    --border-mahfel-card: rgba(68, 101, 177, 0.08);
    --mahfel-hero-bg: linear-gradient(135deg, rgba(108, 99, 255, .12), rgba(255, 122, 162, .10));
    --mahfel-card-bg: #fff;
    --box-shadow-color: rgba(15, 23, 42, .12);
    --mahfel-title-color: #1f2937;
    --mahfel-meta-color: #64748b;
    --mahfel-snippet-color: #334155;
    --mahfel-badge-color: #4f46e5;
    --text-color: #212529;
    --bs-card-border-color: rgba(15, 23, 42, .08);
    --bs-card-bg: #fff;

    --page-card-border: rgba(0, 0, 0, 0.05);
    --page-card-before-bg: rgba(108, 99, 255, 0.08);
    --main-nav-border-bt: rgba(0, 0, 0, 0.05);

    --home-hero-bg: linear-gradient(to top right, #e9d8fd, #fef3c7);
    --home-hero-img-box-shadow: rgba(0, 0, 0, 0.1);
    --poet-card-custom-box-shadow: rgba(0, 0, 0, 0.08);
    --poet-card-custom-bg: #fff;
    --poet-card-custom-hover-box-shadow: rgba(0, 0, 0, 0.12);
    --poet-link-color: #0d6efd;

    --hover-color: #5a32a3;
    --link-color: #0d6efd;
    --link-hover-color: #0056b3;
    --primary-color: #6f42c1;
    --beytas-primary: #6c63ff;

    --author-img-border-color: rgba(108, 99, 255, .18);

    --beytas-bs-btn-color: #212529;
    --beytas-bs-btn-border-color: #212529;

    --beytas-bs-btn-hover-color: #fff;
    --beytas-bs-btn-hover-boder-color: #212529;

}


.mahfel-hero {
    background: var(--mahfel-hero-bg);
    border: 1px solid var(--border-mahfel-hero);
    border-radius: 18px;
    padding: 2rem;
    box-shadow: 0 12px 30px var(--box-shadow-color);
}

.mahfel-card {
    border: 1px solid var(--border-mahfel-card);
    border-radius: 16px;
    padding: 1.2rem 1.3rem;
    background: var(--mahfel-card-bg);
    transition: transform .15s ease, box-shadow .15s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.mahfel-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 40px rgba(15, 23, 42, .12);
}

.mahfel-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--mahfel-title-color);
}

.mahfel-meta {
    font-size: .85rem;
    color: var(--mahfel-meta-color);
}

.mahfel-snippet {
    color: var(--mahfel-snippet-color);
    line-height: 1.9;
    margin-top: .6rem;
    min-height: 56px;
    white-space-collapse: preserve-breaks;
}


.mahfel-badge {
    background: rgba(108, 99, 255, .12);
    color: var(--mahfel-badge-color);
    border-radius: 999px;
    padding: .25rem .7rem;
    font-size: .75rem;
    font-weight: 600;
}

.mahfel-author {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
}

.mahfel-author img {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    object-fit: cover;
    border: 2px solid rgba(108, 99, 255, .18);
}

/* app */
.main-navbar {
    background: linear-gradient(90deg, rgba(108, 99, 255, 0.12), rgba(255, 122, 162, 0.06));
    backdrop-filter: blur(4px);
    border-bottom: 1px solid var(--main-nav-border-bt);
}

.nav-link {
    /* color: #2b2b2b !important; */
    /* font-weight: 600; */
    padding: .6rem .9rem;
    border-radius: 999px;
    transition: all .18s ease;
}

.nav-link:hover {
    transform: translateY(-2px);
    background: rgba(108, 99, 255, 0.06);
    color: var(--beytas-primary) !important;
    text-decoration: none;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    color: var(--beytas-primary) !important;
    font-size: 1.05rem;
}

footer.site-footer {
    background: linear-gradient(180deg, #0f1724 0%, #0b1220 100%);
    color: #cbd5e1;
    padding: 2rem 0;
}

footer.site-footer a {
    color: #e2e8f0;
    text-decoration: none;
}

footer.site-footer a:hover {
    color: #fff;
    text-decoration: underline;
}

.thread-card {
    border: 1px solid var(--bs-card-border-color);
    border-radius: 18px;
    padding: 1.6rem;
    background: var(--bs-card-bg);
    box-shadow: 0 16px 38px rgba(15, 23, 42, .08);
}

.thread-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-color);
}

.thread-meta {
    color: var(--bs-secondary-color);
    font-size: .9rem;
}

.thread-content {
    margin-top: 1rem;
    line-height: 2;
    color: var(--text-color);
    white-space: pre-wrap;
}

.reply-card {
    border: 1px solid rgba(148, 163, 184, .25);
    border-radius: 14px;
    padding: 1rem 1.1rem;
    background: var(--bs-card-bg);
    margin-bottom: .9rem;
}

.reply-depth-1 {
    border-right: 4px solid rgba(108, 99, 255, .35);
}

.reply-depth-2 {
    border-right: 4px solid rgba(255, 122, 162, .35);
    margin-right: 12px;
}

.reply-depth-3 {
    border-right: 4px solid rgba(15, 118, 110, .35);
    margin-right: 24px;
}

.reply-depth-4 {
    border-right: 4px solid rgba(234, 88, 12, .35);
    margin-right: 36px;
}

.reply-author {
    font-weight: 600;
    color: var(--text-color);
}

.reply-meta {
    font-size: .8rem;
    color: var(--bs-secondary-color);
}

.reply-content {
    margin-top: .6rem;
    line-height: 1.9;
    white-space: pre-wrap;
    color: var(--text-color);
}


/* body {
    background-color: #faf9f7;
} */

.hero {
    /*  background: var(--home-hero-bg); */
    background: var(--mahfel-hero-bg);
    min-height: 100vh;
    display: flex;
    align-items: center;
    text-align: center;
}


.hero .app-icon-svg {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 5px;
    position: relative;
    transition: border-color 0.3s ease;


}

.hero .app-icon-svg svg {
    max-width: 220px;
    border-radius: 30px;
    box-shadow: 0 10px 25px var(--home-hero-img-box-shadow);
}

.btn-download {
    font-size: 1.1rem;
    padding: 0.75rem 1.5rem;
}

.feature-icon {
    width: 50px;
    height: 50px;
    background-color: #f5f3ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: #6b21a8;
    font-size: 1.5rem;
}

.feature-icon img {
    width: 50px;
    padding: 8px;
}

.direction-ltr {
    direction: ltr;
    unicode-bidi: embed;
}

.rank-badge.top-1 {
    background: linear-gradient(135deg, #ffd700, #ffcc33);
    color: #111;
}

.rank-badge.top-2 {
    background: linear-gradient(135deg, #c0c0c0, #d9d9d9);
    color: #111;
}


.rank-badge.top-3 {
    background: linear-gradient(135deg, #cd7f32, #e0a66a);
    color: #111;
}

svg.top-1 {
    fill: #ffd700;
}

svg.top-2 {

    fill: #c0c0c0;
}

svg.top-3 {
    fill: #cd7f32;
}

/* آواتار دایره‌ای */
.avatar-circle {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid rgba(108, 99, 255, 0.3);
    background-color: #f0f2f5;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.avatar-circle:hover {
    transform: scale(1.05);
    border-color: var(--beytas-primary);
}

.reply-avatar {
    width: 64px;
    height: 64px;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* در حالت تاریک */
[data-bs-theme=dark] .avatar-circle {
    background-color: #2c3034;
    border-color: rgba(156, 130, 212, 0.4);
}