body {
    overflow-x: hidden;
    position: relative;
}

/* Custom extra-small button style */
.btn-xs {
    padding: .15rem .3rem;
    font-size: .75rem;
    border-radius: .2rem;
}

#profile-icon {
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 1050;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid #ccc;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

    #profile-icon img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    #profile-icon .dropdown-menu {
        position: fixed !important;
        z-index: 9999 !important;
        top: 60px;
        right: 15px;
        background-color: #fff;
        color: #212529;
    }

    #profile-icon .dropdown .nav-link {
        display: flex;
        align-items: center;
        padding: 0;
        width: 100%;
        height: 100%;
    }

        #profile-icon .dropdown .nav-link img {
            width: 40px;
            height: 40px;
            object-fit: cover;
        }

    #profile-icon .dropdown-menu.show {
        position: fixed !important;
        top: 58px !important;
        right: 15px !important;
        left: auto !important;
        margin: 0 !important;
        transform: none !important;
        will-change: unset !important;
    }

/* ---------------- Sidebar ---------------- */
#sidebar {
    position: fixed;
    top: 0;
    width: 180px;
    height: 100%;
    background-color: #f8f9fa;
    transition: all 0.3s ease-in-out;
    z-index: 1045;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Default hidden positions */
html[dir="ltr"] #sidebar {
    left: -180px;
    right: auto;
}

html[dir="rtl"] #sidebar {
    right: -180px;
    left: auto;
}

/* Active (visible) positions */
html[dir="ltr"] #sidebar.active {
    left: 0;
}

html[dir="rtl"] #sidebar.active {
    right: 0;
}

/* Sidebar header */
#sidebar-header {
    padding: 20px;
    text-align: center;
}

    #sidebar-header img {
        max-width: 80px;
        height: auto;
        margin-bottom: 10px;
    }

    #sidebar-header .input-group {
        margin-bottom: 15px;
    }

#sidebar-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    text-decoration: none;
    color: #333;
    transition: background-color 0.2s ease-in-out;
}

    #sidebar-menu li a:hover {
        background-color: #e9ecef;
    }

    #sidebar-menu li a i {
        margin-right: 10px;
    }


/* --- Sidebar toggle button --- */
#sidebar-toggle {
    position: fixed;
    top: 70px; /* adjust to your header height */
    z-index: 1100;
    width: 40px !important;
    height: 40px !important;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Position toggle button according to dir */
html[dir="ltr"] #sidebar-toggle {
    left: 10px;
    right: auto;
}

html[dir="rtl"] #sidebar-toggle {
    right: 10px;
    left: auto;
}

/* --- Submenu tree style --- */
#sidebar-menu .submenu {
    display: none;
    padding-left: 1rem; /* LTR indent */
    padding-right: 0; /* reset for RTL */
    border-left: 2px solid #ddd; /* tree line */
    margin-left: 0.5rem;
}

html[dir="rtl"] #sidebar-menu .submenu {
    padding-right: 1rem;
    padding-left: 0;
    border-left: none;
    border-right: 2px solid #ddd;
    margin-right: 0.5rem;
}

#sidebar-menu .has-submenu > a::after {
    content: "\f107"; /* bootstrap icon chevron-down */
    font-family: "Bootstrap-icons";
    float: right;
}

html[dir="rtl"] #sidebar-menu .has-submenu > a::after {
    float: left;
}

/* Optional: smaller font/icons for children */
#sidebar-menu .submenu .nav-link {
    font-size: 0.9rem;
    padding: 4px 12px;
}

/* ---------------- Content shift ---------------- */
#content {
    padding: 20px;
    transition: margin 0.3s ease-in-out;
}

html[dir="ltr"] #content.active {
    margin-left: 180px;
}

html[dir="rtl"] #content.active {
    margin-right: 180px;
}

/* ---------------- Toggle button ---------------- */
#sidebar-toggle {
    position: fixed;
    top: 10px;
    z-index: 1046;
    cursor: pointer;
}

/* Default positions */
html[dir="ltr"] #sidebar-toggle {
    left: 5px;
    right: auto;
}

html[dir="rtl"] #sidebar-toggle {
    right: 5px;
    left: auto;
}

/* Active (when sidebar is open) */
html[dir="ltr"] #sidebar-toggle.active {
    left: 185px; /* 180 + margin */
}

html[dir="rtl"] #sidebar-toggle.active {
    right: 185px;
}

/* ---------------- Submenus ---------------- */
.has-submenu .submenu {
    display: none;
    padding-left: 20px;
    background-color: #f0f0f0;
}

.has-submenu.open > .submenu {
    display: block;
}

/* ---------------- Properties ---------------- */
#property-section {
    display: none;
}

.property-card {
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

    .property-card:hover {
        transform: scale(1.05);
        box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.2);
    }

.card-img-container {
    height: 80%;
    overflow: hidden;
    display: flex;
    align-items: center;
}

    .card-img-container img {
        width: 100%;
        height: auto;
        object-fit: cover;
    }

/* ---------------- Calendar ---------------- */
#calendar-section {
    display: none;
}

.flatpickr-calendar {
    background: #fff;
    border: 1px solid #ccc;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 10px;
    border-radius: 5px;
}

.flatpickr-day {
    border-radius: 5px;
    padding: 0.5em;
    cursor: pointer;
    transition: background 0.3s ease;
}

    .flatpickr-day.today {
        font-weight: bold;
        border: 1px solid blue;
    }

    .flatpickr-day.booked {
        background-color: #f0ad4e;
        color: white;
    }

    .flatpickr-day:hover,
    .flatpickr-day.selected {
        background: #007bff;
        color: #fff;
    }

#bookingModal {
    display: none;
}

.flatpickr-day.manual-booked {
    background-color: #5cb85c !important;
    color: white !important;
    border: none !important;
}

    .flatpickr-day.manual-booked:hover,
    .flatpickr-day.manual-booked.selected {
        background-color: #5cb85c !important;
        color: white !important;
    }

/* ---------------- Calendar responsiveness ---------------- */
@media (min-width: 769px) {
    #calendar-section .row > div {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

@media (max-width: 768px) {
    #booked-dates-panel {
        width: 100%;
        margin-top: 20px;
    }

    #calendar-section .row > div {
        width: 100%;
    }
}

/* Booked day style */
.calendar-day.manual-booked .day-content {
    background-color: #5cb85c !important;
    color: white !important;
    border-radius: 5px;
}

#calendar-container * {
    pointer-events: auto !important;
}

/* Section spacing */
.section {
    padding-top: 1rem;
    padding-bottom: 4rem;
}

/* ---------------- Mobile Sidebar ---------------- */
@media (max-width: 767.98px) {
    #sidebar {
        top: 0;
        height: 100vh;
        padding-top: 70px;
        box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
    }

    .sidebar-toggle-btn {
        position: fixed;
        top: 15px;
        z-index: 1100;
    }

    html[dir="ltr"] .sidebar-toggle-btn {
        left: 15px;
        right: auto;
    }

    html[dir="rtl"] .sidebar-toggle-btn {
        right: 15px;
        left: auto;
    }

    .wrapper {
        flex-direction: column;
    }

    .main-content-area {
        width: 100%;
        padding-left: 0;
        padding-right: 0;
    }

    .site-nav {
        z-index: 1030;
    }

        .site-nav form .form-control {
            max-width: 500px;
        }

    @media (max-width: 576px) {
        .input-group input {
            font-size: 0.9rem;
        }

        .input-group .btn {
            padding: 0.375rem 0.5rem;
        }
    }
}
