:root {
    --primary: #0b2b83;       
    --primary-hover: #081d5a;
    --primary-light: #eef2ff; 
    --secondary: #195cfb;     
    --accent: #3b82f6;        
    --bg-body: #f8fafc;       
    --bg-card: #ffffff;
    --font-main: 'Noto', 'Vazirmatn', sans-serif;
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;
    --shadow-sm: 0 2px 4px rgba(11, 43, 131, 0.05);
    --shadow-md: 0 8px 16px -4px rgba(11, 43, 131, 0.1);
    --shadow-hover: 0 20px 40px -12px rgba(25, 92, 251, 0.2);
}

/* --- رفع مشکل آیکون‌ها در حالت فارسی --- */
.fa-body .fas, .fa-body .far, .fa-body .fab, .fa-body .fa-solid {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands" !important;
    direction: ltr !important;
    display: inline-block !important;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-main); background-color: var(--bg-body); color: var(--primary); line-height: 1.6; min-height: 100vh; }

/* نگهدارنده اصلی برای چسباندن فوتر به پایین صفحه */
.main-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; width: 100%; }

/* محتوای وسط که باید کش بیاید تا فوتر پایین برود */
.content-container { 
    flex: 1; 
    padding-bottom: 60px; 
}

/* Header */
.modern-header { background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(12px); border-bottom: 1px solid rgba(226, 232, 240, 0.8); position: sticky; top: 0; z-index: 100; padding: 16px 0; }
.header-container { display: flex; justify-content: space-between; align-items: center; }
.logo-section { display: flex; align-items: center; gap: 16px; }
.logo-circle { width: 56px; height: 56px; background: var(--primary-light); border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; border: 1px solid #c7d2fe; overflow: hidden; }
.logo-circle a { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.logo-img { width: 36px; height: auto; object-fit: contain; }
.header-titles h1 { font-size: 1.25rem; font-weight: 800; color: var(--primary); margin-bottom: 2px; }
.subtitle { font-size: 0.85rem; color: #64748b; font-weight: 400; }

/* Language Switcher */
.language-switcher { background: #f1f5f9; padding: 4px; border-radius: 100px; display: flex; gap: 4px; }
.lang-btn { border: none; background: transparent; padding: 6px 12px; border-radius: 100px; font-size: 0.8rem; font-weight: 600; color: #64748b; cursor: pointer; transition: 0.3s; }
.lang-btn:hover { color: var(--primary); }
.lang-btn.active { background: white; color: var(--secondary); box-shadow: 0 2px 4px rgba(0,0,0,0.05); border: 1px solid #e2e8f0; }

/* Search Box */
.search-section { margin: 40px 0; }
.search-box { background: white; border-radius: var(--radius-lg); padding: 8px; box-shadow: var(--shadow-md); display: flex; flex-wrap: wrap; gap: 10px; border: 1px solid #e2e8f0; }
.input-wrapper { flex: 2; display: flex; align-items: center; padding: 0 16px; min-width: 200px; position: relative; }
.search-icon { color: #94a3b8; margin-left: 12px; }
.search-box input { width: 100%; border: none; font-size: 1rem; padding: 12px 0; outline: none; color: var(--primary); background: transparent; }
.select-wrapper { flex: 1; position: relative; min-width: 180px; }
.select-wrapper select { width: 100%; appearance: none; background: #f8fafc; border: 1px solid #e2e8f0; padding: 12px 16px; padding-left: 40px; border-radius: var(--radius-md); font-family: inherit; color: #475569; cursor: pointer; outline: none; margin: 5px;}
.chevron-icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: #94a3b8; pointer-events: none; }
[dir="rtl"] .select-wrapper { border-left: none; border-right: 1px solid #e2e8f0; }

/* Cards Grid */
.forms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }
.form-card { background: white; border-radius: var(--radius-lg); padding: 28px; text-decoration: none; display: flex; flex-direction: column; border: 1px solid #e2e8f0; box-shadow: var(--shadow-sm); transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1); position: relative; }
.form-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-hover); border-color: var(--secondary); }

/* Card Icon */
.card-icon-wrapper { 
    width: 60px; height: 60px; 
    border-radius: 14px; 
    display: flex; align-items: center; justify-content: center; 
    transition: 0.3s;
    font-size: 24px;
}
.form-card:hover .card-icon-wrapper { transform: scale(1.1) rotate(5deg); background-color: var(--secondary) !important; color: white !important; }

/* Badge / Tags Styling */
.category-badge {
    background-color: var(--primary-light) !important;
    color: var(--secondary) !important;
    border: 1px solid #c7d2fe;
    padding: 6px 14px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 800;
    border-radius: 99px;
    display: inline-flex;
    align-items: center;
}

.card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; width: 100%; }
.card-title { font-size: 1.25rem; font-weight: 800; color: #1e293b; margin-bottom: 10px; line-height: 1.4; }
.card-desc { font-size: 0.9rem; color: #64748b; margin-bottom: 24px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Card Footer */
.card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; border-top: 1px solid #f1f5f9; padding-top: 16px; }
.cta-text { font-size: 0.85rem; font-weight: 700; color: var(--primary); transition: 0.3s; }
.cta-icon { width: 36px; height: 36px; border-radius: 50%; background: var(--primary-light); display: flex; align-items: center; justify-content: center; color: var(--secondary); transition: 0.3s; }
.form-card:hover .cta-text { color: var(--secondary); }
.form-card:hover .cta-icon { background: var(--secondary); color: white; transform: translateX(-4px); }

/* Pagination */
.pagination-container { display: flex; justify-content: center; gap: 8px; margin-top: 40px; padding-top: 20px; }
.page-btn { min-width: 40px; height: 40px; border-radius: var(--radius-sm); background: white; border: 1px solid #e2e8f0; color: #64748b; font-weight: 600; cursor: pointer; transition: 0.3s; display: flex; align-items: center; justify-content: center; }
.page-btn:hover:not(:disabled) { border-color: var(--secondary); color: var(--secondary); background: #fefce8; transform: translateY(-2px); }
.page-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
.page-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Empty State */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    background: white;
    border-radius: var(--radius-lg);
    border: 2px dashed #cbd5e1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
}
.no-results i { font-size: 3.5rem; color: #94a3b8; }
.no-results h3 { font-size: 1.5rem; color: var(--primary); font-weight: 800; }
.no-results p { color: #64748b; }

/* Footer */
.main-footer { text-align: center; padding: 30px 0; color: #94a3b8; font-size: 0.85rem; border-top: 1px solid #e2e8f0; background: white; }

@media (max-width: 768px) {
    .search-box { flex-direction: column; padding: 15px; }
    .select-wrapper { width: 100%; border: none; border-top: 1px solid #e2e8f0; }
    .header-container { flex-direction: column; gap: 20px; }
    [dir="rtl"] .select-wrapper { border-right: none; }
}