/* ==========================================================================
   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; }