/* Body Styles */
body {
    background-color: #E5DED6;
}

/* WP Styling */
.page-header {
    display: none;
}

/* Apartments Section */
.apartments {
    background: #ffffff;
    width: 100%;
    margin: auto;
}

.apartments-caption {
    display: flex;
    line-height: 1.2;
    color: #ffffff;
    text-align: center;
    background: #15284B;
    justify-content: space-between;
}

.apartments-caption a {
    color: #ffffff;
    text-decoration: none;
}

.apartments-caption a:hover {
    color: rgba(255, 255, 255, 0.85);
}

.apartments-sorting {
    display: inline-block;
    position: relative;
    padding: 10px 25px;
}

.apartments-sorting:after {
    content: "";
    position: absolute;
    right: 0;
    top: 20px;
    width: 17px;
    height: 6px;
    background: transparent url("upload/up-down.svg") 50% 50% no-repeat;
    background-size: 100% 100%;
    opacity: 0.6;
}

.apartments-sorting.active:after {
    opacity: 1;
}

.apartments-list {
    padding: 10px 0 41px;
}

/* Individual Apartment Section */
.apartment {
    margin-bottom: 10px;
    display: block;
}

.apartment.open .apartment-caption {
    background-color: #f7f7f7;
}

.apartment.open .apartment-content {
    display: flex;
}

.apartment-caption {
    cursor: pointer;
    display: flex;
    align-items: center;
    color: #5b5754;
    text-align: center;
    border: 1px solid #cccccc;
    padding: 12px 0;
    justify-content: space-between;
    position: relative;
    background: transparent;
    z-index: 5;
}

.apartment-caption div:not(.apartment-caption-status) {
    padding: 0 25px;
}

.apartment-caption a {
    color: #ffffff;
}

.apartment-caption a:hover {
    color: rgba(255, 255, 255, 0.85);
}

.apartment-caption-bg {
    opacity: 0.51;
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    z-index: -1;
}

.apartment-content {
    display: none;
    flex-direction: row;
    align-items: center;
}

.apartment-info {
    padding: 30px;
}

.apartment-img {
    display: flex;
    justify-content: center;
}

.apartment-img img {
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: zoom-in;
    transition: opacity 0.2s ease;
}

.apartment-img img:hover {
    opacity: 0.8;
}

/* Apartment Status Indicators */
.Udlejet:after,
.Ledig:after,
.Reserveret:after {
    border-radius: 50%;
    display: inline-block;
    margin-left: 10px;
    content: "";
    justify-content: center;
    align-self: center;
    height: 1em;
    width: 1em;
}

.Udlejet:after {
    background-color: #dd3333;
}

.Ledig:after {
    background-color: #7bbf3b;
}

.Reserveret:after {
    background-color: #e5d120;
}

.legend {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    padding: 14px 0 16px;
    background: #ffffff;
}

.legend-container {
    display: flex;
    flex-wrap: wrap;
    flex-basis: 100%;
}

.complex-flip-button-wrapper {
    white-space: nowrap;
    font-size: 14px;
    display: inline-block;
    padding: 10px 15px;
    border-radius: 30px;
}

.complex-flip-button-container {
    display: flex;
    flex-basis: 50%;
    justify-content: flex-end;
}

.legend-item {
    display: flex;
    align-items: center;
    flex-basis: 25%;
    max-width: 25%;
    padding: 5px;
}

.legend-item-icon {
    border-radius: 50%;
    width: 1em;
    height: 1em;
}

.legend-item-title {
    flex-grow: 1;
    padding-left: 15px;
    font-size: 16px;
    line-height: 1.25;
}

/* Content Section */
.apartment-block-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-right: auto;
    margin-left: auto;
}

/* Adjustments for Complex Elements */
.complex {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    overflow: hidden;
    position: relative;
    background: #ffffff;
    justify-content: space-between;
}

.complex-image {
    flex-basis: 60%; /* Allocates left-hand space as needed */
    max-width: 100%;
    height: 60vh;
    background-color: transparent;
}
/*
.complex-image .reserved {
    fill: #b6b6b6;
}

.complex-image .udlejet {
    fill: #910030;
}

.complex-image .ledig {
    fill: #ffffff;
}

.complex-image .selected {
    fill: #5b5754;
}

.complex-image .hover,
.complex-image polygon:hover,
.complex-image path:hover,
.complex-image rect:hover {
    fill: #5b5754;
}
*/
.complex-image svg {
    width: 100%;
    height: 100%;
    display: block;
    margin: 0 auto;
}

.complex-image g {
    opacity: 1;
}

.complex-image polygon,
.complex-image path,
.complex-image polyline,
.complex-image rect {
    opacity: 0.3 !important;
}

.complex-image polygon:hover,
.complex-image path:hover,
.complex-image polyline:hover,
.complex-image rect:hover {
    opacity: 0.8 !important;
    cursor: pointer;
}

/* Zoom style */
.complex-zoom {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translate3d(-50%, 0, 0);
    width: 403px;
    padding: 0 15px;
    max-width: 100%;
}

.complex-zoom-slider {
    position: relative;
    width: 100%;
    height: 7px;
    background: #d8d9dc;
}

.complex-zoom-slider .ui-slider-handle {
    background-color: #5b5754;
    position: absolute;
    z-index: 2;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    top: -5px;
    margin-left: -8px;
    cursor: pointer;
}

.complex-zoom-slider .ui-slider-handle:hover {
    background-color: #3c3a37;
}

/* Slider Section */
.ui-slider {
    position: relative;
    width: 100%;
    height: 7px;
    background: #d8d9dc;
}

.ui-slider .ui-slider-handle {
    position: absolute;
    z-index: 2;
    top: -5px;
    margin-left: -8px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
}

/* Buttons Section */
.seeMoreBtn,
.downloadFloorPlanBtn {
    background-color: #C49A6C;
    padding: 10px;
    border-radius: 20px;
    color: white !important;
}

.seeMoreBtn:hover,
.downloadFloorPlanBtn:hover {
    background-color: #a88257;
    color: #e8e8e8;
}

/* Transparent Background Adjustments */
.legend,
.apartments-list {
    background-color: transparent;
}

/* Table.. */
.apartments-caption > div:first-of-type,
.apartment-caption > div:nth-of-type(2) {
    text-align: left;
}

.apartments-caption > div:last-of-type,
.apartment-caption > div:last-of-type {
    text-align: right;
}

/* Legend responsiveness */
.legend-container-full {
    flex-basis: 100%;
}

.legend-container-half,
.complex-flip-button-container-half {
    flex-basis: 50%;
}

/* Media query breakpoints */
@media (max-width: 320px) {

}

@media (max-width: 599px) {
    .legend-container {
        flex-wrap: wrap;
        flex-direction: row;

        .legend-item {
            flex-basis: 50%;
            max-width: 50%;
        }
    }

    .apartments-caption, .apartment-caption {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .apartments-caption > div, .apartment-caption > div {
        width: 100% !important;
        text-align: left!important;
    }

    .apartment-caption > div:not(:first-of-type):before {
        content: attr(title)":";
    }

    .apartment-caption .status {
        display: flex;

        .apartment-caption-status {
            padding-left: 3px;
        }
    }

    .apartment-caption {
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: flex-start;
    }
}

@media (max-width: 768px) {
    .legend {
        flex-direction: column;
        align-items: center;
        width: 90%;
        margin: auto;

        .legend-container-full,
        .legend-container-half,
        .complex-flip-button-container-half {
            flex-basis: 100%;
        }

        .legend-container {
            margin-bottom: 10px;
            margin-right: -10%;
        }

        .legend-container,
        .complex-flip-button-container,
        .complex-flip-button-wrapper {
            width: 100%;
        }

        .complex-flip-button-wrapper {
            text-align: center;
        }

        .complex-flip-button-wrapper > a {
            padding: 0 15px;
        }
    }

    .apartments-caption div {
        width: 100%!important;
        display: flex;
        justify-content: flex-start;
        flex-direction: row;
        flex-wrap: nowrap;
    }

    .apartments-content {
        .apartments-caption {
            flex-direction: column;
            flex-wrap: nowrap;
            align-items: flex-start;
        }
    }

    .apartment-content {
        flex-direction: column;
        flex-wrap: nowrap;

        .apartment-info {
            max-width: 100%;
            width: 100%;

            h3 {
                font-size: 1.3rem;
            }

            tbody {
                font-size: 0.9rem;
            }
        }

        .apartment-info-btns {
            margin-top: 30px;
            display: flex;
            flex-direction: column;
            flex-wrap: nowrap;
            align-items: flex-start;
        }

        .apartment-info-btns > a {
            margin-bottom: 10px;
            font-size: 0.9rem;
        }

        .apartment-img {
            margin-top: 10px;
            align-self: center;
        }
    }
}

@media (max-width: 992px) {
    .legend-container-half {
        flex-basis: 70%;
    }
    .complex-flip-button-container-half {
        flex-basis: 30%;
    }
}

@media (max-width: 1200px) {
    .legend-container-half {
        flex-basis: 60%;
    }
    .complex-flip-button-container-half {
        flex-basis: 40%;
    }
}

/* Tooltip Styles */
.apartment-tooltip {
    position: absolute;
    z-index: 10000;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 0;
    min-width: 200px;
    max-width: 300px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-5px);
    transition: all 0.2s ease-in-out;
    font-family: Arial, sans-serif;
    font-size: 14px;
    line-height: 1.4;
}

.apartment-tooltip.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.apartment-tooltip .tooltip-header {
    padding: 12px 16px;
    border-radius: 8px 8px 0 0;
}

.apartment-tooltip .tooltip-title {
    font-weight: 600;
    color: #333;
    font-size: 13px;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    display: block;
    width: 100%;
}

.apartment-tooltip .tooltip-content {
    padding: 16px;
}

.apartment-tooltip .tooltip-info {
    display: flex;
    flex-direction: column;
}
.apartment-tooltip .tooltip-status,
.apartment-tooltip .tooltip-price,
.apartment-tooltip .tooltip-size,
.apartment-tooltip .tooltip-rooms,
.apartment-tooltip .tooltip-available,
.apartment-tooltip .tooltip-parking {
    color: #666;
    font-size: 13px;
    position: relative;
    text-align: right;
}

.complex-image polygon.apartment-selected,
.complex-image path.apartment-selected,
.complex-image polyline.apartment-selected,
.complex-image rect.apartment-selected,
.complex-image polygon.apartment-hover,
.complex-image path.apartment-hover,
.complex-image polyline.apartment-hover,
.complex-image rect.apartment-hover {
    opacity: 0.8 !important;
}

/* Lightbox Styles */
.apartment-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
}

.apartment-lightbox.active {
    display: block;
}

.apartment-lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

.apartment-lightbox-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    box-sizing: border-box;
}

.apartment-lightbox-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    background: #fff;
}

.apartment-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    color: #333;
    transition: all 0.3s ease;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.icon {
    --size: 20px;
    --padding: 5px;
    display: flex;
    justify-content: space-between;
    padding: var(--padding) 0;
    border-bottom: 1px solid #eee;
    position: relative;
}

.icon:before {
    content: '';
    width: var(--size);
    height: var(--size);
    position: absolute;
    background-color: transparent;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    left: 0;
    top: calc(50% - (var(--size) / 2));
}
.icon.rent:before {
    background-image: url("../img/Rent.svg");
}
.icon.size:before {
    background-image: url("../img/Size.svg");
}
.icon.rooms:before {
    background-image: url("../img/Rooms.svg");
}
.icon.available:before {
    background-image: url("../img/Available.svg");
}
.icon.reserved:before {
    background-image: url("../img/Reserved.svg");
}
.icon.moveIn:before {
    background-image: url("../img/MoveIn.svg");
}
.icon.unavailable:before {
    background-image: url("../img/Unavailable.svg");
}

.icon .text {
    margin-left: calc(var(--size) + 5px);
}

@media (max-width: 768px) {
    .apartment-lightbox-content {
        padding: 20px;
    }

    .apartment-lightbox-close {
        width: 40px;
        height: 40px;
        font-size: 26px;
        top: 10px;
        right: 10px;
    }
}
