/* ===================================================================
   Template Name: Khayerin Salamat - Final Version
====================================================================== */

/* --- 1. General & Font Styles --- */
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;700;900&display=swap');

:root {
    --primary-color: #00A99D;
    --secondary-color: #002366;
    --text-color: #212529;
    --text-muted: #6c757d;
    --border-color: #dee2e6;
    --background-light: #f8f9fa;
    --white-bg: #ffffff;
    --box-shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --box-shadow-md: 0 4px 15px rgba(0,0,0,0.1);
    --border-radius: 12px;
}

body {
    font-family: 'Vazirmatn', sans-serif;
    direction: rtl;
    text-align: right;
        background-color: var(--background-light);
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cg fill-rule='evenodd'%3E%3Cg fill='%23dce2e6' fill-opacity='0.4'%3E%3Cpath d='M0 38.59l2.83-2.83 1.41 1.41L1.41 40H0v-1.41zM0 1.4l2.83 2.83 1.41-1.41L1.41 0H0v1.41zM38.59 40l-2.83-2.83 1.41-1.41L40 38.59V40h-1.41zM40 1.41l-2.83 2.83-1.41-1.41L38.59 0H40v1.41zM20 18.6l2.83-2.83 1.41 1.41L21.41 20l2.83 2.83-1.41 1.41L20 21.41l-2.83 2.83-1.41-1.41L18.59 20l-2.83-2.83 1.41-1.41L20 18.59z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    color: var(--text-color);
    line-height: 1.7;
    overflow-x: hidden;
}
.breadcrumbs{
margin-top: 0 ; !important
}
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* --- 2. Header Styles --- */
#header {
    background: var(--white-bg);
    box-shadow: var(--box-shadow-sm);
    padding: 15px 0;
    min-height: 84px;
}
.header-placeholder-text {
    color: var(--text-muted);
    font-size: 14px;
    margin: 0;
}

main.needs-assessment-page {
    padding-top: 5px;
}

/* --- 3. Hero Banner & EKG Animation --- */
.page-banner {
    position: relative;
    padding: 150px 0;
    text-align: center;
    color: var(--white-bg);
    /* مسیر تصویر محلی اصلاح شده */
    background: url('../img/a.jpg') center center/cover no-repeat;
}
.page-banner .overlay {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
   background: linear-gradient(to right, rgba(0, 35, 102, 0.6), rgba(0, 169, 157, 0.5));
}
.page-banner .hero-content {
    position: relative;
    z-index: 2;
}
.page-banner h1 {
    font-size: 4rem;
    font-weight: 900;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.5);
}
.page-banner .lead {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    text-shadow: 1px 1px 5px rgba(0,0,0,0.5);
}
.search-form-container {
    max-width: 700px;
    margin: 0 auto;
}
.search-form {
    display: flex;
    /* 1. اعمال افکت شیشه‌ای به کادر جستجو */
    background: rgba(255, 255, 255, 0.15); /* پس‌زمینه سفید نیمه‌شفاف */
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    
    border-radius: 50px;
    padding: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,.2);
}

.search-form input {
    flex-grow: 1; border: none; outline: none; padding: 0 20px;
    font-size: 16px; font-family: 'Vazirmatn', sans-serif; background: transparent;
    /* 2. تغییر رنگ متن ورودی به سفید برای خوانایی */
    color: #fff;
}

/* 3. تغییر رنگ متن placeholder برای خوانایی */
.search-form input::placeholder {
    color: #ddd;
    opacity: 1; /* برای اطمینان از نمایش در مرورگر فایرفاکس */
}

.search-form button {
    border: none; background: var(--primary-color); color: var(--white-bg);
    font-size: 16px; font-weight: 700; padding: 12px 30px; border-radius: 50px;
    cursor: pointer; transition: .3s; display: flex; align-items: center; gap: 8px;
}
.search-form button:hover {
    background: var(--secondary-color);
}


/* ===================================================================
   Realistic EKG Monitor Simulation
====================================================================== */

/* کانتینر اصلی برای پوشش کامل بنر */
.ekg-monitor-container {
    position: absolute;
    /* 1. پوشش کامل بنر از بالا تا پایین */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* 2. قرار گرفتن در لایه پشتی محتوای اصلی (متن و جستجو) */
    z-index: 1; 
}

/* استایل مانیتور برای اعمال افکت شیشه‌ای و گرید */
.ekg-monitor {
    width: 100%;
    height: 100%;
    /* 3. شفاف‌تر کردن پس‌زمینه برای دیدن بهتر تصویر */
    background-color: rgba(0, 10, 5, 0.25); /* شفافیت از 0.75 به 0.25 کاهش یافت */
    backdrop-filter: blur(3px); /* افکت شیشه‌ای مات (مقدار blur را می‌توانید تغییر دهید) */
    position: relative;
    overflow: hidden;

    /* 4. شفاف‌تر کردن خطوط گرید (شبکه) */
    --grid-color: rgba(57, 255, 20, 0.1); /* شفافیت از 0.15 به 0.1 کاهش یافت */
    background-image:
        linear-gradient(to right, var(--grid-color) 1px, transparent 1px),
        linear-gradient(to bottom, var(--grid-color) 1px, transparent 1px);
    background-size: 25px 25px; /* اندازه خانه‌های گرید کمی بزرگتر شد */
    
    /* 5. حذف کادر و گوشه‌های گرد چون کل صفحه را می‌پوشاند */
    /* border: none; */
    /* border-radius: 0; */
}

/* استایل مشترک برای همه الگوهای خط EKG */
.ekg-line path {
    stroke: #39ff14;
    stroke-width: 2.5;
    fill: none;
    filter: drop-shadow(0 0 3px #39ff14) drop-shadow(0 0 8px #39ff14);
    /* به صورت پیش‌فرض همه پنهان هستند */
    opacity: 0; 
}

/* جادوی اصلی اینجاست: انیمیشن رسم شدن خط (بدون تغییر) */
.ekg-line {
    width: 100%;
    height: 100%;
    clip-path: polygon(0 0, 0 0, 0 100%, 0% 100%);
    /* زمان این انیمیشن 5 ثانیه است */
    animation: scan-line 5s linear infinite;
}

@keyframes scan-line {
    0%    { clip-path: polygon(0 0, 0 0, 0 100%, 0% 100%); }
    95%   { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
    100%  { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
}
/* ---- بخش جدید: انیمیشن چرخشی برای نمایش الگوهای مختلف ---- */
/*
   کل چرخه 15 ثانیه طول می‌کشد (3 الگو * 5 ثانیه).
   هر الگو برای 5 ثانیه نمایش داده شده و سپس برای 10 ثانیه پنهان می‌شود.
*/

#ekg-pattern-1 {
    animation: cycle-patterns-1 15s linear infinite;
}
#ekg-pattern-2 {
    animation: cycle-patterns-2 15s linear infinite;
}
#ekg-pattern-3 {
    animation: cycle-patterns-3 15s linear infinite;
}

/* انیمیشن برای الگوی اول (نمایش در 5 ثانیه اول) */
@keyframes cycle-patterns-1 {
    0%      { opacity: 1; } /* شروع، قابل مشاهده */
    33.33%  { opacity: 1; } /* پایان نمایش */
    33.34%  { opacity: 0; } /* پنهان شدن */
    100%    { opacity: 0; }
}

/* انیمیشن برای الگوی دوم (نمایش از ثانیه 5 تا 10) */
@keyframes cycle-patterns-2 {
    33.33%  { opacity: 0; }
    33.34%  { opacity: 1; } /* شروع نمایش */
    66.66%  { opacity: 1; } /* پایان نمایش */
    66.67%  { opacity: 0; }
    100%    { opacity: 0; }
}

/* انیمیشن برای الگوی سوم (نمایش از ثانیه 10 تا 15) */
@keyframes cycle-patterns-3 {
    66.66%  { opacity: 0; }
    66.67%  { opacity: 1; } /* شروع نمایش */
    100%    { opacity: 1; } /* پایان نمایش و تکرار چرخه */
}


/* --- 4. Filters Section Styles --- */
.filters-section {
    padding: 60px 0;
    /* Glassmorphism Effect */
    background: rgba(255, 255, 255, 0.5);
            background-color: var(--background-light);
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cg fill-rule='evenodd'%3E%3Cg fill='%23dce2e6' fill-opacity='0.4'%3E%3Cpath d='M0 38.59l2.83-2.83 1.41 1.41L1.41 40H0v-1.41zM0 1.4l2.83 2.83 1.41-1.41L1.41 0H0v1.41zM38.59 40l-2.83-2.83 1.41-1.41L40 38.59V40h-1.41zM40 1.41l-2.83 2.83-1.41-1.41L38.59 0H40v1.41zM20 18.6l2.83-2.83 1.41 1.41L21.41 20l2.83 2.83-1.41 1.41L20 21.41l-2.83 2.83-1.41-1.41L18.59 20l-2.83-2.83 1.41-1.41L20 18.59z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    z-index: 10;
}
.filter-toggles {
    display: flex; justify-content: center; flex-wrap: wrap; 
    gap: 15px; margin-bottom: 30px;
}
.toggle-btn {
    font-family: 'Vazirmatn', sans-serif; font-size: 1rem; font-weight: 700;
    border: none; background-color: transparent; color: var(--text-muted);
    padding: 10px 20px; border-radius: 50px; cursor: pointer; transition: .3s;
    display: flex; align-items: center; gap: 8px;
}
.toggle-btn:hover {
    color: var(--text-color);
}
.toggle-btn.active {
    background-color: var(--primary-color);
    color: var(--white-bg);
    box-shadow: 0 4px 15px rgba(0, 169, 157, 0.3);
}
.filter-divider {
    border-color: rgba(0,0,0,.08); margin-bottom: 30px;
}
.category-buttons {
    display: flex; justify-content: center; flex-wrap: wrap; gap: 15px;
}
/* ... existing filter styles ... */
.category-buttons button {
    font-family: 'Vazirmatn', sans-serif; border: 2px solid var(--border-color);
    background: var(--white-bg); padding: 8px 25px; border-radius: 50px;
    cursor: pointer; transition: all .3s ease; font-weight: 500;
    /* Added for icons */
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.category-buttons button:hover, .category-buttons button.active {
    background-color: var(--secondary-color);
    color: var(--white-bg);
    border-color: var(--secondary-color);
}

/* --- 5. Needs List & Card Styles (Updated for Animation) --- */
.needs-list-section {
    padding: 80px 0;
    background-color: var(--background-light);
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cg fill-rule='evenodd'%3E%3Cg fill='%23dce2e6' fill-opacity='0.4'%3E%3Cpath d='M0 38.59l2.83-2.83 1.41 1.41L1.41 40H0v-1.41zM0 1.4l2.83 2.83 1.41-1.41L1.41 0H0v1.41zM38.59 40l-2.83-2.83 1.41-1.41L40 38.59V40h-1.41zM40 1.41l-2.83 2.83-1.41-1.41L38.59 0H40v1.41zM20 18.6l2.83-2.83 1.41 1.41L21.41 20l2.83 2.83-1.41 1.41L20 21.41l-2.83 2.83-1.41-1.41L18.59 20l-2.83-2.83 1.41-1.41L20 18.59z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.needs-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}
.need-card {
    background: var(--white-bg); border-radius: var(--border-radius);
    overflow: hidden; box-shadow: var(--box-shadow-sm);
    transition: transform .3s ease, box-shadow .3s ease, opacity .4s ease-in-out; /* Added opacity transition */
    display: flex; flex-direction: column; border: 1px solid #e9ecef;
    
}
/* Class for fade-out animation */
.need-card.hidden {
    opacity: 0;
    pointer-events: none; /* Prevent clicking during transition */
}
.need-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--box-shadow-md);
}
.card-image {
    position: relative; height: 220px; overflow: hidden;
}
.card-image img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform .4s ease;
}
.need-card:hover .card-image img {
    transform: scale(1.05);
}
.card-category {
    position: absolute; top: 15px; right: 15px;
    background-color: var(--primary-color);
    color: var(--white-bg); padding: 5px 12px;
    border-radius: 50px; font-size: 13px; font-weight: 700;
}
.card-content {
    padding: 25px; flex-grow: 1; display: flex; flex-direction: column;
}
.card-title {
    font-size: 1.25rem; font-weight: 700; margin: 0 0 12px 0;
    min-height: 58px; line-height: 1.5; color: var(--secondary-color);
}
.card-location {
    color: var(--text-muted); font-size: 1rem; margin-bottom: 15px;
}
.card-location i {
    color: var(--primary-color); margin-left: 6px;
}
.card-financials {
    display: flex; justify-content: space-between;
    font-size: 1rem; margin-bottom: 10px;
}
.card-financials .label { color: #555; }
.card-financials .amount {
    font-weight: 700; color: #198754;
}
.progress-bar-container {
    background: #e9ecef; border-radius: 20px; height: 10px;
    width: 100%; overflow: hidden; margin-bottom: 5px;
}
.progress-bar-fill {
    background: #198754; height: 100%;
    border-radius: 20px; transition: width .5s ease-in-out;
}
.progress-text {
    font-size: 0.8rem; color: var(--text-muted); margin-bottom: 25px;
}
.btn-details {
    display: block; text-align: center; background: var(--primary-color);
    color: var(--white-bg); padding: 12px; border-radius: 8px;
    text-decoration: none; font-weight: 700; margin-top: auto;
    transition: all .3s ease;
}
.btn-details:hover {
    background: var( --background-light);
  border: 1px solid #002366;
    
}

/* --- 6. Pagination Styles --- */
.pagination-nav {
    display: flex;
    justify-content: center;
    margin-top: 50px;
}
.pagination { padding-right: 0; }
.page-item .page-link {
    color: var(--primary-color);
    border-radius: 8px !important; margin: 0 4px;
    transition: all .3s ease; font-family: 'Vazirmatn', sans-serif; padding: 8px 15px;
    border: 1px solid var(--border-color);
}
.page-item.active .page-link {
    z-index: 3; color: var(--white-bg);
    background-color: var(--primary-color); border-color: var(--primary-color);
}
.page-item.disabled .page-link {
    color: #6c757d; pointer-events: none;
    background-color: var(--white-bg); border-color: #dee2e6;
}
.page-link:hover {
    z-index: 2; color: var(--secondary-color);
    background-color: #e9ecef; border-color: #dee2e6;
}

/* --- 7. Footer Styles --- */
#footer.footer-dark {
    background: var(--secondary-color);
    color: #bdc3c7;
    font-size: 14px;
    padding: 40px 0;
}
#footer.footer-dark h4 {
    font-size: 16px; font-weight: 700; color: #fff;
    position: relative; padding-bottom: 12px; margin-bottom: 20px;
}
#footer.footer-dark h4::after {
    content: ""; position: absolute; display: block;
    width: 50px; height: 2px; background: var(--primary-color);
    bottom: 0; right: 0;
}
#footer.footer-dark .footer-info p { margin: 0; line-height: 2; }
#footer.footer-dark .footer-links ul { list-style: none; padding: 0; margin: 0; }
#footer.footer-dark .footer-links ul li { padding: 8px 0; display: flex; align-items: center; }
#footer.footer-dark .footer-links ul i {
    color: var(--primary-color); font-size: 14px;
    margin-left: 8px; line-height: 0;
}
#footer.footer-dark .footer-links ul a {
    color: #b0b0b0; transition: .3s; text-decoration: none;
}
#footer.footer-dark .footer-links ul a:hover { color: var(--primary-color); }
.footer-divider {
    border: 0; border-top: 1px solid rgba(255, 255, 255, .1); margin: 30px 0;
}
.footer-bottom-row {
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; font-size: 13px; color: #999;
}

/* --- 8. Responsive Styles --- */
@media (max-width: 992px) {
    .needs-grid { grid-template-columns: repeat(2, 1fr); }
    .page-banner h1 { font-size: 3rem; }
}
@media (max-width: 768px) {
    .needs-grid { grid-template-columns: 1fr; }
    .page-banner { padding: 100px 0; }
    .page-banner h1 { font-size: 2.5rem; }
    .search-form { flex-direction: column; gap: 10px; padding: 15px; border-radius: 20px; }
    .search-form input { text-align: center; }
    .search-form button { justify-content: center; }
    #footer.footer-dark .footer-info, #footer.footer-dark .footer-links { text-align: center; }
    #footer.footer-dark h4::after { left: 50%; transform: translateX(-50%); }
    .footer-bottom-row { flex-direction: column; justify-content: center; text-align: center; }
}
/* --- 9. Advanced Filter Modal Styles --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 600px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.modal-header h4 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-modal-btn {
    background: none;
    border: none;
    font-size: 2rem;
    font-weight: 300;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color 0.2s;
}

.close-modal-btn:hover {
    color: var(--text-color);
}

.modal-body {
    padding: 25px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--secondary-color);
}

.form-group select {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    font-family: 'Vazirmatn', sans-serif;
    font-size: 1rem;
    background-color: #fff;
}

.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.radio-group input[type="radio"] {
    display: none;
}

.radio-group label {
    padding: 8px 15px;
    border: 1px solid var(--border-color);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.9rem;
    background-color: #fff;
}

.radio-group input[type="radio"]:checked + label {
    background-color: var(--secondary-color);
    color: #fff;
    border-color: var(--secondary-color);
}

.modal-footer {
    padding: 15px 25px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background-color: rgba(0, 0, 0, 0.03);
    border-bottom-left-radius: var(--border-radius);
    border-bottom-right-radius: var(--border-radius);
}

.modal-footer button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-family: 'Vazirmatn', sans-serif;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-footer .btn-primary {
    background-color: var(--primary-color);
    color: #fff;
}
.modal-footer .btn-primary:hover {
    background-color: #008a7e;
}

.modal-footer .btn-secondary {
    background-color: #e9ecef;
    color: var(--text-color);
}
.modal-footer .btn-secondary:hover {
    background-color: #ced4da;
}
/* Styles for Details Modal Footer */
.details-footer {
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 0.9rem;
    color: var(--text-muted);
}
.details-footer span {
    display: flex;
    align-items: center;
    gap: 8px;
}
.details-footer i {
    color: var(--primary-color);
}