/* ==========================================================================
   TLE Frontend Styles - v8.0 (Modern SaaS Design - High Contrast)
   ========================================================================== */

/* --- 1. کانتینر اصلی (زنده کردن بدنه) --- */
.tle-wrapper-final {
    font-family: 'IRANSans', 'Tahoma', "B Nazanin", sans-serif !important; /* اصلاح فونت */
    direction: rtl;
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    max-width: 900px;
    margin: 40px auto;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.08); /* سایه نرم‌تر */
    line-height: 1.8;
    position: relative;
}

/* نوار رنگی بالای باکس (برای جذابیت بصری) */
.tle-wrapper-final::before {
    content: '';
    position: absolute;
    top: 0; right: 0; left: 0;
    height: 6px;
    background: linear-gradient(90deg, #3b82f6 0%, #8b5cf6 50%, #ec4899 100%);
    z-index: 10;
}

/* --- 2. تب‌بندی (استایل مدرن) --- */
.tle-tabs-head {
    display: flex;
    background: #f8fafc; /* رنگ زمینه تب‌ها */
    padding: 15px 20px 0 20px;
    border-bottom: 2px solid #e2e8f0;
    gap: 10px;
}
.tle-tab-item {
    flex: 1;
    text-align: center;
    padding: 18px 10px;
    cursor: pointer;
    font-weight: 700;
    color: #64748b;
    transition: all 0.3s ease;
    border-radius: 12px 12px 0 0;
    font-size: 15px;
    border: 1px solid transparent;
    border-bottom: none;
    position: relative;
    top: 2px; /* برای چسبیدن به پایین */
}
.tle-tab-item:hover {
    color: #334155;
    background: rgba(255,255,255,0.5);
}
.tle-tab-item.active {
    background: #ffffff;
    color: #2563eb; /* آبی اصلی */
    border-color: #e2e8f0;
    border-bottom-color: #ffffff; /* اتصال نامرئی به بدنه */
    box-shadow: 0 -4px 6px -1px rgba(0,0,0,0.02);
}
.tle-tab-item .dashicons {
    font-size: 20px;
    vertical-align: sub;
    margin-left: 5px;
}

/* --- 3. بدنه فرم --- */
.tle-content-body {
    padding: 40px;
    background: #ffffff;
    min-height: 350px;
}

/* کارت‌های داخلی (Grouping) */
.tle-card {
    border: 2px solid #f1f5f9; /* بوردر ضخیم‌تر اما کمرنگ */
    border-radius: 16px;
    margin-bottom: 30px;
    transition: all 0.3s ease;
    background: #fff;
}
.tle-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.tle-card-header {
    background: #f8fafc; /* هدر خیلی روشن */
    padding: 18px 25px;
    font-weight: 800;
    color: #1e293b; /* متن تیره */
    border-bottom: 2px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    border-radius: 14px 14px 0 0;
}
.tle-card-header .dashicons {
    color: #3b82f6;
    font-size: 22px;
    background: #eff6ff;
    padding: 5px;
    border-radius: 8px;
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
}

.tle-card-body { padding: 30px; }

/* --- فیلدها و ورودی‌ها (بخش حیاتی زیبایی) --- */
.tle-form-group { margin-bottom: 25px; position: relative; }
.tle-form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 700;
    color: #334155;
    font-size: 14px;
}

select, input[type="text"] {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e2e8f0; /* بوردر پیش‌فرض */
    border-radius: 12px;
    font-family: inherit;
    font-size: 15px;
    background-color: #f8fafc; /* پس‌زمینه کمی طوسی */
    color: #0f172a;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.01);
}

/* حالت فوکوس فیلدها */
select:focus, input:focus {
    background-color: #fff;
    border-color: #3b82f6;
    outline: none;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15); /* هاله آبی */
}
select:hover, input:hover {
    border-color: #cbd5e1;
}

/* گرید */
.tle-grid-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
@media(max-width: 768px) { .tle-grid-2col { grid-template-columns: 1fr; gap: 15px; } }

/* --- دکمه‌ها --- */
.tle-btn-submit {
    width: 100%;
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    color: #fff;
    border: none;
    padding: 18px;
    font-size: 16px;
    font-weight: 800;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 10px;
}
.tle-btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(37, 99, 235, 0.5);
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

.tle-btn-reset {
    display: inline-block;
    text-align: center;
    margin-top: 20px;
    color: #64748b;
    text-decoration: none;
    font-size: 13px;
    border: 1px dashed #cbd5e1;
    padding: 12px;
    border-radius: 10px;
    width: 100%;
    transition: all 0.2s;
}
.tle-btn-reset:hover {
    color: #ef4444;
    border-color: #ef4444;
    background: #fef2f2;
}

/* --- دکمه پاک‌سازی فرم (نارنجی گرد) --- */
.tle-btn-clear-global {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 30px auto 10px auto;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%); /* گرادینت نارنجی */
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 14px 45px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.tle-btn-clear-global:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(249, 115, 22, 0.4);
}
.tle-btn-clear-global .dashicons { margin-left: 8px; font-size: 20px; }


/* --- نمایش نتایج (کارت‌های رنگی) --- */
.tle-section-divider {
    background: #1e293b; /* خیلی تیره برای کنتراست */
    color: #fff;
    padding: 12px 20px;
    font-weight: 800;
    border-radius: 10px;
    margin: 40px 0 20px 0;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}
.tle-section-divider .dashicons { color: #38bdf8; }

.tle-res-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-right-width: 6px;
    border-radius: 14px;
    margin-bottom: 20px;
    transition: all 0.3s;
    overflow: hidden;
    position: relative;
}
.tle-res-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.1);
}

.tle-card-main { padding: 25px; cursor: pointer; }
.tle-res-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 8px; /* کمی فاصله پایین هدر */
    border-bottom: 1px solid #f0f0f1; /* خط جداکننده محو */
    margin-bottom: 10px;
}

.tle-res-title {
    font-family: 'IRANSans', 'Tahoma', sans-serif !important;
    font-weight: 800;       /* ضخامت کمتر (قبلا 900 بود) */
    font-size: 16px;        /* سایز استاندارد (قبلا 18 بود) */
    color: #000000;         /* مشکی خالص */
    line-height: 1.5;       /* ارتفاع خط نرمال */
    display: flex;
    align-items: center;
    gap: 10px;
}

/* آیکون پرینتر (بزرگ و سمت چپ) */
.tle-print-btn {
    font-size: 26px !important;
    color: #94a3b8;
    background: #f1f5f9;
    width: 45px; height: 45px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
    margin-right: auto; /* هل دادن به چپ */
    margin-left: 0;
}
.tle-print-btn:hover {
    background: #1e293b;
    color: #fff;
    transform: scale(1.1);
}

.tle-detail-pane {
    background-color: #ffffff;  /* زمینه سفید برای تمیزی */
    padding: 20px 25px;         /* فضای داخلی جمع‌وجورتر */
    border-top: 1px solid #e2e8f0;
    line-height: 2.1;           /* فاصله خطوط استاندارد کتابی (قبلا 2.8 بود) */
    color: #000000;             /* مشکی خالص و پررنگ */
    text-align: justify !important; 
    font-size: 14px;            /* فونت ریزتر و رسمی */
    margin-top: 10px;
}

/* --- بج‌ها و رنگ‌بندی اختصاصی --- */
.tle-badge {
    padding: 4px 12px;
    border-radius: 30px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* رنگ‌های زنده */
.tle-type-article { border-right-color: #3b82f6 !important; }
.tle-type-article .tle-badge { background: #eff6ff; color: #1d4ed8; }

.tle-type-note { border-right-color: #8b5cf6 !important; }
.tle-type-note .tle-badge { background: #f5f3ff; color: #7c3aed; }

.tle-type-circular { border-right-color: #06b6d4 !important; } /* فیروزه‌ای */
.tle-type-circular .tle-badge { background: #ecfeff; color: #0e7490; }

.tle-type-instruction { border-right-color: #10b981 !important; } /* سبز */
.tle-type-instruction .tle-badge { background: #ecfdf5; color: #047857; }

.tle-type-bylaw { border-right-color: #f59e0b !important; } /* زرد تیره */
.tle-type-bylaw .tle-badge { background: #fffbeb; color: #b45309; }

.tle-type-decree { border-right-color: #ec4899 !important; } /* صورتی */
.tle-type-decree .tle-badge { background: #fdf2f8; color: #be185d; }

.tle-type-court_ruling { border-right-color: #ef4444 !important; } /* قرمز */
.tle-type-court_ruling .tle-badge { background: #fef2f2; color: #b91c1c; }

.tle-type-leadership_order { border-right-color: #d97706 !important; } /* طلایی */
.tle-type-leadership_order .tle-badge { background: #fff7ed; color: #c2410c; }

/* ==========================================================================
   PATCH v8.1: اصلاح چیدمان کارت‌های نتیجه (تفکیک تیتر و متادیتا)
   تاریخ اعمال: طبق درخواست مدیریت فنی جهت بهبود UX و خوانایی
   ========================================================================== */

/* 1. تنظیم رفتار فلکس برای هدر کارت */
.tle-res-header {
    flex-wrap: wrap; /* اجازه شکستن خط در موبایل */
    gap: 10px; /* فاصله ایمنی بین آیتم‌ها */
}

/* 2. تیتر اصلی فضای خالی را پر می‌کند تا بقیه به چپ رانده شوند */
.tle-res-title {
    flex-grow: 1; /* اشغال تمام فضای ممکن */
    width: auto; /* ریست کردن عرض */
    margin-left: 15px; /* فاصله از متادیتا */
}

/* 3. استایل‌دهی کانتینر متادیتا (شماره و تاریخ) */
/* نکته: این کلاس در PHP وجود داشت اما در CSS تعریف نشده بود */
.tle-meta-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px; /* فاصله بین شماره و تاریخ */
    background-color: #f8fafc; /* پس‌زمینه محو طوسی */
    border: 1px solid #e2e8f0; /* کادر ظریف */
    padding: 6px 15px;
    border-radius: 8px;
    font-size: 0.85rem; /* کمی کوچک‌تر از تیتر */
    color: #475569;
    white-space: nowrap; /* جلوگیری از شکستن تاریخ در دو خط */
    height: 40px; /* هم‌ارتفاع با دکمه پرینت */
    box-sizing: border-box;
}

/* 4. اصلاح دکمه پرینت برای قرارگیری منظم کنار متادیتا */
/* ما باید margin-right: auto قبلی را خنثی کنیم تا به متادیتا بچسبد */
.tle-print-btn {
    margin-right: 0 !important; 
    margin-left: 0 !important;
    width: 40px !important; /* فیکس کردن سایز */
    height: 40px !important;
    border-radius: 8px !important; /* گوشه‌های کمی گردتر */
    background-color: #f1f5f9;
    font-size: 20px !important;
}

/* 5. ریسپانسیو برای موبایل (زیر 600 پیکسل) */
@media only screen and (max-width: 600px) {
    .tle-res-header {
        align-items: flex-start; /* تراز از بالا */
    }
    
    .tle-res-title {
        width: 100%; /* تیتر کل خط اول را بگیرد */
        margin-left: 0;
        margin-bottom: 5px;
        padding-bottom: 10px;
        border-bottom: 1px dashed #e2e8f0; /* خط جداکننده در موبایل */
    }
    
    .tle-meta-info {
        flex-grow: 1; /* در خط دوم، متادیتا فضا را پر کند */
        justify-content: space-between; /* پخش کردن شماره و تاریخ */
        font-size: 0.8rem;
    }
}

/* ==========================================================================
   PATCH v9.0: استایل انتخابگر شبکه‌ای مواد (Grid Pagination)
   توضیحات: جایگزین دراپ‌داون برای لیست‌های طولانی (بالای 20 مورد)
   ========================================================================== */

/* 1. کانتینر اصلی لیست شبکه‌ای */
#tle-article-grid-container {
    margin-top: 15px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 15px;
    background: #f8fafc;
    display: none; /* پیش‌فرض مخفی است */
}

/* 2. گرید کارت‌ها */
.tle-grid-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); /* رسپانسیو */
    gap: 12px;
    margin-bottom: 20px;
}

/* 3. استایل هر کارت ماده */
.tle-article-card {
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: right;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.tle-article-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.1);
    transform: translateY(-2px);
}

/* حالت انتخاب شده */
.tle-article-card.selected {
    background: #eff6ff; /* آبی خیلی روشن */
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

/* تایپوگرافی داخل کارت */
.tle-card-num {
    font-weight: 800;
    font-size: 14px;
    color: #1e293b;
    display: block;
}

.tle-card-desc {
    font-size: 11px;
    color: #64748b;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* محدودیت به 2 خط */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 4. نوار صفحه‌بندی (Pagination) */
.tle-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
    padding-top: 10px;
    border-top: 1px dashed #cbd5e1;
}

/* دکمه‌های شماره صفحه */
.tle-page-btn {
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #475569;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.tle-page-btn:hover:not(:disabled) {
    border-color: #94a3b8;
    background: #f1f5f9;
}

/* دکمه صفحه فعال */
.tle-page-btn.active {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

/* دکمه‌های قبلی/بعدی */
.tle-page-nav {
    padding: 0 12px;
    font-weight: 700;
    font-size: 12px;
}
.tle-page-nav:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f1f5f9;
}
/* ==========================================================================
   PATCH v9.1: استایل یکی در میان کارت‌ها (Zebra Striping)
   ========================================================================== */
/* کارت‌های زوج، پس‌زمینه کمی تیره‌تر (طوسی خیلی محو) می‌گیرند */
.tle-article-card:nth-child(even) {
    background-color: #f8fafc; /* طوسی خیلی روشن */
}

/* کارت‌های فرد، سفید می‌مانند */
.tle-article-card:nth-child(odd) {
    background-color: #ffffff;
}

/* اطمینان از اینکه در حالت انتخاب یا هاور، رنگ درست دیده شود */
.tle-article-card:hover,
.tle-article-card.selected {
    background-color: #eff6ff !important; /* آبی خیلی روشن در اولویت */
}

/* ==========================================================================
   PATCH v9.5: استایل‌های ساختار جدید (Master-Detail Layout)
   ========================================================================== */

/* 1. کانتینر اصلی دو ستونه */
.tle-layout-container {
    display: flex;
    gap: 25px;
    align-items: flex-start; /* برای اینکه سایدبار بالا بماند */
    margin-top: 30px;
    position: relative;
}

/* 2. سایدبار (منوی سمت راست) */
.tle-sidebar {
    width: 260px;
    flex-shrink: 0; /* جلوگیری از جمع شدن */
    position: sticky; /* چسبان شدن */
    top: 20px;      /* فاصله از بالای صفحه هنگام اسکرول */
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 10px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    z-index: 99; /* بالاتر از بقیه عناصر */
}

/* لیست منو */
.tle-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* آیتم‌های منو */
.tle-nav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
    background: #f8fafc;
}

/* متن و تعداد */
.tle-nav-label {
    font-weight: 700;
    font-size: 13px;
    color: #475569;
}
.tle-nav-count {
    background: rgba(0,0,0,0.06);
    color: #64748b;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 800;
}

/* نوار رنگی نشانگر (سمت راست آیتم) */
.tle-nav-indicator {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #cbd5e1; /* رنگ پیش‌فرض */
    opacity: 0;
    transition: opacity 0.2s;
}

/* 3. حالات هاور و اکتیو */
.tle-nav-item:hover:not(.tle-nav-disabled) {
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transform: translateX(-3px); /* حرکت جزئی به چپ */
}

.tle-nav-item.active {
    background: #fff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-color: #e2e8f0;
    transform: translateX(-5px);
}
.tle-nav-item.active .tle-nav-indicator {
    opacity: 1;
}

/* آیتم‌های غیرفعال (تعداد 0) */
.tle-nav-item.tle-nav-disabled {
    opacity: 0.5;
    cursor: default; /* نمایش موس معمولی */
    background: transparent;
    filter: grayscale(1);
}
.tle-nav-item.tle-nav-disabled:hover {
    background: transparent;
    transform: none;
}

/* 4. رنگ‌بندی اختصاصی برای هر دسته (زمانی که اکتیو یا هاور است) */

/* تبصره (بنفش) */
.tle-nav-type-note.active .tle-nav-indicator, 
.tle-nav-type-note:hover .tle-nav-indicator { background: #8b5cf6; }
.tle-nav-type-note.active .tle-nav-label { color: #7c3aed; }
.tle-nav-type-note.active .tle-nav-count { background: #f5f3ff; color: #7c3aed; }

/* بخشنامه (فیروزه‌ای) */
.tle-nav-type-circular.active .tle-nav-indicator,
.tle-nav-type-circular:hover .tle-nav-indicator { background: #06b6d4; }
.tle-nav-type-circular.active .tle-nav-label { color: #0891b2; }

/* دستورالعمل (سبز) */
.tle-nav-type-instruction.active .tle-nav-indicator,
.tle-nav-type-instruction:hover .tle-nav-indicator { background: #10b981; }
.tle-nav-type-instruction.active .tle-nav-label { color: #059669; }

/* آیین‌نامه (زرد/نارنجی) */
.tle-nav-type-bylaw.active .tle-nav-indicator,
.tle-nav-type-bylaw:hover .tle-nav-indicator { background: #f59e0b; }
.tle-nav-type-bylaw.active .tle-nav-label { color: #d97706; }

/* رای دیوان (قرمز) */
.tle-nav-type-court_ruling.active .tle-nav-indicator,
.tle-nav-type-court_ruling:hover .tle-nav-indicator { background: #ef4444; }
.tle-nav-type-court_ruling.active .tle-nav-label { color: #dc2626; }

/* سایر (خاکستری تیره) */
.tle-nav-type-other.active .tle-nav-indicator { background: #475569; }

/* 5. ناحیه محتوا (سمت چپ) */
.tle-content-area {
    flex-grow: 1; /* پر کردن فضای باقی‌مانده */
    min-width: 0; /* جلوگیری از بیرون زدگی در فلکس */
}

.tle-content-group {
    animation: tleFadeIn 0.3s ease-out;
}

@keyframes tleFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* هدر موبایل (فقط در موبایل دیده می‌شود) */
.tle-section-header-mobile {
    display: none; 
}

/* 6. ریسپانسیو (موبایل و تبلت) */
@media (max-width: 900px) {
    .tle-layout-container {
        flex-direction: column; /* ستون‌ها زیر هم */
        gap: 15px;
    }

    .tle-sidebar {
        width: 100%;
        position: relative; /* در موبایل چسبان نباشد بهتر است یا top:0 */
        top: 0;
        padding: 5px;
        overflow-x: auto; /* اسکرول افقی */
        border-bottom: 2px solid #e2e8f0;
        border-radius: 12px;
        background: #f1f5f9;
        box-shadow: none;
    }

    .tle-nav-list {
        flex-direction: row; /* چیدمان افقی */
        width: max-content; /* عرض بر اساس محتوا */
        gap: 10px;
        padding-bottom: 5px; /* فضا برای اسکرول بار */
    }

    .tle-nav-item {
        width: auto;
        padding: 8px 15px;
        background: #fff;
        border: 1px solid #cbd5e1;
        border-radius: 20px; /* گردتر در موبایل */
        white-space: nowrap; /* جلوگیری از شکستن متن */
    }

    .tle-nav-indicator {
        display: none; /* در موبایل نوار کنار لازم نیست */
    }

    /* حالت اکتیو در موبایل */
    .tle-nav-item.active {
        background: #3b82f6; /* آبی توپر */
        border-color: #3b82f6;
        color: #fff;
        transform: none;
    }
    .tle-nav-item.active .tle-nav-label { color: #fff !important; }
    .tle-nav-item.active .tle-nav-count { 
        background: rgba(255,255,255,0.2); 
        color: #fff !important; 
    }
}









/* ==========================================================================
   PATCH v10.0: مخفی‌سازی دکمه سابمیت (جهت جستجوی خودکار)
   ========================================================================== */
#tle-step-submit {
    display: none !important; /* مخفی کردن دکمه آبی بزرگ */
}




/* ==========================================================================
   PATCH v11.0: استایل دکمه مشاوره و مودال
   ========================================================================== */

/* 1. دکمه مشاوره (درون کارت) */
.tle-consult-wrapper {
    margin-top: 25px;
    text-align: left; /* دکمه سمت چپ */
    border-top: 1px dashed #e2e8f0;
    padding-top: 15px;
}

.tle-btn-consult {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%); /* گرادینت گرم (نارنجی) */
    color: #fff;
    border: none;
    padding: 10px 25px;
    font-size: 13px;
    font-weight: 800;
    border-radius: 50px; /* لبه‌های کاملا گرد */
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(234, 88, 12, 0.3); /* سایه گرم */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    font-family: inherit;
}

.tle-btn-consult:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(234, 88, 12, 0.4);
    color: #fff;
}

.tle-btn-consult .dashicons {
    margin-left: 8px;
    font-size: 18px;
}

/* 2. استایل مودال (Popup) */
.tle-modal {
    display: none; /* پیش‌فرض مخفی */
    position: fixed;
    z-index: 999999; /* بالاتر از همه چیز */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6); /* پس‌زمینه تاریک */
    backdrop-filter: blur(4px); /* بلور شدن پشت صفحه */
    animation: tleModalFadeIn 0.3s;
}

.tle-modal-content {
    background-color: #fefefe;
    margin: 8% auto; /* فاصله از بالا */
    padding: 0;
    border: 0;
    width: 90%;
    max-width: 480px; /* عرض مناسب */
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
    overflow: hidden;
    animation: tleModalSlideUp 0.4s;
}

/* هدر مودال */
.tle-modal-header {
    background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
    padding: 15px 20px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.tle-modal-header h3 {
    margin: 0;
    color: #fff;
    font-size: 16px;
    font-weight: 800;
}

/* دکمه بستن (ضربدر) */
.tle-close-modal {
    color: rgba(255,255,255,0.8);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
    transition: 0.2s;
}
.tle-close-modal:hover {
    color: #fff;
}

/* فرم داخل مودال */
#tle-consult-form {
    padding: 25px;
}

#tle-consult-form .tle-form-group {
    margin-bottom: 20px;
}
#tle-consult-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    font-size: 13px;
    color: #334155;
}
#tle-consult-form input, 
#tle-consult-form textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 13px;
    font-family: inherit;
    transition: 0.3s;
    background: #f8fafc;
}
#tle-consult-form input:focus,
#tle-consult-form textarea:focus {
    border-color: #f59e0b; /* رنگ فوکوس نارنجی */
    background: #fff;
    outline: none;
}

/* دکمه ارسال نهایی */
.tle-btn-submit-consult {
    width: 100%;
    background: #1e293b; /* دکمه تیره رسمی */
    color: #fff;
    padding: 15px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}
.tle-btn-submit-consult:hover {
    background: #0f172a;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* انیمیشن‌ها */
@keyframes tleModalFadeIn {
    from {opacity: 0;}
    to {opacity: 1;}
}
@keyframes tleModalSlideUp {
    from {transform: translateY(50px); opacity: 0;}
    to {transform: translateY(0); opacity: 1;}
}
/* ==========================================================================
   PATCH v9.7: اصلاح شکستگی متن هایلایت شده (متصل به پچ JS)
   ========================================================================== */
span.tle-smart-highlight {
    white-space: nowrap !important;
    display: inline-block !important;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

/* ==========================================================================
   PATCH v15.0: اصلاح قطعی تراز هایلایت با حذف مدل Flex
   توضیحات: بازگرداندن تیتر به حالت Block برای برقراری تراز طبیعی حروف
   ========================================================================== */

/* 1. خارج کردن تیتر از حالت Flex برای اصلاح جریان متن */
.tle-res-title {
    display: block !important; /* حذف Flexbox که عامل اصلی جابجایی بود */
    line-height: 1.6 !important; /* تنظیم فاصله خطوط متناسب با تیتر */
}

/* 2. تبدیل هایلایت به حالت کاملاً خطی (Inline) */
span.tle-smart-highlight {
    display: inline !important; /* حذف inline-block برای هماهنگی با Baseline */
    background-color: #fff59d !important;
    padding: 2px 0 !important; /* حذف پدینگ‌های افقی مزاحم */
    margin: 0 !important;
    border-radius: 2px;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

/* 3. اصلاح تراز بج (Badge) ابتدای خط */
.tle-res-title .tle-badge {
    display: inline-block !important;
    vertical-align: middle !important;
    margin-bottom: 4px; /* تنظیم فاصله بج با متن */
}


/* ==========================================================================
   PATCH v16.0: استایل باکس هشدار اعتبارسنجی تاریخ
   ========================================================================== */
.tle-date-error-hint {
    background-color: #fff5f5;
    border: 1px solid #feb2b2;
    color: #c53030;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    display: none; /* پیش‌فرض مخفی */
    font-size: 13px;
    font-weight: 700;
    line-height: 1.6;
    animation: tleShake 0.4s ease-in-out;
}
.tle-date-error-hint .dashicons {
    margin-left: 8px;
    vertical-align: middle;
}

@keyframes tleShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}




/* ==========================================================================
   PATCH v20.0: اصلاح چیدمان داخلی دکمه پاک‌سازی (Inline Icon & Text)
   توضیحات: قرارگیری آیکون و متن در یک سطر با تراز دقیق افقی
   ========================================================================== */

/* 1. کانتینر اصلی دکمه‌ها برای تراز لبه‌های بالایی */
.tle-actions-row {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: center !important;
    max-width: 650px !important;
    margin: 35px auto 0 auto !important;
    gap: 15px !important;
}

/* 2. هم‌سان‌سازی ارتفاع دکمه‌ها */
.tle-btn-submit, .tle-btn-reset {
    height: 54px !important; /* ارتفاع استاندارد و ظریف‌تر */
    margin: 0 !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* 3. اصلاح چیدمان داخلی دکمه پاک‌سازی (آیکون کنار متن) */
.tle-btn-reset {
    flex: 1 !important;
    background-color: #fffafa !important;
    border: 2px solid #f87171 !important;
    color: #b91c1c !important;
    border-radius: 12px !important;
    flex-direction: row !important; /* چیدمان در یک سطر */
    gap: 8px !important;            /* فاصله منطقی بین آیکون و متن */
    padding: 0 15px !important;
    transition: all 0.2s ease-in-out !important;
    text-decoration: none !important;
}

.tle-btn-reset:hover {
    background-color: #fecaca !important;
    border-color: #ef4444 !important;
}

/* اصلاح آیکون داخل دکمه */
.tle-btn-reset .dashicons {
    margin: 0 !important;
    font-size: 20px !important;
    width: 20px !important;
    height: 20px !important;
}

/* 4. تنظیم دکمه جستجو */
.tle-btn-submit {
    flex: 2.5 !important;
    padding: 0 20px !important;
}

/* 5. تنظیم نوشته راهنما دقیقا زیر دکمه پاک‌سازی */
.tle-actions-row div[style*="font-size: 11px"] {
    position: absolute !important;
    margin-top: 60px !important;
    color: #ef4444 !important;
    width: auto !important;
    text-align: center !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
}


/* ==========================================================================
   PATCH v22.0: حذف قطعی فضاهای زاید و فشرده‌سازی فرم (Ultra Compact)
   توضیحات: حذف خلاءهای بین کارتی و پدینگ‌های بی دلیل طبق تصاویر ارسالی
   ========================================================================== */

/* 1. حذف فاصله بی دلیل بین کارت‌ها (بخش‌های اصلی) */
.tle-card {
    margin-bottom: 8px !important; /* کاهش شدید برای چسباندن منطقی بخش‌ها */
    box-shadow: 0 2px 4px rgba(0,0,0,0.02) !important; /* ظریف‌تر کردن سایه */
}

/* 2. فشرده‌سازی محتوای داخلی هر بخش */
.tle-card-body {
    padding: 12px 20px !important; /* کاهش فضای خالی دور فیلدها */
}

/* 3. حذف مارجین زیرین فیلدها (استفاده از فاصله گرید) */
.tle-form-group {
    margin-bottom: 0px !important; 
}

/* 4. کاهش ارتفاع هدرها */
.tle-card-header {
    padding: 8px 20px !important;
    font-size: 13px !important;
}

/* 5. ظریف‌تر کردن فیلدهای ورودی برای کاهش ارتفاع کل فرم */
select, input[type="text"] {
    padding: 10px 15px !important; /* کاهش ارتفاع داخلی فیلدها */
    font-size: 14px !important;
}

/* 6. کاهش فاصله بین دو ستون در گرید */
.tle-grid-2col {
    gap: 15px 25px !important;
}

/* 7. اصلاح پدینگ کانتینر اصلی */
.tle-content-body {
    padding: 15px 25px !important;
}



/* ==========================================================================
   PATCH v25.0: استایل دکمه میان‌بر موضوعات پرکاربرد
   ========================================================================== */
.tle-btn-special-shortcut {
    background: #fff9db !important;
    color: #b45309 !important;
    border: 2px solid #fde68a !important;
    padding: 8px 20px !important;
    border-radius: 8px !important;
    cursor: pointer;
    font-size: 13px !important;
    font-weight: 800 !important;
    transition: all 0.2s ease-in-out !important;
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
}
.tle-btn-special-shortcut:hover {
    background: #fef3c7 !important;
    border-color: #f59e0b !important;
    transform: translateY(-2px);
}
.tle-btn-special-shortcut .dashicons {
    color: #f59e0b !important;
}
/* [ADDITION START - V26.0] آیکون قوانین پرکاربرد - رعایت قانون X+y */
.tle-popular-badge-icon {
    float: left; 
    color: #f59e0b !important; 
    font-size: 19px !important;
    width: 20px !important;
    height: 20px !important;
    margin-left: 5px; 
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: #fff9db; 
    border-radius: 50%;
    padding: 3px;
    box-shadow: 0 2px 5px rgba(245, 158, 11, 0.2);
    animation: tleAwardBounce 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes tleAwardBounce {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}
/* [ADDITION END] */

/* [ADDITION START - V28.0] انیمیشن باکس راهنمای گروه‌های جستجو */
@keyframes tlePopIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}
#tle-group-hint strong { color: #2b6cb0; }
/* [ADDITION END] */



/* [ADDITION START - V30.0] Multi-Tag Badge Styles */
.tle-selected-tags-container {
    min-height: 5px;
    width: 100%;
}
.tle-tag-chip {
    background: #e2e8f0;
    color: #1e293b;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #cbd5e1;
    animation: tlePopIn 0.2s ease-out;
}
.tle-tag-chip .tle-remove-tag {
    cursor: pointer;
    color: #ef4444;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
}
.tle-tag-chip .tle-remove-tag:hover {
    color: #b91c1c;
}
/* [ADDITION END] */