/* tenders.css */

/* ۱. بارگذاری فونت‌ها */
@font-face {
  font-family: 'Samim';  
  src: url('fonts/Samim-Bold-FD.eot'); 
  src: url('fonts/Samim-Bold-FD.eot?#iefix') format('embedded-opentype'), /* IE6–IE8 */
       url('fonts/Samim-Bold-FD.woff') format('woff'),   /* Modern browsers */
       url('fonts/Samim-Bold-FD.ttf') format('truetype'); /* Safari, Android, iOS */
  font-weight: normal;
  font-style: normal;
}

@font-face {
    font-family: 'Font Awesome 6 Free';
    font-style: normal;
    font-weight: 900;
    src: url("webfonts/fa-solid-900.woff2") format("woff2");
}

/* ۲. تنظیمات عمومی */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Samim', Verdana, sans-serif;
}

:root {
    --primary-color: #20BEC6; /* رنگ آبی سازمانی */
    --secondary-color: #f3f4f6;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --border-radius: 12px;
    --transition: 0.3s ease;
}

body {
    background-color: var(--bg-color);
    margin: 0;
    padding: 0;
    color: var(--text-main);
    background: linear-gradient(rgba(245, 243, 243, 0.85), rgba(119, 118, 118, 0.9)), url('images/Pic2.jpg');
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* کانتینر اصلی صفحه */
.tenders-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    flex: 1;
}

/* استایل‌های هدر صفحه */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
}

.page-title {
    font-size: 1.75rem;
    font-weight: bold;
    margin: 0 0 0.5rem 0;
    color: var(--primary-color);
}

.page-subtitle {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.btn-refresh {
    background: #fff;
    border: 1px solid #d1d5db;
    color: var(--text-main);
    padding: 0.75rem;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    display: none; /* در صورت نیاز به نمایش، این را تغییر دهید */
}

.btn-refresh:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.btn-refresh.spinning i {
    animation: spin 1s linear infinite;
}

/* چیدمان گرید کارت‌ها */
.tenders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

/* استایل‌های کارت مناقصه */
.tender-card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    border: 1px solid #e5e7eb;
}

.tender-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border-color: #cbd5e1;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.tender-status {
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-active { background: #d1fae5; color: #065f46; }
.status-inactive { background: #fee2e2; color: #991b1b; }

.tender-title {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.6;
    margin: 0 0 1rem 0;
    color: var(--text-main);
    flex-grow: 1;
}

.card-meta {
    display: flex;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
    gap: 0.5rem;
}

.card-meta i {
    color: var(--primary-color);
}

.btn-download {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem;
    background-color: var(--primary-color);
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    border: none;
}

.btn-download:hover {
    background-color: #08385a;
}

/* ابزارهای کاربردی */
.hidden { display: none !important; }

/* لودر و اسپینر */
.loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 0;
    color: var(--text-muted);
}
.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin { 
    0% { transform: rotate(0deg); } 
    100% { transform: rotate(360deg); } 
}

/* حالت خالی (Empty State) */
.empty-state {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--text-muted);
}
.empty-icon {
    font-size: 4rem;
    color: #cbd5e1;
    margin-bottom: 1rem;
}

/* ==========================================
   استایل‌های فوتر تاشو و کرکره‌ای (MIGTCO)
   ========================================== */

/* کانتینر اصلی فوتر چسبیده به پایین با پدینگ صفر جهت کنترل دقیق ارتفاع */
.main-footer {
    width: 100%;
    background: rgba(255, 255, 255, 0.96);
    border-top: 2px solid #e2e8f0;
    padding: 0 !important; /* پدینگ صفر برای جلوگیری از تداخل استایل‌های ریسپانسیو */
    color: var(--text-main);
    backdrop-filter: blur(8px);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.03);
    z-index: 10;
}

/* هدر فوتر - ارتفاع کاملاً فشرده و فیت شده به لبه‌ی بالایی */
.footer-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 2rem; /* پدینگ کنترل‌شده جهت کاهش ارتفاع حالت بسته */
    cursor: pointer;
    background: #ffffff;
    user-select: none;
    transition: background 0.3s ease;
}

/* انیمیشن پالس برای آیکون */
@keyframes pulse-attention {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.7;
        text-shadow: 0 0 8px rgba(32, 190, 198, 0.5);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.footer-summary:hover span {
    color: #08385a; 
}

.footer-summary:hover span::before {
    animation: none; 
    transform: rotate(20deg); 
}

.footer-summary span {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.2;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

/* افزودن یک آیکون راهنما قبل از متن */
.footer-summary span::before {
    content: '\f059'; /* آیکون علامت سوال دایره‌ای در Font Awesome */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 1.2rem;
    color: var(--danger-color);
    /* انیمیشن برای جلب توجه */
    animation: pulse-attention 2s infinite;
}

.footer-summary .toggle-icon {
    font-size: 1rem;
    color: var(--primary-color);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: rotate(180deg); /* حالت بسته: آیکون رو به پایین */
}

/* کانتینر افکت تاشو */
.footer-collapse {
    max-height: 0; /* پیش‌فرض بسته */
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-footer.is-open .footer-collapse {
    font-family: 'Samim', Verdana, sans-serif;
}

/* چرخیدن آیکون در حالت باز */
.main-footer.is-open .toggle-icon {
    transform: rotate(0deg); /* حالت باز: رو به بالا */
}

/* بدنه داخلی محتوای فوتر */
.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem 2.5rem 2rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.footer-content > p {
    grid-column: 1 / -1;
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--text-muted);
    text-align: justify;
    margin: 0;
}

/* استایل بخش‌های محتویات پاکت‌ها */
.footer-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--border-radius);
    padding: 1.25rem;
    transition: var(--transition);
}

.footer-section:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 6px -1px rgba(32, 190, 198, 0.1);
}

.footer-section h5 {
    color: var(--primary-color);
    font-size: 1rem;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 0.75rem;
    border-right: 3px solid var(--primary-color);
    padding-right: 8px;
}

.footer-section ul {
    margin: 0;
    padding-right: 1.25rem;
    list-style-type: disc;
}

.footer-section li {
    font-size: 0.85rem;
    line-height: 1.8;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.footer-section li:last-child {
    margin-bottom: 0;
}

/* ریسپانسیو سراسری */
@media (max-width: 640px) {
    .page-header { 
        flex-direction: column; 
        align-items: flex-start; 
        gap: 1rem; 
    }
    .btn-refresh { 
        align-self: flex-end; 
    }
    .footer-summary {
        padding: 0.75rem 1rem; /* پدینگ فشرده‌تر در موبایل */
    }
    .footer-content {
        padding: 1rem 1rem 2rem 1rem;
    }
}

@media (min-width: 768px) {
    .footer-content {
        grid-template-columns: repeat(3, 1fr);
        column-gap: 1.5rem;
        row-gap: 1rem;
    }
}

@media (min-width: 1024px) {
    .footer-section {
        padding: 1.5rem;
    }
    .footer-section li {
        font-size: 0.9rem;
    }
    /* در اینجا پدینگ اضافه .main-footer به طور کامل حذف شده است تا ارتفاع فوتر تغییر نکند */
}
