﻿
/* #region ========== Blazor error ========== */

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 3.5rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

/* #endregion */

/* #region ========== Calendar inline ========== */

/* Calendar cell with transition */
.calendar-cell {
    transition: background-color 0.3s ease, transform 0.2s ease;
}

    /* Selected cell with subtle pulse */
    .calendar-cell.selected {
        animation: pulseSelected 0.5s ease-out;
        background-color: #0ca678 !important;
        color: white;
    }

    /* Range cell (between selected dates) */
    .calendar-cell.range {
        background-color: #d3f9d8 !important;
    }

/* Pulse keyframes with gentle scale and light glow */
@keyframes pulseSelected {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(12, 166, 120, 0);
    }

    50% {
        transform: scale(1.02);
        box-shadow: 0 0 4px rgba(12, 166, 120, 0.3);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(12, 166, 120, 0);
    }
}


.calendar-cell:hover {
    background-color: #e3fafc;
}



/* #endregion */

/* #region ========== Map ========== */

/* Remove default padding/margin from popup content */
.leaflet-popup-content {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.3;
}

/* Remove excessive padding from the wrapper */
.leaflet-popup-content-wrapper {
    padding: 0 0 6px 0 !important; /* bottom padding lifts popup away from triangle */
    border-radius: 6px !important;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    background-color: #fff;
}

/* Ensure triangle is placed right under the popup */
.leaflet-popup-tip-container {
    /* No margin shift here! Let Leaflet handle it */
}

.leaflet-popup-tip {
    background: white; /* match card background */
}

/* Optional: make close button less intrusive */
.leaflet-popup-close-button {
    top: 6px !important;
    right: 8px !important;
    color: #555;
    font-size: 16px;
}

/* #endregion */

/* #region ========== CalendarSearch Component ========== */

.popup-calendar {
    font-family: system-ui, sans-serif;
    position: relative;
}

    .popup-calendar .calendar-popup {
        position: absolute;
        top: calc(100% + 4px);
        left: 0;
        z-index: 1050;
        background: white;
        border: 1px solid #dee2e6;
        border-radius: 0.5rem;
        padding: 1rem;
        width: 100%;
        max-width: 700px;
        min-width: 280px;
        box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
        box-sizing: border-box;
        overflow-x: hidden; /* Prevent scrollbar on desktop */
    }

/* Desktop / laptop view (≥768px) */
@media (min-width: 768px) {
    .popup-calendar .calendar-popup {
        width: 700px;
        overflow-x: visible;
    }

    .popup-calendar .calendar-inner {
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: space-between;
    }

    .popup-calendar .calendar-month {
        flex: 1;
        min-width: 320px;
    }
}

/* Mobile view (<768px) */
@media (max-width: 767px) {
    .popup-calendar .calendar-inner {
        flex-direction: column;
        flex-wrap: nowrap;
        gap: 0.5rem;
    }

    .popup-calendar .calendar-month {
        width: 100%;
    }

    .popup-calendar .day-cell {
        font-size: 0.75rem;
        height: 32px;
    }

    .popup-calendar .day-names div {
        font-size: 0.65rem;
    }
}


.popup-calendar .calendar-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

.popup-calendar .calendar-month {
    flex: 1 1 100%;
    min-width: 100%;
}

.popup-calendar .calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-top: 0.25rem;
    box-sizing: border-box;
}

.popup-calendar .day-cell {
    height: 36px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 0;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
    background: transparent;
    padding: 0;
    box-sizing: border-box;
}

    .popup-calendar .day-cell:hover {
        background: #e9ecef;
    }

    .popup-calendar .day-cell.empty {
        visibility: hidden;
    }

    .popup-calendar .day-cell.weekend {
        background-color: #f8f9fa;
        color: #6c757d;
    }

    .popup-calendar .day-cell.in-range {
        background-color: #d3f9d8;
        color: #212529;
    }

    .popup-calendar .day-cell.selected {
        background-color: #0ca678;
        color: white;
        font-weight: 700;
        z-index: 1;
    }

    .popup-calendar .day-cell.range-start {
        border-top-left-radius: 1rem;
        border-bottom-left-radius: 1rem;
    }

    .popup-calendar .day-cell.range-end {
        border-top-right-radius: 1rem;
        border-bottom-right-radius: 1rem;
    }

.popup-calendar .day-names {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

    .popup-calendar .day-names div {
        text-align: center;
        font-size: 0.7rem;
        font-weight: 600;
        text-transform: uppercase;
        color: #6c757d;
        height: 24px;
        display: flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
    }

/* Responsive behavior for mobile */
@media (min-width: 576px) {
    .popup-calendar .calendar-inner {
        flex-wrap: nowrap;
        justify-content: space-between;
    }

    .popup-calendar .calendar-month {
        flex: 1;
        min-width: 320px;
    }
}

/* #endregion */

/* #region  ========== Fade in ========== */

.fade-in-fast {
    opacity: 0;
    animation: fadeInFast 150ms ease-in forwards;
}

@keyframes fadeInFast {
    from {
        opacity: 0;
        transform: translateY(4px); /* optional slight motion */
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* #endregion */

/* #region ========== Card Hoover ========== */

.card-hover {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

    .card-hover:hover {
        transform: translateY(-4px);
        box-shadow: 0 0.75rem 1.25rem rgba(0, 0, 0, 0.15);
    }

/* #endregion */

/* #region ========== Card Rent ========== */

.card_rent {
    border: 1px solid #d0d0d0; /* More defined light gray border */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06); /* Subtle bottom shadow */
    border-radius: 0.5rem; /* Slight rounding for refinement */
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

    .card_rent:hover {
        background-color: #fcfcfc;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12); /* Noticeable hover shadow */
        border-color: #b0b0b0; /* Darken the border slightly on hover */
    }

    .card_rent .text-reset {
        text-decoration: none !important;
    }

/* #endregion */

/* #region ========== Loading overlay ========== */

.loading-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(3px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    border-radius: 0.5rem;
}

/* #endregion */

/* #region ========== Lazy loading ========== */

.lazy-image {
}

/* When image has loaded, we remove the blur via JS */
.lazy-image-loaded {
    filter: none !important;
}

/* Optional: placeholder background while loading */
.lazy-image::before {
    content: "";
    background: #f5f5f5;
    display: block;
}

/* #endregion */

/* #region ========== Filters hide/show support ========== */

@media (min-width: 576px) {
    #filters {
        display: block;
    }
}

.list-group-item-action:hover {
    background-color: var(--tblr-list-group-action-hover-bg) !important;
}

/* #endregion */

/* #region ========== Blur loading ========== */

.blur-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
    filter: blur(1px);
}

    .blur-loading::after {
        content: "";
        position: absolute;
        top: 50%;
        left: 50%;
        width: 2.5rem;
        height: 2.5rem;
        transform: translate(-50%, -50%);
        background: rgba(255, 255, 255, 0.7);
        border-radius: 50%;
        z-index: 10;
        background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-loader" width="40" height="40" viewBox="0 0 24 24" stroke="gray" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 6v-3" /><path d="M16.25 7.75l2.15 -2.15" /><path d="M18 12h3" /><path d="M16.25 16.25l2.15 2.15" /><path d="M12 18v3" /><path d="M7.75 16.25l-2.15 2.15" /><path d="M6 12h-3" /><path d="M7.75 7.75l-2.15 -2.15" /></svg>');
        background-repeat: no-repeat;
        background-position: center;
        background-size: 2rem 2rem;
        animation: spinner-rotate 1s linear infinite;
    }

    /* #endregion */

/* #region ================= Optional rotation effect  ================= */
@keyframes spinner-rotate {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}


/* #endregion */

/* #region ================= DropDown Countries ================= */

.dropdown_countries-list {
    max-height: 250px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0.25rem; /* Add space for hidden scrollbar */
    margin-right: -0.25rem; /* Compensate layout shift */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

    .dropdown_countries-list::-webkit-scrollbar {
        width: 0px; /* Chrome/Safari/Edge */
        background: transparent;
    }

.dropdown_countries-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
    font-size: 0.95rem;
    color: #212529;
}

    .dropdown_countries-item:hover {
        background-color: #f8f9fa;
    }

    .dropdown_countries-item img {
        width: 16px;
        height: 12px;
        object-fit: cover;
        border: 1px solid #dee2e6;
        border-radius: 2px;
    }

/* Optional: slightly rounded dropdown edges */
.dropdown_countries-dropdown {
    border-radius: 0.375rem;
}

/* #endregion */
