/* ==========================================================
   HOTEL SEARCH — CALENDAR (date range picker)
   Изворно: public.css

   Стилови за custom "book-style" календарот (.custom-calendar-wrapper
   .calendar-container.book-style) кој се отвора кога корисникот
   кликне на Check-in/Check-out полињата во search формата —
   вклучува header (prev/next/месец-година), weekdays grid,
   days grid, footer (selection info + clear копче), плус целата
   responsive адаптација (mobile modal, landscape, tablet).
   ========================================================== */

.custom-calendar-wrapper .calendar-container.book-style {
    position: absolute;
    left: 0;
    right: 0;
    background: #fff;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    margin-top: 8px;
    padding: 20px;
    min-width: 400px;
    max-width: 600px;
    margin: 0 auto;
}

.custom-calendar-wrapper .calendar-book {
    display: flex;
    gap: 20px;
}

.custom-calendar-wrapper .calendar-page {
    flex: 1;
    background: #fafafa;
    border-radius: 8px;
    padding: 16px;
    border: 1px solid #e9ecef;
}

.custom-calendar-wrapper .calendar-page.left-page {
    border-right: 2px solid #dee2e6;
    margin-right: -1px;
}

.custom-calendar-wrapper .calendar-page.right-page {
    border-left: 2px solid #dee2e6;
    margin-left: -1px;
}

.custom-calendar-wrapper .calendar-header {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    min-height: 40px;
}

.custom-calendar-wrapper .calendar-header button {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 0px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    color: #007cba;
    font-weight: bold;
    min-width: auto;
    height: auto;
}

.custom-calendar-wrapper .calendar-header button:hover {
    background-color: #e3f2fd;
    transform: scale(1.1);
}

.custom-calendar-wrapper .calendar-month-year {
    font-size: 16px;
    font-weight: 700;
    color: #2c3e50;
    text-align: center;
    flex: 1;
}

.custom-calendar-wrapper .calendar-weekdays {
    display: grid !important;
    grid-template-columns: repeat(7, 1fr) !important;
    gap: 2px;
    margin-bottom: 8px;
}

.custom-calendar-wrapper .weekday {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: #6c757d;
    padding: 6px 2px;
    text-transform: uppercase;
    background: #f1f3f4;
    border-radius: 3px;
}

.custom-calendar-wrapper .calendar-days {
    display: grid !important;
    grid-template-columns: repeat(7, 1fr) !important;
    gap: 2px;
}

.custom-calendar-wrapper .calendar-day {
    aspect-ratio: 1;
    display: flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
    min-height: 32px;
    background: white;
    border: 1px solid transparent;
}

.custom-calendar-wrapper .calendar-day:hover:not(.disabled):not(.other-month) {
    background-color: #e3f2fd;
    transform: scale(1.05);
    border-color: #007cba;
}

.custom-calendar-wrapper .calendar-day.other-month {
    color: #adb5bd;
    cursor: default;
    visibility: hidden !important;
    background: #f8f9fa;
}

.custom-calendar-wrapper .calendar-day.disabled {
    color: #dee2e6;
    cursor: not-allowed;
    background-color: #f8f9fa;
    position: relative;
}

.custom-calendar-wrapper .calendar-day.selected.checkin {
    background-color: #E57757 !important;
    color: white;
    font-weight: 700;
}

.custom-calendar-wrapper .calendar-day.selected.checkout {
    background-color: #e57757 !important;
    color: white;
    font-weight: 700;
}

.custom-calendar-wrapper .calendar-day.in-range {
    background-color: #F3E8E1;
    color: #00332A;
    font-weight: 600;
}

.custom-calendar-wrapper .calendar-day.hover-range {
    background-color: #F3E8E1;
    color: #00332A;
    font-weight: 500;
    border: 1px dashed #F3E8E1;
    opacity: 0.8;
}

.custom-calendar-wrapper .calendar-day.today {
    border: 2px solid #007cba;
    font-weight: 700;
}

.custom-calendar-wrapper .calendar-footer {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    margin-top: 16px;
    border-top: 1px solid #e1e5e9;
}

.custom-calendar-wrapper .selection-info {
    font-size: 14px;
    font-weight: 600;
    color: #007cba;
}

.custom-calendar-wrapper .nights-display {
    background: #e3f2fd;
    padding: 8px 12px;
    border-radius: 6px;
}

.custom-calendar-wrapper .calendar-clear {
    background: none !important;
    border: 2px solid #6c757d !important;
    color: #6c757d;
    padding: 4px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    height: auto;
}

.custom-calendar-wrapper .calendar-clear:hover {
    background-color: #6c757d !important;
    color: white;
}

.custom-calendar-wrapper .form-date-search {
    cursor: pointer;
}

.custom-calendar-wrapper .form-date-search.form-calendar-open {
    box-shadow: 0px 5px 20px rgba(0, 0, 0, 0.1);
    border-radius: 50px;
}

.calendar-close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    font-weight: bold;
    color: #666;
    cursor: pointer;
    z-index: 10001;
    user-select: none;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    display: none;
}

.calendar-close-btn:hover {
    color: #000;
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

/* ==========================================================
   CALENDAR RESPONSIVE STYLES
   ========================================================== */

/* Телефони + Mini (≤767px) — компактен fixed modal, само
   тековниот месец видлив (следниот се отвора со next копчето) */
@media (max-width: 767px) {
    .custom-calendar-wrapper .calendar-container.book-style {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: 92vw !important;
        max-width: 400px !important;
        min-width: auto !important;
        padding: 12px;
        max-height: 78vh !important;
        overflow-y: auto !important;
        z-index: 10000 !important;
        height: auto !important;
    }

    .custom-calendar-wrapper .calendar-book {
        flex-direction: column;
        gap: 8px;
        position: relative;
    }

    .custom-calendar-wrapper .calendar-page {
        padding: 10px;
        border: 1px solid #e9ecef;
    }

    .custom-calendar-wrapper .calendar-page.left-page,
    .custom-calendar-wrapper .calendar-page.right-page {
        border: 1px solid #e9ecef;
        margin: 0;
    }

  
   /* Вистинско центрирање: prev копчето излегува од flow-от
       (absolute), насловот природно го зазема целото место
       и се центрира геометриски во ширината на календарот */
    .custom-calendar-wrapper .calendar-page.left-page .calendar-header {
        position: relative;
        justify-content: center;
    }

    .custom-calendar-wrapper .calendar-page.left-page .calendar-header .calendar-prev {
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        margin: 0 !important;
    }

    /* Десниот месец — next копчето, фиксно позиционирано
       (независно од центрирањето на насловот, нема веќе
       конфликт помеѓу двете) */
    .custom-calendar-wrapper .calendar-page.right-page {
        position: absolute;
        top: 0;
        right: 44px;
        width: auto;
        padding: 10px;
        border: none;
        background: transparent;
        margin: 0;
        z-index: 2;
    }

    .custom-calendar-wrapper .calendar-page.right-page .calendar-weekdays,
    .custom-calendar-wrapper .calendar-page.right-page .calendar-days {
        display: none !important;
    }

    .custom-calendar-wrapper .calendar-page.right-page .calendar-month-year {
        display: none;
    }

    .custom-calendar-wrapper .calendar-page.right-page .calendar-header {
        margin-bottom: 0;
        min-height: auto;
    }

    .custom-calendar-wrapper .calendar-header {
        margin-bottom: 8px;
        min-height: 32px;
    }

    .custom-calendar-wrapper .calendar-month-year {
        font-size: 14px;
    }

    .custom-calendar-wrapper .weekday {
        font-size: 10px;
        padding: 4px 1px;
    }

    .custom-calendar-wrapper .calendar-day {
        min-height: 26px;
        font-size: 12px;
        border-radius: 4px;
    }

    .custom-calendar-wrapper .calendar-footer {
        padding-top: 10px;
        margin-top: 10px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .custom-calendar-wrapper .nights-display {
        font-size: 12px;
        padding: 6px 10px;
    }

    .custom-calendar-wrapper .calendar-clear {
        font-size: 12px;
        padding: 6px 12px;
    }

    .calendar-close-btn {
        display: flex !important;
        top: 6px !important;
        right: 6px !important;
        z-index: 20 !important;
    }

    body.calendar-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
        height: 100%;
    }

    .mobile-calendar {
        touch-action: pan-y;
    }
}

/* Помал телефон (≤340px) — дополнителна компресија */
@media (max-width: 340px) {
    .custom-calendar-wrapper .calendar-container.book-style {
        width: 98vw !important;
        max-width: 98vw !important;
        padding: 8px !important;
        max-height: 90vh !important;
    }

    .custom-calendar-wrapper .calendar-book {
        gap: 8px;
    }

    .custom-calendar-wrapper .calendar-page {
        padding: 8px;
    }

    .custom-calendar-wrapper .calendar-day {
        min-height: 24px;
        font-size: 11px;
    }

    .custom-calendar-wrapper .weekday {
        font-size: 9px;
        padding: 3px 1px;
    }

    .custom-calendar-wrapper .calendar-month-year {
        font-size: 13px;
    }
}

/* Air / Pro portrait (769–1024px) — двата месеци еден до
   друг, side-by-side, како оригиналниот desktop изглед */
@media (min-width: 768px) and (max-width: 1024px) {
    .custom-calendar-wrapper .calendar-container.book-style {
        position: absolute;
        top: 100%;
        left: 5%;
        right: 5%;
        width: 90%;
        max-width: 900px;
        min-width: auto;
        padding: 16px;
    }

    .custom-calendar-wrapper .calendar-book {
        flex-direction: row;
        gap: 20px;
    }

    .custom-calendar-wrapper .calendar-page.left-page,
    .custom-calendar-wrapper .calendar-page.right-page {
        border: 1px solid #e9ecef;
        margin: 0;
    }

    .custom-calendar-wrapper .calendar-day {
        min-height: 30px;
        font-size: 12px;
    }
}

@media (hover: none) and (pointer: coarse) {
    .custom-calendar-wrapper .calendar-day {
        min-height: 32px;
        padding: 2px;
    }

    .custom-calendar-wrapper .calendar-day:hover {
        transform: none;
    }

    .custom-calendar-wrapper .calendar-header button {
        min-height: 36px;
        min-width: 36px;
    }
}