/* ============================================================
   مجله لیلی‌کارت | استایل اصلی
   نسخه: 1.0
   محتویات: غیر حیاتی (critical به‌صورت inline در <head>)
   ============================================================ */

:root {
    --bg: #f8fafc;
    --surface: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --primary: #be123c;
    --primary-light: #fff1f2;
    --secondary: #4338ca;
    --secondary-light: #eef2ff;
    --border: #e2e8f0;
    --shadow-sm: 0 4px 10px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 50px -15px rgba(190, 18, 60, 0.25);
    --radius: 18px;
    --max-width: 1000px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: 'Vazirmatn', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    overflow-x: hidden;
    /* padding-bottom در موبایل فقط برای sticky bar؛ در دسکتاپ حذف شد تا اسکرول به‌هم نریزه */
    padding-bottom: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
main { flex: 1 0 auto; width: 100%; }
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background: radial-gradient(600px circle at 10% 10%, rgba(190, 18, 60, 0.05), transparent 40%),
                radial-gradient(800px circle at 90% 90%, rgba(67, 56, 202, 0.05), transparent 40%);
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { font-family: inherit; }

/* ===== Header & Nav ===== */
header {
    position: sticky; top: 0; z-index: 1005;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}
.nav-container {
    max-width: var(--max-width); margin: 0 auto;
    padding: 1rem 1.5rem; display: flex;
    justify-content: space-between; align-items: center; position: relative;
}
.logo {
    font-size: 1.5rem; font-weight: 800; color: var(--primary);
    display: flex; align-items: center; gap: 8px;
    z-index: 1007; position: relative; cursor: pointer;
}
.logo svg { width: 32px; height: 32px; fill: var(--primary); animation: heart-beat 1.5s ease-in-out infinite; }
@keyframes heart-beat {
    0%, 100% { transform: scale(1); }
    15% { transform: scale(1.2); }
    30% { transform: scale(1); }
    45% { transform: scale(1.15); }
    60% { transform: scale(1); }
}
.nav-links { display: flex; gap: 1.5rem; align-items: center; }
.nav-links a { color: var(--muted); font-weight: 600; transition: 0.3s; font-size: 0.9rem; position: relative; }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a:not(.btn)::after {
    content: ''; position: absolute; bottom: -4px; right: 0;
    width: 0; height: 2px; background: var(--primary); transition: width 0.3s;
}
.nav-links a:not(.btn):hover::after, .nav-links a.active::after { width: 100%; }

.btn {
    background: var(--text); color: var(--bg);
    padding: 0.8rem 1.6rem; border-radius: 50px;
    font-weight: 700; font-size: 0.95rem;
    transition: all 0.3s ease; border: none; cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
}
.btn-primary { background: linear-gradient(135deg, var(--primary), #e11d48); box-shadow: 0 8px 20px -5px rgba(190, 18, 60, 0.5); color: #ffffff !important; }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 12px 25px -5px rgba(190, 18, 60, 0.6); }

.mobile-menu-btn {
    display: none; background: transparent; border: none; cursor: pointer;
    font-size: 1.8rem; color: var(--text); z-index: 1008;
}

/* ===== Mobile Nav ===== */
.menu-backdrop {
    position: fixed; inset: 0; background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(5px); z-index: 1000; opacity: 0; visibility: hidden; transition: 0.3s ease;
}
.menu-backdrop.active { opacity: 1; visibility: visible; }
.menu-backdrop[hidden] { display: none; }

.mobile-nav {
    position: fixed; top: 0; right: -100%; width: 320px; max-width: 85vw; height: 100vh;
    background: var(--bg); z-index: 1006; transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex; flex-direction: column; box-shadow: -10px 0 40px rgba(0,0,0,0.1);
}
.mobile-nav[hidden] { display: flex; right: -100%; }
.mobile-nav.active { right: 0; }

.mobile-nav-header {
    padding: 2rem 1.5rem; background: linear-gradient(135deg, var(--primary), #e11d48);
    color: #fff; display: flex; align-items: center; justify-content: space-between;
    border-bottom-left-radius: 30px;
}
.mobile-nav-header .m-logo { font-size: 1.5rem; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.mobile-nav-header svg { width: 28px; height: 28px; fill: #fff; }

.m-close-btn {
    background: rgba(255,255,255,0.2); border: none; color: #fff; width: 36px; height: 36px;
    border-radius: 50%; cursor: pointer; font-size: 1.2rem; display: flex; align-items: center; justify-content: center;
    transition: 0.2s;
}
.m-close-btn:hover { background: rgba(255,255,255,0.4); transform: rotate(90deg); }

.mobile-nav-top-action { padding: 1.5rem 1.5rem 0; }
.mobile-nav-top-action .btn { width: 100%; justify-content: center; }

.mobile-nav-links { padding: 1.5rem; display: flex; flex-direction: column; gap: 0.8rem; flex-grow: 1; }
.mobile-nav-links a {
    display: flex; align-items: center; gap: 15px; font-size: 1.1rem; font-weight: 600; color: var(--text);
    background: var(--surface); padding: 1rem 1.2rem; border-radius: 14px; border: 1px solid var(--border); transition: 0.3s;
}
.mobile-nav-links a:hover, .mobile-nav-links a.active {
    background: var(--primary-light); border-color: var(--primary); color: var(--primary); transform: translateX(-5px);
}
.mobile-nav-links a svg {
    width: 20px; height: 20px; color: #fff; background: var(--primary);
    padding: 8px; border-radius: 10px; box-sizing: content-box;
}

/* ===== Blog Hero & Search ===== */
.blog-hero {
    max-width: 800px; margin: 4rem auto 2rem; padding: 0 1.5rem; text-align: center;
    animation: fadeUp 1s ease;
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.blog-hero h1 { font-size: 3rem; font-weight: 900; color: var(--text); margin-bottom: 1rem; }
.blog-hero h1 span { color: var(--primary); position: relative; display: inline-block; }
.blog-hero h1 span::after { content: ''; position: absolute; bottom: 5px; right: 0; width: 100%; height: 10px; background: rgba(190, 18, 60, 0.15); z-index: -1; border-radius: 4px; }
.blog-hero p { color: var(--muted); font-size: 1.1rem; margin-bottom: 2.5rem; }

.search-box { position: relative; max-width: 500px; margin: 0 auto; }
.search-box form { display: flex; }
.search-box input {
    width: 100%; padding: 1.2rem 3rem 1.2rem 1.5rem; border: 1px solid var(--border);
    border-radius: 50px; font-family: inherit; font-size: 1rem; background: var(--surface);
    box-shadow: var(--shadow-sm); transition: 0.3s;
}
.search-box input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(190, 18, 60, 0.1); }
.search-box svg { position: absolute; right: 1.2rem; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; color: var(--muted); pointer-events: none; }
.search-btn-icon {
    position: absolute; right: 1.2rem; top: 50%; transform: translateY(-50%);
    width: 24px; height: 24px; color: var(--muted); pointer-events: none;
}

/* Categories Pills */
.category-pills { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.8rem; margin-bottom: 4rem; padding: 0 1.5rem; }
.pill {
    background: var(--surface); border: 1px solid var(--border); padding: 0.6rem 1.4rem;
    border-radius: 50px; font-family: inherit; font-weight: 600; color: var(--muted);
    cursor: pointer; transition: 0.3s; font-size: 0.9rem;
}
.pill:hover { border-color: var(--primary); color: var(--primary); }
.pill.active { background: linear-gradient(135deg, var(--primary), #e11d48); color: #fff; border-color: transparent; box-shadow: 0 4px 10px rgba(190, 18, 60, 0.3); }

/* ===== Posts Grid ===== */
.posts-container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem 4rem; }

/* Featured Post */
.featured-post {
    display: grid; grid-template-columns: 1.2fr 1fr; background: var(--surface);
    border-radius: 24px; overflow: hidden; box-shadow: var(--shadow-lg); margin-bottom: 3rem;
    border: 1px solid var(--border); transition: 0.3s;
}
.featured-post:hover { transform: translateY(-5px); }
.featured-img {
    background: linear-gradient(135deg, #4338ca, #be123c); min-height: 300px;
    display: flex; align-items: center; justify-content: center; position: relative;
}
.featured-img img { width: 100%; height: 100%; object-fit: cover; }
.featured-img svg { width: 80px; height: 80px; fill: rgba(255,255,255,0.2); }
.featured-img .badge-featured {
    position: absolute; top: 1.5rem; right: 1.5rem; background: #fff;
    color: var(--primary); padding: 0.4rem 1rem; border-radius: 20px; font-size: 0.8rem; font-weight: 700; z-index: 2;
}
.featured-content { padding: 3rem; display: flex; flex-direction: column; justify-content: center; }
.featured-content .tag { background: var(--secondary-light); color: var(--secondary); padding: 0.3rem 0.8rem; border-radius: 6px; font-size: 0.75rem; font-weight: 700; align-self: flex-start; margin-bottom: 1rem; }
.featured-content h2 { font-size: 1.8rem; font-weight: 800; line-height: 1.4; margin-bottom: 1rem; color: var(--text); }
.featured-content h2 a:hover { color: var(--primary); }
.featured-content p { color: var(--muted); margin-bottom: 2rem; font-size: 1rem; }
.read-more { display: inline-flex; align-items: center; gap: 5px; color: var(--primary); font-weight: 700; transition: gap 0.3s; }
.read-more:hover { gap: 10px; }

/* Normal Posts Grid */
.posts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 2rem; }
.post-card {
    background: var(--surface); border-radius: var(--radius); overflow: hidden;
    border: 1px solid var(--border); transition: all 0.3s ease; display: flex; flex-direction: column;
}
.post-card:hover { transform: translateY(-8px); box-shadow: 0 20px 35px -15px rgba(0,0,0,0.15); border-color: transparent; }

.post-card-img { height: 180px; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.post-card-img img { width: 100%; height: 100%; object-fit: cover; }
.post-card-img svg { width: 40px; height: 40px; fill: rgba(255,255,255,0.8); transition: transform 0.5s ease; }
.post-card:hover .post-card-img svg { transform: scale(1.2) rotate(10deg); }

.post-card-img .post-cat {
    position: absolute; bottom: 1rem; right: 1rem; background: rgba(255,255,255,0.9);
    color: var(--text); padding: 0.2rem 0.6rem; border-radius: 6px; font-size: 0.7rem; font-weight: 700; z-index: 2;
}
.post-card-content { padding: 1.5rem; flex-grow: 1; display: flex; flex-direction: column; }
.post-card-content .date { font-size: 0.8rem; color: var(--muted); margin-bottom: 0.5rem; display: flex; align-items: center; gap: 5px; }
.post-card-content h3 { font-size: 1.15rem; margin-bottom: 0.8rem; line-height: 1.5; font-weight: 700; }
.post-card-content h3 a:hover { color: var(--primary); }
.post-card-content p { font-size: 0.9rem; color: var(--muted); margin-bottom: 1rem; flex-grow: 1; }
.post-card-link { color: var(--primary); font-weight: 700; font-size: 0.9rem; }

/* Pagination */
.pagination { display: flex; justify-content: center; align-items: center; gap: 0.5rem; margin-top: 4rem; }
.page-btn {
    min-width: 40px; height: 40px; padding: 0 0.8rem; border-radius: 10px; border: 1px solid var(--border);
    background: var(--surface); color: var(--muted); font-weight: 700; cursor: pointer;
    transition: 0.3s; display: flex; align-items: center; justify-content: center; font-family: inherit;
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); color: #fff; border-color: transparent; box-shadow: 0 4px 10px rgba(190,18,60,0.3); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===== Article Page ===== */
.article-page { max-width: 800px; margin: 3rem auto; padding: 0 1.5rem; }
.article-hero {
    text-align: center; margin-bottom: 2.5rem;
}
.article-hero .breadcrumb { margin-bottom: 1.5rem; font-size: 0.85rem; color: var(--muted); }
.article-hero .breadcrumb ol { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.article-hero .breadcrumb li:not(:last-child)::after { content: '←'; margin-right: 8px; color: var(--muted); }
.article-hero .breadcrumb a:hover { color: var(--primary); }
.article-hero .article-cat { color: var(--primary); font-weight: 700; font-size: 0.85rem; margin-bottom: 0.8rem; display: inline-block; }
.article-hero h1 { font-size: 2.5rem; font-weight: 900; line-height: 1.4; color: var(--text); margin-bottom: 1rem; }
.article-hero .article-meta { display: flex; justify-content: center; gap: 1.5rem; color: var(--muted); font-size: 0.9rem; }
.article-hero .article-meta span { display: inline-flex; align-items: center; gap: 5px; }

.article-featured-img {
    width: 100%; height: 400px; border-radius: 24px; margin-bottom: 2.5rem;
    background: linear-gradient(135deg, #4338ca, #be123c);
    display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.article-featured-img img { width: 100%; height: 100%; object-fit: cover; }

.article-content { font-size: 1.05rem; line-height: 1.9; color: #1f2937; }
.article-content h2 { font-size: 1.5rem; font-weight: 800; margin: 2rem 0 1rem; color: var(--text); border-right: 4px solid var(--primary); padding-right: 12px; }
.article-content h3 { font-size: 1.25rem; font-weight: 700; margin: 1.5rem 0 0.8rem; color: var(--text); }
.article-content p { margin-bottom: 1.2rem; }
.article-content ul, .article-content ol { margin: 1rem 0 1.2rem 0; padding-right: 1.5rem; }
.article-content li { margin-bottom: 0.5rem; }
.article-content img { max-width: 100%; height: auto; border-radius: 12px; margin: 1.5rem 0; }
.article-content blockquote {
    border-right: 4px solid var(--primary); background: var(--primary-light);
    padding: 1rem 1.5rem; margin: 1.5rem 0; border-radius: 8px; color: var(--text);
    font-style: italic;
}
.article-content pre {
    background: #1e293b; color: #f1f5f9; padding: 1rem 1.2rem; border-radius: 8px;
    overflow-x: auto; font-family: 'Courier New', monospace; margin: 1rem 0; font-size: 0.9rem;
}
.article-content code { background: #f1f5f9; padding: 2px 6px; border-radius: 4px; font-family: 'Courier New', monospace; }
.article-content pre code { background: transparent; padding: 0; }

.article-footer {
    margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border);
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; align-items: center;
}
.article-share { display: flex; gap: 0.5rem; }
.article-share a {
    width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    background: var(--surface); border: 1px solid var(--border); transition: 0.3s;
}
.article-share a:hover { background: var(--primary); border-color: var(--primary); }
.article-share a:hover svg { color: #fff; }
.article-share a svg { width: 18px; height: 18px; color: var(--text); transition: color 0.3s; }

/* Related Posts */
.related-posts { max-width: var(--max-width); margin: 4rem auto; padding: 0 1.5rem; }
.related-posts h2 { font-size: 1.5rem; font-weight: 800; margin-bottom: 1.5rem; text-align: center; }

/* Search Results */
.search-results { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem 3rem; }
.search-results h1 { font-size: 1.8rem; margin-bottom: 1rem; }
.search-results .search-meta { color: var(--muted); margin-bottom: 2rem; }
.search-results-empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.search-results-empty svg { width: 60px; height: 60px; color: var(--border); margin-bottom: 1rem; }

/* ===== Footer & Sticky Bar ===== */
footer { border-top: 1px solid var(--border); margin-top: 5rem; padding: 3rem 1.5rem 2rem; text-align: center; color: var(--muted); font-size: 0.9rem; }
.foot-logo { display: flex; justify-content: center; align-items: center; gap: 8px; font-size: 0.8rem; font-weight: 800; color: var(--text); margin-bottom: 1rem; }
.foot-logo svg { width: 18px; height: 18px; fill: var(--primary); animation: heart-beat 1.5s ease-in-out infinite; }
footer a.dev-link { color: var(--primary); font-weight: 700; }
.footer-links a { color: var(--muted); font-size: 0.85rem; transition: color 0.3s; }
.footer-links a:hover { color: var(--primary); }

.mobile-sticky-bar {
    position: fixed; bottom: 0; left: 0; right: 0; background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px); padding: 0.8rem 1rem; box-shadow: 0 -5px 20px rgba(0,0,0,0.1);
    z-index: 999; display: none;
}
.mobile-sticky-bar .btn { width: 100%; justify-content: center; }

/* Alerts */
.alert { padding: 1rem 1.5rem; border-radius: 12px; margin-bottom: 1rem; font-size: 0.9rem; }
.alert-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.alert-warning { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }

/* Empty State */
.empty-state { text-align: center; padding: 4rem 1rem; color: var(--muted); }
.empty-state svg { width: 80px; height: 80px; color: var(--border); margin-bottom: 1rem; }

/* ===== Admin Panel (نسخه بهبود یافته) ===== */
.admin-layout {
    min-height: 100vh;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    display: flex;
    flex-direction: column;
}

.admin-header {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #fff;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky; top: 0; z-index: 100;
    box-shadow: 0 4px 20px -10px rgba(0,0,0,0.3);
}
.admin-header .logo { font-size: 1.1rem; color: #fff; }
.admin-header .logo svg { fill: #f43f5e; }
.admin-header nav { display: flex; gap: 1.2rem; align-items: center; }
.admin-header nav a { color: #cbd5e1; font-size: 0.85rem; font-weight: 600; transition: color 0.2s; }
.admin-header nav a:hover { color: #fff; }
.admin-header .user-info {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.4rem 0.9rem; background: rgba(255,255,255,0.1);
    border-radius: 50px; font-size: 0.85rem;
}

.admin-subnav {
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: 0; box-shadow: 0 2px 8px -4px rgba(0,0,0,0.05);
}
.admin-subnav-inner {
    max-width: 1400px; margin: 0 auto; padding: 0 1.5rem;
    display: flex; gap: 0.3rem; flex-wrap: wrap;
}
.admin-subnav a {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.9rem 1.2rem; color: var(--muted); font-size: 0.88rem;
    font-weight: 600; border-bottom: 3px solid transparent;
    transition: all 0.2s;
}
.admin-subnav a:hover { color: var(--text); background: var(--bg); }
.admin-subnav a.active { color: var(--primary); border-bottom-color: var(--primary); }
.admin-subnav a svg { width: 16px; height: 16px; }

.admin-container {
    max-width: 1400px; margin: 2rem auto; padding: 0 1.5rem;
    width: 100%; flex: 1;
}

.admin-page-title {
    font-size: 1.6rem; font-weight: 800; margin-bottom: 1.5rem;
    color: var(--text); display: flex; align-items: center; gap: 0.8rem;
}
.admin-page-title svg { width: 28px; height: 28px; color: var(--primary); }

.admin-card {
    background: var(--surface); border-radius: 16px; padding: 1.8rem;
    box-shadow: 0 4px 24px -8px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    margin-bottom: 1.5rem; border: 1px solid rgba(226, 232, 240, 0.7);
    transition: box-shadow 0.3s;
}
.admin-card:hover { box-shadow: 0 8px 32px -8px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.04); }
.admin-card h2 { font-size: 1.05rem; font-weight: 700; margin-bottom: 1.2rem; color: var(--text); display: flex; align-items: center; gap: 0.5rem; }
.admin-card h2 svg { width: 20px; height: 20px; color: var(--primary); }

/* Stat Cards */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.2rem; margin-bottom: 2rem; }
.stat-card {
    background: var(--surface); border-radius: 16px; padding: 1.5rem;
    border: 1px solid var(--border); position: relative; overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 12px 24px -8px rgba(0,0,0,0.1); }
.stat-card::before {
    content: ''; position: absolute; top: 0; right: 0; width: 4px; height: 100%;
    background: var(--primary);
}
.stat-card .stat-icon {
    position: absolute; top: 1.2rem; left: 1.2rem; width: 44px; height: 44px;
    border-radius: 12px; display: flex; align-items: center; justify-content: center;
}
.stat-card .stat-icon svg { width: 22px; height: 22px; }
.stat-card .stat-value { font-size: 2.2rem; font-weight: 800; color: var(--text); margin-bottom: 0.3rem; margin-top: 1rem; }
.stat-card .stat-label { color: var(--muted); font-size: 0.88rem; font-weight: 500; }

/* Table */
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: 1rem 1.2rem; text-align: right; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.admin-table th { color: var(--muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px; background: var(--bg); }
.admin-table tbody tr { transition: background 0.2s; }
.admin-table tbody tr:hover { background: var(--bg); }
.badge { display: inline-block; padding: 0.25rem 0.7rem; border-radius: 50px; font-size: 0.72rem; font-weight: 700; }
.badge-published { background: #dcfce7; color: #16a34a; }
.badge-draft { background: #fef3c7; color: #d97706; }
.badge-featured { background: #fef3c7; color: #b45309; margin-right: 0.4rem; }

/* Forms */
.admin-form .form-group { margin-bottom: 1.2rem; }
.admin-form label { display: block; font-weight: 600; margin-bottom: 0.5rem; color: var(--text); font-size: 0.9rem; }
.admin-form label .req { color: var(--primary); margin-right: 0.2rem; }
.admin-form input[type="text"], .admin-form input[type="email"], .admin-form input[type="password"], .admin-form input[type="number"], .admin-form input[type="url"], .admin-form textarea, .admin-form select {
    width: 100%; padding: 0.75rem 1rem; border: 1px solid var(--border); border-radius: 10px; font-family: inherit; font-size: 0.95rem; transition: all 0.2s;
    background: var(--surface);
}
.admin-form input:focus, .admin-form textarea:focus, .admin-form select:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(190, 18, 60, 0.1);
}
.admin-form input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; vertical-align: middle; }
.admin-form .form-help { font-size: 0.8rem; color: var(--muted); margin-top: 0.4rem; line-height: 1.5; }
.admin-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.admin-form .form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.admin-actions { display: flex; gap: 0.8rem; margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--border); }

/* Admin buttons variants */
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg); }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-success { background: #16a34a; color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.78rem; }

/* Admin quick actions */
.quick-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.quick-action {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.7rem 1.1rem; background: var(--surface); border: 1px solid var(--border);
    border-radius: 10px; color: var(--text); font-weight: 600; font-size: 0.85rem;
    transition: all 0.2s; cursor: pointer;
}
.quick-action:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary); transform: translateY(-2px); }
.quick-action svg { width: 16px; height: 16px; }

/* Login Page */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem; background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #4c1d95 100%); position: relative; overflow: hidden; }
.login-wrap::before {
    content: ''; position: absolute; inset: 0; z-index: 0;
    background: radial-gradient(circle at 20% 30%, rgba(190, 18, 60, 0.3), transparent 50%),
                radial-gradient(circle at 80% 70%, rgba(67, 56, 202, 0.3), transparent 50%);
}
.login-card {
    background: rgba(255,255,255,0.98); backdrop-filter: blur(20px);
    border-radius: 24px; padding: 2.5rem; max-width: 420px; width: 100%;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5), 0 1px 0 rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.2);
    position: relative; z-index: 1;
}
.login-card h1 { font-size: 1.4rem; font-weight: 800; text-align: center; margin-bottom: 0.5rem; color: var(--text); }
.login-card .login-subtitle { text-align: center; color: var(--muted); font-size: 0.88rem; margin-bottom: 2rem; }
.login-logo { display: flex; justify-content: center; margin-bottom: 1.5rem; }
.login-logo svg { width: 64px; height: 64px; fill: var(--primary); animation: heart-beat 1.5s ease-in-out infinite; filter: drop-shadow(0 4px 12px rgba(190,18,60,0.4)); }
.login-captcha { background: var(--bg); padding: 0.8rem; border-radius: 8px; margin-bottom: 1rem; font-size: 0.85rem; color: var(--muted); }

/* 2FA Setup */
.qr-display { text-align: center; margin: 1rem 0; }
.qr-display img { border: 8px solid var(--surface); border-radius: 12px; box-shadow: var(--shadow-sm); }
.secret-display {
    background: var(--bg); padding: 1rem; border-radius: 8px; text-align: center;
    font-family: 'Courier New', monospace; font-size: 1rem; word-break: break-all;
    border: 2px dashed var(--border); margin: 1rem 0;
}

/* Toast notifications */
.toast-container { position: fixed; top: 1.5rem; right: 1.5rem; z-index: 9999; display: flex; flex-direction: column; gap: 0.5rem; }
.toast {
    background: var(--surface); padding: 1rem 1.5rem; border-radius: 10px;
    box-shadow: 0 8px 24px -4px rgba(0,0,0,0.15); border-right: 4px solid var(--primary);
    font-size: 0.9rem; animation: slideIn 0.3s ease; min-width: 280px; max-width: 380px;
}
.toast.success { border-right-color: #16a34a; }
.toast.error { border-right-color: #dc2626; }
.toast.warning { border-right-color: #f59e0b; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Admin filter bar */
.admin-filter-bar {
    display: flex; gap: 0.5rem; margin-bottom: 1.5rem; flex-wrap: wrap;
    background: var(--surface); padding: 0.7rem; border-radius: 12px; border: 1px solid var(--border);
}
.admin-filter-bar a, .admin-filter-bar button {
    padding: 0.5rem 1rem; background: transparent; border: none; border-radius: 8px;
    font-family: inherit; font-size: 0.85rem; font-weight: 600; color: var(--muted);
    cursor: pointer; transition: 0.2s;
}
.admin-filter-bar a:hover, .admin-filter-bar button:hover { background: var(--bg); color: var(--text); }
.admin-filter-bar a.active, .admin-filter-bar button.active { background: var(--primary); color: #fff; }

/* Empty State in admin */
.admin-empty {
    text-align: center; padding: 3rem 1rem; color: var(--muted);
}
.admin-empty svg { width: 64px; height: 64px; color: var(--border); margin-bottom: 1rem; }

/* Responsive */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .mobile-menu-btn { display: block; }
    .blog-hero h1 { font-size: 2rem; }
    .featured-post { grid-template-columns: 1fr; }
    .featured-img { min-height: 200px; }
    .featured-content { padding: 1.5rem; }
    .featured-content h2 { font-size: 1.4rem; }
    /* sticky bar فقط در صفحه اصلی و دسته‌بندی؛ در article page مخفی */
    body:not(.is-article-page) .mobile-sticky-bar { display: block; }
    body:not(.is-article-page) { padding-bottom: 70px; }
    .article-page { padding: 0 1rem; }
    .article-hero h1 { font-size: 1.7rem; }
    .article-featured-img { height: 220px; }
    .admin-form .form-row { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr; }
    .article-footer { flex-direction: column; align-items: flex-start; }
}
