/* ============================================================================
   Abu Judom - /Project page enhancements
   ----------------------------------------------------------------------------
   Loaded only by Views/Project/Index.cshtml. Defines a project-scoped filter
   bar (.aj-fbar-project) and an empty state. Does NOT redefine any class
   shared with the global enhancement bundle (.aj-fbar / .aj-card / etc.).
   Bilingual: SiteEn and SiteAr copies of this file are byte-identical.
   ============================================================================ */


/* ----------------------------------------------------------------------------
   1. ONE-LINE FILTER BAR (.aj-fbar-project)
   DOM order: Category - RealestateType - City - Neighborhood - Search button.
   In LTR this reads left-to-right; with dir="rtl" flexbox reverses naturally.
   ---------------------------------------------------------------------------- */
.aj-fbar-project {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    width: 100%;
    margin: 0 0 22px;
    padding: 10px 12px;
    background: #ffffff;
    border: 1px solid var(--aj-border, #e5e7eb);
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}
.aj-fbar-project__field {
    flex: 1 1 0;
    min-width: 0;
    position: relative;
}
.aj-fbar-project__btn {
    flex: 0 0 auto;
    min-width: 130px;
    height: 44px;
    padding: 0 22px;
    border: 0;
    border-radius: 10px;
    background: var(--aj-primary, #b7cd27);
    color: #ffffff;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.3px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(183, 205, 39, 0.30);
    transition: background 200ms ease, box-shadow 200ms ease, transform 200ms ease;
    white-space: nowrap;
}
.aj-fbar-project__btn:hover,
.aj-fbar-project__btn:focus-visible {
    background: var(--aj-primary-dark, #a7bd1b);
    box-shadow: 0 6px 18px rgba(183, 205, 39, 0.45);
    transform: translateY(-1px);
    color: #ffffff;
    outline: none;
}
.aj-fbar-project__btn:active { transform: translateY(0); }
.aj-fbar-project__btn i { font-size: 13px; }

/* Native <select> baseline (before chosen / select2 initialise). */
.aj-fbar-project select.aj-fbar-project__select {
    width: 100% !important;
    height: 44px;
    padding: 0 12px;
    border: 1px solid var(--aj-border, #e5e7eb);
    border-radius: 10px;
    background: #ffffff;
    color: var(--aj-text, #1f2937);
    font-size: 14px;
    line-height: 1.2;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}
.aj-fbar-project select.aj-fbar-project__select:focus {
    outline: none;
    border-color: var(--aj-primary, #b7cd27);
    box-shadow: 0 0 0 3px var(--aj-primary-soft, rgba(183, 205, 39, 0.20));
}

/* Chosen.js single-select widget overrides */
.aj-fbar-project .chosen-container,
.aj-fbar-project .chosen-container-single {
    width: 100% !important;
    min-width: 0 !important;
    font-size: 14px;
}
.aj-fbar-project .chosen-container-single .chosen-single {
    height: 44px !important;
    line-height: 42px !important;
    padding: 0 32px 0 14px;
    border: 1px solid var(--aj-border, #e5e7eb) !important;
    border-radius: 10px !important;
    background: #ffffff !important;
    box-shadow: none !important;
    color: var(--aj-text, #1f2937);
}
.aj-fbar-project .chosen-container-active.chosen-with-drop .chosen-single,
.aj-fbar-project .chosen-container-active .chosen-single {
    border-color: var(--aj-primary, #b7cd27) !important;
    box-shadow: 0 0 0 3px var(--aj-primary-soft, rgba(183, 205, 39, 0.20)) !important;
}
.aj-fbar-project .chosen-container-single .chosen-single div {
    top: 0;
    height: 44px;
    width: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.aj-fbar-project .chosen-container-single .chosen-single div b {
    background-position: 0 12px;
}
.aj-fbar-project .chosen-container .chosen-drop {
    border: 1px solid var(--aj-border, #e5e7eb);
    border-radius: 10px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
    margin-top: 4px;
}
.aj-fbar-project .chosen-container .chosen-results li.highlighted {
    background: var(--aj-primary, #b7cd27);
    color: #ffffff;
}

/* Select2 widget overrides */
.aj-fbar-project .select2-container,
.aj-fbar-project .select2 {
    width: 100% !important;
    min-width: 0 !important;
}
.aj-fbar-project .select2-container .select2-selection--single {
    height: 44px !important;
    border: 1px solid var(--aj-border, #e5e7eb) !important;
    border-radius: 10px !important;
    background: #ffffff !important;
}
.aj-fbar-project .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 42px !important;
    padding: 0 32px 0 14px;
    color: var(--aj-text, #1f2937);
}
.aj-fbar-project .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 42px !important;
    top: 1px;
}
.aj-fbar-project .select2-container--default.select2-container--open .select2-selection--single,
.aj-fbar-project .select2-container--default.select2-container--focus .select2-selection--single {
    border-color: var(--aj-primary, #b7cd27) !important;
    box-shadow: 0 0 0 3px var(--aj-primary-soft, rgba(183, 205, 39, 0.20)) !important;
}

/* RTL: flip the dropdown caret side */
html[dir="rtl"] .aj-fbar-project .chosen-container-single .chosen-single,
[dir="rtl"]     .aj-fbar-project .chosen-container-single .chosen-single {
    padding: 0 14px 0 32px;
}
html[dir="rtl"] .aj-fbar-project .chosen-container-single .chosen-single div,
[dir="rtl"]     .aj-fbar-project .chosen-container-single .chosen-single div {
    right: auto;
    left: 4px;
}
html[dir="rtl"] .aj-fbar-project .select2-container--default .select2-selection--single .select2-selection__rendered,
[dir="rtl"]     .aj-fbar-project .select2-container--default .select2-selection--single .select2-selection__rendered {
    padding: 0 14px 0 32px;
    text-align: right;
}
html[dir="rtl"] .aj-fbar-project .select2-container--default .select2-selection--single .select2-selection__arrow,
[dir="rtl"]     .aj-fbar-project .select2-container--default .select2-selection--single .select2-selection__arrow {
    right: auto;
    left: 6px;
}

/* Tablet */
@media (max-width: 991px) {
    .aj-fbar-project { gap: 6px; padding: 8px 10px; }
    .aj-fbar-project__btn { min-width: 110px; padding: 0 16px; }
}

/* Mobile: stack vertically; each control fills the row */
@media (max-width: 767px) {
    .aj-fbar-project {
        flex-wrap: wrap;
        gap: 8px;
        padding: 12px;
    }
    .aj-fbar-project__field {
        flex: 1 1 100%;
        min-width: 100%;
    }
    .aj-fbar-project__btn {
        flex: 1 1 100%;
        width: 100%;
        min-width: 0;
    }
}

/* Dark mode token alignment */
body.aj-dark .aj-fbar-project {
    background: var(--aj-bg-card, #1e293b);
    border-color: var(--aj-border, #334155);
}
body.aj-dark .aj-fbar-project select.aj-fbar-project__select,
body.aj-dark .aj-fbar-project .chosen-container-single .chosen-single,
body.aj-dark .aj-fbar-project .select2-container .select2-selection--single {
    background: var(--aj-bg-soft, #1e293b) !important;
    border-color: var(--aj-border, #334155) !important;
    color: var(--aj-text, #e5e7eb) !important;
}


/* ----------------------------------------------------------------------------
   2. EMPTY STATE for /Project (rendered inside .aj-masonry-grid when 0 items)
   ---------------------------------------------------------------------------- */
.aj-project-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 24px;
    background: #ffffff;
    border: 1px dashed var(--aj-border, #e5e7eb);
    border-radius: 16px;
    color: #475569;
}
.aj-project-empty__icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: var(--aj-primary-soft, rgba(183, 205, 39, 0.18));
    color: var(--aj-primary-dark, #a7bd1b);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
}
.aj-project-empty__title {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
}
.aj-project-empty__sub {
    margin: 0 0 22px;
    font-size: 14px;
    color: #64748b;
}
.aj-project-empty__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 42px;
    padding: 0 22px;
    border-radius: 10px;
    background: var(--aj-primary, #b7cd27);
    color: #ffffff !important;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none !important;
    box-shadow: 0 4px 12px rgba(183, 205, 39, 0.30);
    transition: background 200ms ease, box-shadow 200ms ease, transform 200ms ease;
}
.aj-project-empty__btn:hover,
.aj-project-empty__btn:focus-visible {
    background: var(--aj-primary-dark, #a7bd1b);
    transform: translateY(-1px);
    color: #ffffff !important;
    outline: none;
}

body.aj-dark .aj-project-empty {
    background: var(--aj-bg-card, #1e293b);
    border-color: var(--aj-border, #334155);
    color: #cbd5e1;
}
body.aj-dark .aj-project-empty__title { color: #f1f5f9; }
body.aj-dark .aj-project-empty__sub   { color: #94a3b8; }
