/* =========================================================
   تنظیمات کلی صفحه بخشنامه‌های گمرکی
   Scope: .circulars-wrapper
========================================================= */

.circulars-wrapper {
    padding: 40px 20px;
    background-color: transparent;
    font-family: inherit;
    direction: rtl;
}

.circulars-wrapper .container {
    max-width: 1200px; /* عرض بیشتر شده تا گرید ۳ ستونه به خوبی جا شود */
    margin: 0 auto;
}

/* کارت‌های سفید (قالب اصلی سایت) */
.circulars-wrapper .white-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    border: 1px solid #eaedf1;
    margin-bottom: 25px;
}

/* مسیر راهنما */
.circulars-wrapper .breadcrumb {
    margin-bottom: 20px;
    font-size: var(--fs-sm);
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 8px;
}
.circulars-wrapper .breadcrumb a { color: #64748b; text-decoration: none; transition: color 0.3s; }
.circulars-wrapper .breadcrumb a:hover { color: #12828b; }
.circulars-wrapper .breadcrumb .current { color: #12828b; font-weight: var(--fw-bold); }

/* هدر صفحه */
.circulars-wrapper .page-header {
    padding: 30px;
    border-right: 5px solid #12828b;
}
.circulars-wrapper .page-title {
    margin: 0 0 10px 0;
    font-size: var(--fs-2xl);
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 12px;
}
.circulars-wrapper .page-title i { color: #12828b; }
.circulars-wrapper .page-description { margin: 0; color: #64748b; font-size: var(--fs-base); }

/* =========================================================
   پنل فیلتر و جستجو (استایل قبلی شما)
========================================================= */
.circulars-wrapper .filter-section {
    padding: 25px;
}
.circulars-wrapper .filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.circulars-wrapper .section-title {
    margin: 0;
    font-size: var(--fs-lg);
    color: #2c3e50;
}
.circulars-wrapper .btn-reset {
    background: #fff0f0;
    color: #e74c3c;
    border: 1px solid #ffdcdc;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: var(--fs-xs);
    cursor: pointer;
    transition: all 0.3s;
}
.circulars-wrapper .btn-reset:hover { background: #e74c3c; color: #fff; }

.circulars-wrapper .filter-form {
    display: grid;
    grid-template-columns: 2fr 2fr auto;
    gap: 20px;
    align-items: end;
}
.circulars-wrapper .form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: var(--fs-sm);
    color: #475569;
    font-weight: var(--fw-bold);
}
.circulars-wrapper .input-with-icon {
    position: relative;
}
.circulars-wrapper .input-with-icon .icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}
.circulars-wrapper .input-with-icon input,
.circulars-wrapper .input-with-icon select {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-family: inherit;
    font-size: var(--fs-sm);
    color: #2c3e50;
    outline: none;
    transition: border-color 0.3s;
    background-color: #f8fafc;
    /* راست‌چین کردن padding برای آیکون به خاطر direction rtl */
    padding: 12px 15px 12px 15px;
    padding-right: 40px;
    box-sizing: border-box;
}

.circulars-wrapper .input-with-icon input:focus,
.circulars-wrapper .input-with-icon select:focus { border-color: #12828b; background-color: #fff;}

.circulars-wrapper .btn-submit {
    background-color: #12828b;
    color: #fff;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: var(--fs-md);
    font-weight: var(--fw-bold);
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    height: 46px;
}
.circulars-wrapper .btn-submit:hover { background-color: #0e6b73; transform: translateY(-2px); }

/* =========================================================
   بخش نتایج جستجوی زنده (ایجکس)
========================================================= */
.autocomplete-wrapper {
    position: relative;
    width: 100%;
}
.autocomplete-results {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    width: 100%;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    list-style: none;
    padding: 0;
    margin: 5px 0 0 0;
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
}
.autocomplete-results li {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f5f5f5;
    font-size: var(--fs-sm);
}
.autocomplete-results li:hover {
    background-color: #f0f7ff;
    color: #0056b3;
}
.autocomplete-results li:last-child {
    border-bottom: none;
}

/* =========================================================
   طراحی جدید کارت‌های بخشنامه (گرید مطابق تصویر جدید)
========================================================= */
.circulars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.modern-circular-card {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid #f1f1f1;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.modern-circular-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

/* خط عمودی کوچک در گوشه بالا سمت راست */
.modern-circular-card::before {
    content: '';
    position: absolute;
    top: 30px;
    right: 0;
    width: 5px;
    height: 35px;
    background-color: #4a4e69; /* رنگ تیره خط عمودی */
    border-radius: 4px 0 0 4px;
}

.card-header-modern {
    margin-bottom: 25px;
    min-height: 55px; /* هم‌تراز کردن ارتفاع عنوان‌ها */
}

.modern-title {
    font-size: var(--fs-md);
    font-weight: var(--fw-bold);
    color: #2b2d42;
    line-height: 1.7;
    margin: 0;
    text-align: right;
    
    /* برش متن (محدود به دو خط) */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    
    padding-right: 10px; /* فاصله متن از خط عمودی */
}

.card-body-modern {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 25px;
    flex-grow: 1;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dashed #f0f0f0;
    padding-bottom: 8px;
}

.info-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.info-label {
    font-size: var(--fs-sm);
    color: #8d99ae;
    font-weight: var(--fw-medium);
}

.info-value {
    font-size: var(--fs-sm);
    color: #495057;
    font-weight: var(--fw-medium);
    direction: ltr; /* برای نمایش درست خط تیره در شماره بخشنامه */
    text-align: right;
}

/* دکمه دانلود تیره رنگ در انتهای کارت */
.download-button {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    background-color: #25243b; /* رنگ سرمه‌ای تیره مطابق عکس جدید */
    color: #ffffff;
    text-decoration: none;
    padding: 14px 20px;
    border-radius: 8px;
    font-weight: var(--fw-medium);
    font-size: var(--fs-md);
    width: 100%;
    transition: background-color 0.2s;
    border: none;
    cursor: pointer;
    box-sizing: border-box;
}

.download-button:hover {
    background-color: #1a192e;
    color: #ffffff;
}

.download-button.disabled {
    background-color: #e9ecef;
    color: #adb5bd;
    cursor: not-allowed;
}

.download-button i {
    font-size: 1.1rem;
}

/* =========================================================
   حالت خالی (Empty State)
========================================================= */
.circulars-wrapper .empty-state {
    text-align: center;
    padding: 50px 20px;
    grid-column: 1 / -1; /* تمام عرض گرید را بگیرد */
}
.circulars-wrapper .empty-icon i {
    font-size: 4rem;
    color: #cbd5e1;
    margin-bottom: 20px;
}
.circulars-wrapper .empty-state h3 { margin: 0 0 10px 0; color: #475569; }
.circulars-wrapper .empty-state p { color: #94a3b8; margin: 0; }

/* =========================================================
   واکنش‌گرایی (Responsive)
========================================================= */
@media (max-width: 768px) {
    .circulars-wrapper .filter-form { 
        grid-template-columns: 1fr; /* در موبایل فیلترها زیر هم قرار گیرند */
        gap: 15px; 
    }
    .circulars-wrapper .btn-submit { 
        width: 100%; 
    }
    .circulars-grid {
        grid-template-columns: 1fr; /* در موبایل کارت‌ها یک ستونه شوند */
    }
}
