/* ═══════════════════════════════════════════════════════════════════
   MVT Date Range Picker — יומן מותאם אישית
   ───────────────────────────────────────────────────────────────────
   מבוסס על Airbnb date picker + hotels-calendar הקיים
   ✓ CSS Grid נטו (בלי flatpickr hacks)
   ✓ RTL טבעי - מאי בימני, יוני בשמאלי
   ✓ תאריך לועזי + עברי בכל תא
   ✓ Sky Luxury palette
   ✓ מצב מלון: מחירים + 4 סטטוסי חסימה
   ═══════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════
   OVERLAY + POPUP - מסך חצי-שקוף + מסגרת הLuחם
   ═══════════════════════════════════════════════════════════════════ */
.mvt-cal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    z-index: 9998;
    display: none;
    animation: mvtCalFade 0.2s ease;
}
.mvt-cal-overlay.open { display: block; }

.mvt-cal {
    position: absolute;
    z-index: 9999;
    background: #FFFFFF;
    border: 1px solid #DCE7F2;
    border-radius: 18px;
    box-shadow: 0 25px 70px rgba(15, 23, 42, 0.2);
    font-family: 'Assistant', 'Heebo', sans-serif;
    color: #0F172A;
    direction: rtl;
    user-select: none;
    -webkit-user-select: none;
    display: none;
    animation: mvtCalSlide 0.2s ease;
    overflow: hidden;
}
.mvt-cal.open { display: block; }

@keyframes mvtCalFade {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes mvtCalSlide {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════════════════════
   HEADER - כותרות החודשים + ניווט
   ═══════════════════════════════════════════════════════════════════ */
.mvt-cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 16px 12px;
    border-bottom: 1px solid #ECF1F7;
    gap: 8px;
}

.mvt-cal-nav {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #F8FBFD;
    border: 1px solid #DCE7F2;
    color: #B48629;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    padding: 0;
}
.mvt-cal-nav:hover {
    background: linear-gradient(135deg, #D4A847, #B48629);
    border-color: #B48629;
    color: #FFFFFF;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(180, 134, 41, 0.3);
}
.mvt-cal-nav:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    background: #F8FBFD;
    color: #94A3B8;
    border-color: #DCE7F2;
    transform: none;
    box-shadow: none;
}
.mvt-cal-nav svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.mvt-cal-titles {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 60px;
    flex: 1;
    direction: ltr;  /* כדי שהחודש הראשון יהיה משמאל וההפוך יוצא RTL */
}
.mvt-cal-title {
    text-align: center;
    line-height: 1.2;
    min-width: 140px;
    direction: rtl;
}
/* החודש הראשון (DOM[0]) הולך לימני; השני הולך לשמאלי */
.mvt-cal-title:nth-of-type(1) { order: 2; }
.mvt-cal-title:nth-of-type(2) { order: 1; }

.mvt-cal-title-main {
    font-size: 15px;
    font-weight: 800;
    color: #0F172A;
    white-space: nowrap;
}
.mvt-cal-title-heb {
    font-size: 13px;
    font-weight: 700;
    color: #B48629;
    margin-top: 2px;
    white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════════
   BODY - הלוחות עצמם
   ═══════════════════════════════════════════════════════════════════ */
.mvt-cal-body {
    display: flex;
    gap: 32px;
    padding: 14px 18px 8px;
    direction: ltr;  /* החודש הראשון מימני, השני משמאל */
    position: relative;
}
.mvt-cal-body::before {
    /* קו אנכי מפריד */
    content: '';
    position: absolute;
    top: 14px;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    background: linear-gradient(180deg, transparent, #ECF1F7 30%, #ECF1F7 70%, transparent);
    pointer-events: none;
}

.mvt-cal-month {
    width: 308px;
    direction: rtl;
}
.mvt-cal-month:nth-of-type(1) { order: 2; }
.mvt-cal-month:nth-of-type(2) { order: 1; }

/* כותרות ימי השבוע */
.mvt-cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    direction: rtl;
    margin-bottom: 6px;
    padding-bottom: 8px;
    border-bottom: 1px solid #ECF1F7;
}
.mvt-cal-weekdays span {
    text-align: center;
    font-size: 12px;
    font-weight: 800;
    color: #B48629;
    letter-spacing: 0.4px;
    padding: 6px 0;
}
.mvt-cal-weekdays span.sat {
    color: #DC2626;
}

/* רשת הימים */
.mvt-cal-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: 52px;
    gap: 1px;
    background: #ECF1F7;
    border: 1px solid #ECF1F7;
    border-radius: 10px;
    overflow: hidden;
    direction: rtl;
}

/* ═══════════════════════════════════════════════════════════════════
   תא יום בודד
   ═══════════════════════════════════════════════════════════════════ */
.mvt-cal-day {
    background: #FFFFFF;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 14px;
    font-weight: 700;
    color: #0F172A;
    padding: 4px 0;
    gap: 2px;
    position: relative;
    line-height: 1;
}
.mvt-cal-day:hover {
    background: rgba(180, 134, 41, 0.10);
    color: #8A631B;
    z-index: 2;
}

.mvt-cal-day .heb {
    font-size: 10px;
    font-weight: 600;
    color: #B48629;
    line-height: 1;
}
.mvt-cal-day .price {
    font-size: 11px;
    font-weight: 600;
    color: #2563EB;
    line-height: 1;
    margin-top: 1px;
    direction: ltr;
    white-space: nowrap;
    letter-spacing: -0.2px;
}

/* כשmode=hotel - גובה גדול יותר */
.mvt-cal.hotel-mode .mvt-cal-days { grid-auto-rows: 64px; }

/* יום נוכחי */
.mvt-cal-day.today {
    box-shadow: inset 0 0 0 2px #B48629;
    color: #B48629;
    background: rgba(180, 134, 41, 0.06);
    z-index: 2;
}
.mvt-cal-day.today .heb { color: #8A631B; font-weight: 800; }

/* יום נבחר (start / end) */
.mvt-cal-day.range-start,
.mvt-cal-day.range-end {
    background: linear-gradient(135deg, #D4A847, #B48629, #8A631B) !important;
    color: #FFFFFF !important;
    z-index: 3;
}
.mvt-cal-day.range-start .heb,
.mvt-cal-day.range-end .heb,
.mvt-cal-day.range-start .price,
.mvt-cal-day.range-end .price {
    color: rgba(255, 255, 255, 0.92) !important;
}

/* יום באמצע הטווח */
.mvt-cal-day.in-range {
    background: rgba(180, 134, 41, 0.16);
    color: #8A631B;
}
.mvt-cal-day.in-range .heb { color: #B48629; }
.mvt-cal-day.in-range .price { color: #2563EB; }

/* יום בעבר / disabled */
.mvt-cal-day.past,
.mvt-cal-day.disabled {
    background: #FAFBFC;
    color: #CBD5E1;
    cursor: not-allowed;
}
.mvt-cal-day.past:hover,
.mvt-cal-day.disabled:hover {
    background: #FAFBFC;
    color: #CBD5E1;
}
.mvt-cal-day.past .heb,
.mvt-cal-day.disabled .heb { color: #E2E8F0; }

/* תא ריק (לא בחודש הזה) */
.mvt-cal-day.empty {
    background: #FAFBFC;
    cursor: default;
    pointer-events: none;
}

/* ─── סטטוסי חסימה למלון ─── */
/* סגור לחלוטין - קו אופקי באמצע */
.mvt-cal-day.blocked-full {
    background: #F1F5F9 !important;
    color: #94A3B8 !important;
    cursor: not-allowed !important;
}
.mvt-cal-day.blocked-full::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 12%;
    right: 12%;
    height: 1.5px;
    background: #94A3B8;
    transform: translateY(-50%);
}
.mvt-cal-day.blocked-full .heb { color: #CBD5E1 !important; }
.mvt-cal-day.blocked-full .price { display: none; }
.mvt-cal-day.blocked-full:hover {
    background: #F1F5F9 !important;
    color: #94A3B8 !important;
}

/* סגור לכניסה (blocked_in) - קו אדום עדין משמאל-עליון */
.mvt-cal-day.blocked-in::before {
    content: '';
    position: absolute;
    top: 6px;
    right: 6px;
    width: 12px;
    height: 2px;
    background: #DC2626;
    transform: rotate(-45deg);
    transform-origin: right center;
    opacity: 0.75;
}

/* סגור ליציאה (blocked_out) - קו אדום עדין מימין-תחתון */
.mvt-cal-day.blocked-out::after {
    content: '';
    position: absolute;
    bottom: 6px;
    left: 6px;
    width: 12px;
    height: 2px;
    background: #DC2626;
    transform: rotate(-45deg);
    transform-origin: left center;
    opacity: 0.75;
}

/* ═══════════════════════════════════════════════════════════════════
   FOOTER - מידע + כפתורי פעולה
   ═══════════════════════════════════════════════════════════════════ */
.mvt-cal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    border-top: 1px solid #ECF1F7;
    background: #F8FBFD;
    gap: 12px;
}
.mvt-cal-summary {
    display: flex;
    gap: 14px;
    font-size: 12.5px;
    color: #64748B;
    flex-wrap: wrap;
}
.mvt-cal-summary b {
    color: #0F172A;
    font-weight: 800;
}
.mvt-cal-summary .nights {
    color: #B48629;
    font-weight: 800;
}

.mvt-cal-actions {
    display: flex;
    gap: 8px;
}
.mvt-cal-btn {
    padding: 8px 18px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    border: 1px solid transparent;
    font-family: inherit;
    transition: all 0.2s ease;
}
.mvt-cal-btn.cancel {
    background: transparent;
    color: #64748B;
    border-color: #DCE7F2;
}
.mvt-cal-btn.cancel:hover {
    background: #F1F5F9;
    color: #0F172A;
}
.mvt-cal-btn.apply {
    background: linear-gradient(135deg, #D4A847, #B48629, #8A631B);
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(180, 134, 41, 0.3);
}
.mvt-cal-btn.apply:hover {
    box-shadow: 0 6px 18px rgba(180, 134, 41, 0.4);
    transform: translateY(-1px);
}
.mvt-cal-btn.apply:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ═══════════════════════════════════════════════════════════════════
   MOBILE - חודש אחד, fullscreen popup
   ═══════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .mvt-cal {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100% !important;
        max-height: 100vh;
        border-radius: 0 !important;
        border: none;
        overflow-y: auto;
    }
    .mvt-cal-body {
        flex-direction: column;
        gap: 24px;
        padding: 14px;
    }
    .mvt-cal-body::before { display: none; }
    .mvt-cal-month { width: 100%; }
    .mvt-cal-month:nth-of-type(1) { order: 1; }  /* חודש 1 קודם */
    .mvt-cal-month:nth-of-type(2) { order: 2; }
    .mvt-cal-titles {
        gap: 0;
        flex-direction: column;
    }
    .mvt-cal-title:nth-of-type(2) { display: none; }  /* רק חודש אחד נראה */
    .mvt-cal-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .mvt-cal-actions { justify-content: space-between; }
    .mvt-cal-actions .mvt-cal-btn { flex: 1; }
}
