/* کلاس جلوگیری از اسکرول صفحه هنگام باز بودن پاپ‌آپ */
body.vira-search-no-scroll {
    overflow: hidden !important;
}

/* پس‌زمینه پاپ‌آپ */
.vira-search-modal {
    display: none;
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4); 
    backdrop-filter: blur(12px); /* بلور بیشتر برای حس گلس‌مورفیسم عمیق‌تر */
    -webkit-backdrop-filter: blur(12px);
}

/* بدنه اصلی پاپ‌آپ */
.vira-search-modal-content {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.1), inset 0 0 0 1px rgba(255, 255, 255, 0.5); /* سایه نرم‌تر و بردر داخلی */
    margin: 10vh auto;
    padding: 30px 25px;
    border-radius: 24px;
    width: 90%;
    max-width: 700px;
    position: relative;
    direction: rtl;
}

/* فرم و فیلد جستجو */
.vira-search-form {
    position: relative;
    width: 100%;
}

/* تغییر ساختار به فلکس برای قرارگیری دکمه در کنار فیلد */
.vira-search-input-wrapper {
    display: flex;
    align-items: center;
    gap: 12px; /* فاصله بین فیلد و دکمه بستن */
}

/* فیلد جستجوی کپسولی و حرفه‌ای */
.vira-search-form input {
    flex-grow: 1; /* اشغال تمام فضای باقی‌مانده */
    padding: 16px 25px !important; 
    font-size: 16px !important;
    /* خط مشکی حذف شد و به یک حاشیه بسیار محو و شیشه‌ای تبدیل شد */
    border: 1px solid rgba(255, 255, 255, 0.6) !important; 
    background: rgba(255, 255, 255, 0.95) !important;
    /* استفاده از important برای غلبه بر استایل‌های قالب و گرد شدن کامل */
    border-radius: 50px !important; 
    box-sizing: border-box !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); /* ترانزیشن نرم‌تر */
    color: #333 !important;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.04), inset 0 2px 4px rgba(255, 255, 255, 0.8) !important;
}

.vira-search-form input:focus {
    outline: none !important;
    background: #ffffff !important;
    border-color: rgba(0, 124, 186, 0.4) !important;
    /* ایجاد یک حلقه فوکوس حرفه‌ای به جای سایه معمولی */
    box-shadow: 0 0 0 4px rgba(0, 124, 186, 0.1), 0 8px 25px rgba(0, 0, 0, 0.06) !important;
}

/* دکمه بستن (مستقل در کنار فیلد) */
.vira-search-close {
    position: relative; /* خروج از حالت absolute */
    left: auto;
    top: auto;
    transform: none;
    color: #666;
    font-size: 22px;
    cursor: pointer;
    z-index: 10;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.02);
    border-radius: 50%;
    width: 48px; /* اندازه دایره دکمه */
    height: 48px;
    flex-shrink: 0; /* جلوگیری از جمع شدن دکمه */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
}

.vira-search-close:hover { 
    color: #fff;
    background: #ff4d4d;
    border-color: #ff4d4d;
    box-shadow: 0 6px 15px rgba(255, 77, 77, 0.3);
    transform: translateY(-2px); /* افکت شناور شدن */
}

/* لودر */
.vira-search-loader {
    text-align: center;
    margin-top: 20px;
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

/* باکس نتایج */
.vira-search-results {
    margin-top: 20px;
    max-height: 55vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.15) transparent;
    padding-left: 5px;
}

.vira-search-results::-webkit-scrollbar {
    width: 6px;
}
.vira-search-results::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.15);
    border-radius: 10px;
}

/* آیتم‌های نتیجه */
.vira-search-result-item {
    display: flex;
    align-items: center;
    padding: 14px;
    margin-bottom: 10px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.vira-search-result-item:hover { 
    background: rgba(255, 255, 255, 1);
    transform: scale(1.01) translateY(-2px); /* افکت پاپ‌آپ ریز برای آیتم‌ها */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.06);
    border-color: rgba(255, 255, 255, 1);
}

.vira-search-result-image {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    object-fit: cover;
    margin-left: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

.vira-search-result-title {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.4;
}

.vira-search-result-type {
    font-size: 11px;
    color: #555;
    margin-top: 6px;
    background: rgba(0,0,0,0.05);
    padding: 4px 10px;
    border-radius: 20px;
    display: inline-block;
    font-weight: 500;
}
