﻿/* DateRangePicker start */

.date-filter-wrapper {
    position: relative;
    /*font-family: sans-serif;*/
    display: inline-block;
    margin-bottom: 20px;
}

#dateRange {
    width: 260px;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    background: #fff;
    text-align: center;
}

.date-popup {
    position: absolute;
    top: 45px;
    right: 0; /* הצמדה לימין כי המערכת בעברית */
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    display: grid;
    grid-template-columns: 160px 1fr; /* צד ימין כפתורים, צד שמאל לוח */
    padding: 15px;
    z-index: 1000;
    gap: 10px;
}

    .date-popup.hidden {
        display: none;
    }

/* טווחים מהירים */
.quick-ranges {
    border-left: 1px solid #eee; /* קו מפריד */
    padding-left: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

    .quick-ranges button {
        width: 100%;
        padding: 8px;
        border: none;
        background: #f8fafc;
        border-radius: 6px;
        cursor: pointer;
        text-align: right;
        font-size: 14px;
    }

        .quick-ranges button:hover {
            background: #e2e8f0;
        }

/* אזור הפוטר - נמתח על פני כל השורות */
.date-popup-footer {
    grid-column: 1 / span 2;
    border-top: 1px solid #eee;
    padding-top: 10px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.btn-primary {
    background: #007bff;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
}

/* תיקון כיווניות לכל הקונטיינר */
.date-popup {
    direction: rtl;
}

/* היפוך החיצים של Litepicker כדי שיתאימו לעברית */
.litepicker .container__months .button-previous-month,
.litepicker .container__months .button-next-month {
    transform: scaleX(-1);
}

/* סידור התצוגה בתוך ה-Input שייראה תקין (תאריך התחלה בימין) */
#dateRange {
    direction: ltr; /* מומלץ להשאיר LTR כדי שהתאריכים לא יתהפכו בגלל המקף */
    unicode-bidi: bidi-override;
    text-align: right;
}

/* עיצוב נוסף למניעת תזוזות */
.calendars-area {
    min-width: 480px;
}
/* מבטיח שהפופאפ לא יזוז */
.date-popup {
    direction: rtl;
    display: grid !important; /* מבטל את ה-hidden של ה-JS כשצריך */
    grid-template-columns: 160px 1fr;
}

    .date-popup.hidden {
        display: none !important;
    }

/* תיקון החיצים שהיו הפוכים */
.litepicker .container__months .button-previous-month,
.litepicker .container__months .button-next-month {
    transform: scaleX(-1);
}

/* הצגת הטווח ב-Input בצורה הגיונית (משמאל לימין בתוך שדה ימני) */
.date-range-container {
    width: 280px;
    background: #fbfdfe;
    position: relative;
}

#dateRange {
    direction: ltr;
    text-align: right;
    unicode-bidi: plaintext;
    position: relative;
    z-index: 5;
    background: transparent;
    font-size: 14px;
}

.date-icon {
    display: inline;
    position: absolute;
    left: 8px;
    top: 6px;
    z-index: 0;
    color: #b1b9c5;
}

/* הסרת שאריות של כפתורי הספרייה אם נשארו */
.litepicker .container__footer {
    display: none !important;
}

.calendar-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.manual-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f1f5f9;
    border-radius: 8px;
    margin-bottom: 5px;
}

    .manual-inputs input {
        width: 110px;
        padding: 5px;
        border: 1px solid #cbd5e1;
        border-radius: 4px;
        text-align: center;
        font-size: 14px;
    }

    .manual-inputs .separator {
        font-size: 13px;
        color: #64748b;
    }

.panel {
    height: 200px;
    background: white;
    border-radius: 20px;
}

/* מוסיף רווח בין החודש לשנה בלוח השנה */
.litepicker .month-item-name {
    margin-left: 5px; /* דוחף את השנה שמאלה ומייצר רווח מושלם בעברית */
}

/* DateRangePicker end */

/* SearchableDropdown start */

/* ===== DatePicker — בחירת תאריך יחיד (עיצוב תואם ל-DateRangePicker; משתמש חוזר ב-.litepicker overrides מעל) ===== */
.single-date-wrapper {
    position: relative;
    display: inline-block;
}

.single-date-wrapper .single-date-input {
    width: 150px; /* רוחב מותאם לתאריך יחיד */
    padding: 10px 10px 10px 32px; /* ריווח שמאלי לאייקון */
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    background: #fbfdfe; /* כמו .date-range-container ברפרנס */
    text-align: right;
    box-sizing: border-box;
    direction: ltr; /* התאריך לא מתהפך */
    unicode-bidi: plaintext;
}

.single-date-wrapper .single-date-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #b1b9c5; /* כמו .date-icon ברפרנס */
    pointer-events: none;
    display: inline-flex;
}

.single-date-popup {
    position: absolute;
    top: 45px;
    left: 50%;                 /* מרכוז הלוח מתחת לתיבה */
    transform: translateX(-50%);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    /*padding: 12px;*/
    z-index: 1000;
    direction: rtl;
}

    .single-date-popup.hidden {
        display: none;
    }

/* הערה: עיצוב הלוח (חצים, רווח חודש-שנה, ימים) מגיע מכללי `.litepicker` הגלובליים למעלה —
   בדיוק כמו ב-DateRangePicker. אין overrides ייעודיים לבורר היחיד, כדי שיהיה זהה. */

.searchable-dropdown {
    position: relative;
    display: inline-block;
    border-radius: 8px;
    cursor: pointer;
}

.searchable-dropdown.disabled {
    pointer-events: none;
    opacity: 0.6;
}

/* ברירת מחדל ללא אייקון (no-icon): תיבה נקייה במלוא רוחב המכל, חץ בלבד בקצה.
   הדשבורד מגדיר ShowIcon="true" ולכן אין לו class זה — ולא מושפע מהכללים כאן. */
.searchable-dropdown.no-icon {
    width: 100%;
}

.searchable-dropdown.no-icon .search-input {
    width: 100%;
    padding-left: 30px; /* מקום לחץ (ממוקם physical left, כמו שאר הקונטרול) */
}

.searchable-dropdown.no-icon .select-agent-icon {
    display: none;
}

.searchable-dropdown.no-icon .select-agent-arrow {
    left: 10px;
}

.searchable-dropdown .search-input {
    /*cursor: text;*/ /* משאיר את סימן האות (I-beam) כשעומדים ספציפית על התיבה */
}

.search-input {
    box-sizing: border-box;
    /*width: 260px;*/
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    background: #fff;
    font-size: 14px;
}

.dropdown-list {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ccc;
    max-height: 350px;
    overflow-y: auto;
    z-index: 9999;
    font-size: 14px;
    font-weight: normal;
    color: #000000;
}

.dropdown-item {
    padding: 8px;
    cursor: pointer;
}

    .dropdown-item:hover {
        background: #f3f3f3;
    }
.select-agent-icon {
    position: absolute;
    left: 10px;
    top: 10px;
    color: #666;
}

.select-agent-arrow {
    position: absolute;
    left: 30px;
    top: 10px;
    color: #666;
}

    .select-agent-arrow svg {
        width: 17px;
    }

select,
input {
    vertical-align: middle;
}
/* SearchableDropdown end */
