/* Thiết lập chung */
@font-face {
  font-family: "Montserrat";
  src: url("./assets/images/font/Montserrat-Regular.ttf") format("truetype");
}
* {

    margin: 0;

    padding: 0;

    box-sizing: border-box;

    font-family: "Montserrat" Arial, sans-serif;

}





/* Container và hình ảnh */

.containerbtt {

    width: 100vw;

    height: 100vh;

    position: relative;

    cursor: grab;

    overflow: hidden;

    touch-action: pan-x;

    will-change: contents;

    perspective: 1000px;

    background-color: #000;

    margin-right: 0% !important;

    margin-left: 0% !important;

}



.containerbtt:active {

    cursor: grabbing;

}



.containerbtt img {

    width: 100%;

    height: 100%;

    object-fit: cover;

    position: absolute;

    top: 0;

    left: 0;

    display: none;

    opacity: 0;

    transition: opacity 0.15s ease-out;

    transform: translateZ(0);

    backface-visibility: hidden;

    user-select: none;

    -webkit-user-drag: none;

}



.containerbtt img.active {

    display: block;

    opacity: 1;

}



.inertia-active .containerbtt img.active {

    transition: opacity 0.08s ease-out;

}



/* Loading Screen và Video Intro */

.loading-overlay {

    position: fixed;

    top: 0;

    left: 0;

    width: 100%;

    height: 100%;

    background-color: #000;

    display: flex;

    flex-direction: column;

    justify-content: center;

    align-items: center;

    z-index: 9999;

    transition: opacity 0.5s ease;

    overflow: hidden;

}



/* Video Intro */

.intro-video {

    width: 100%;

    height: 100%;

    object-fit: cover;

    position: absolute;

    background-image: url(./backgroudloading.png);

    background-repeat: no-repeat;

    background-size: cover;

    top: 0;

    left: 0;

    z-index: 1;

    opacity: 1;

    transition: opacity 0.5s ease;

}



/* Ẩn video khi tất cả hình ảnh đã tải xong */

.loading-complete .intro-video {

    opacity: 0.3;

    transition: opacity 0.5s ease;

}



/* Status bar */

.loading-status {

    position: absolute;

    top: 50%;

    left: 50%;

    transform: translate(-50%, -50%);

    width: 100%;

    display: flex;

    flex-direction: column;

    align-items: center;

    z-index: 2;

    padding: 0 20px;

    opacity: 0.7;

    transition: opacity 0.3s ease;

}



.loading-progress {

    width: 400px;

    height: 30px;

    background-color: rgba(126, 125, 125, 0.363);

    border-radius: 10px;

    overflow: hidden;

    transform: translateZ(0);

    margin-bottom: 10px;

}



.loading-progress-bar {

    height: 100%;

    background-color: #fff;

    width: 0%;

    transition: width 0.3s ease;

    will-change: width;

}



.loading-text {

    color: white;

    font-size: 16px;

    text-transform: uppercase;

    letter-spacing: 2px;

    opacity: 1;

}



/* Skip button -> Start button */

.skip-button {

    position: absolute;

    bottom: 40px;

    left: 50%;

    transform: translateX(-50%);

    background: rgba(255, 255, 255, 0.2);

    color: white;

    border: none;

    padding: 12px 40px;

    border-radius: 6px;

    cursor: pointer;

    z-index: 3;

    font-size: 16px;

    font-weight: 500;

    transition: background 0.3s, opacity 0.5s ease-in-out, transform 0.3s ease;

    opacity: 0;

    animation: fadeInButton 0.5s forwards;

    letter-spacing: 1px;

    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);

    text-transform: uppercase;

}



@keyframes fadeInButton {

    from {

        opacity: 0;

        transform: translate(-50%, 10px);

    }

    to {

        opacity: 1;

        transform: translate(-50%, 0);

    }

}



.skip-button:hover {

    background: rgba(255, 255, 255, 0.4);

}



/* Ẩn thanh tiến trình khi tải xong */

.loading-complete .loading-progress,

.loading-complete #loadingPercent {

    opacity: 0;

    transition: opacity 0.5s ease;

}



/* Rectangle Styles */

.rectangle {

    position: absolute;

    z-index: 1;

    transition: border-color 0.3s ease, opacity 0.3s ease, transform 0.3s ease, z-index 0s linear 0.2s;

    border: 2px solid transparent;

    cursor: pointer;

    display: none;

}



.rectangle.hovered {

    z-index: 100;

    background-color: #02ff2c;

    border-color: #fff477;

    transition-delay: 0s;

    opacity: 0.8;

    transform: scale(1.02);

}



.rectangle.hovered .apartment-tooltip {

    opacity: 1;

    transform: translateY(-50%);

}



.rectangle::before {

    content: '';

    position: absolute;

    width: 10px;

    height: 10px;

    background: #ffffff;

    border-radius: 50%;

    top: 50%;

    left: 50%;

    transform: translate(-50%, -50%);

    z-index: 99;

    opacity: 0;

    transition: opacity 0.3s ease;

}



.rectangle:hover::before {

    opacity: 1;

}



.rectangle::after {

    content: '';

    position: absolute;

    height: 2px;

    background: #ffffffa8;

    top: 50%;

    transform: translateY(-50%);

    left: calc(50% + 5px);

    width: 0;

    transition: width 0.3s ease 0.1s;

    z-index: 99;

}



.rectangle:hover::after {

    width: 50px;

}



.rectangle.tooltip-left .apartment-tooltip {

    left: auto;

    right: calc(100% + 45px);

}



.rectangle.tooltip-left::after {

    left: auto;

    right: calc(50% + 5px);

    width: 0;

}



.rectangle.tooltip-left:hover::after {

    width: 30px;

}



/* Tooltip Styles */

.apartment-tooltip {

    position: absolute;

    font-family: "Montserrat" 'UTM Optima', sans-serif;

    z-index: 101;

    background-color: #699144c9;

    color: #fff477;

    border-radius: 15px;

    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);

    padding: 8px 12px;

    width: fit-content;

    max-width: 300px;

    opacity: 0;

    font-size: 14px;

    line-height: 1.5;

    white-space: nowrap;

    transition: opacity 0.3s ease 0.1s;

    top: 50%;

    transform: translateY(-50%);

    left: calc(100% + 45px);

    pointer-events: none;

}



.rectangle:hover .apartment-tooltip {

    opacity: 1;

}



/* Reset Button */

#resetBtn {

    position: fixed;

    top: 20px;

    right: 20px;

    background: linear-gradient(135deg, rgb(240,234,216));

    color: #A97C50;

    border: none;

    padding: 12px 20px;

    border-radius: 50px;

    cursor: pointer;

    z-index: 100;

    font-weight: 500;

    transition: all 0.3s ease;

    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);

    display: flex;

    align-items: center;

    gap: 8px;

    font-size: 15px;

    backdrop-filter: blur(5px);

    -webkit-backdrop-filter: blur(5px);

    border: 1px solid rgba(255, 255, 255, 0.1);

    letter-spacing: 0.5px;

    animation: fadeInButton 0.5s ease-out forwards;

    opacity: 0;

}



@keyframes fadeInButton {

    from {

        opacity: 0;

        transform: translateY(-10px);

    }

    to {

        opacity: 1;

        transform: translateY(0);

    }

}



#resetBtn i {

    font-size: 16px;

    color: #A97C50;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    margin-right: 6px;

}



#resetBtn span {

    font-weight: 500;

    letter-spacing: 0.5px;

}



#resetBtn:hover {

    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(60, 60, 60, 0.8) 100%);

    transform: translateY(-2px);

    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);

}



#resetBtn:active {

    transform: translateY(1px);

    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);

    background: linear-gradient(135deg, rgba(0, 0, 0, 0.9) 0%, rgba(40, 40, 40, 0.9) 100%);

}



/* Drag Indicators */

.drag-indicator {

    position: fixed;

    top: 50%;

    display: none;

    opacity: 0;

    transition: opacity 0.3s;

    z-index: 100;

    pointer-events: none;

}



.drag-indicator.left {

    left: 20px;

    transform: translateY(-50%);

}



.drag-indicator.right {

    right: 20px;

    transform: translateY(-50%);

}



.drag-indicator i {

    font-size: 30px;

    color: rgba(255, 255, 255, 0.7);

}



#containerbtt:active ~ .drag-indicator {

    display: block;

    opacity: 1;

}



/* La bàn */

.compass {

    position: fixed;

    top: 10px;

    right: 10px;

    width: 100px;

    height: 100px;

    background-size: contain;

    z-index: 1000;

    border-radius: 50%;

    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);

}



.compass-needle {

    width: 100%;

    height: 100%;

    background: url('http://192.168.1.33/ThePrive_Complete/rotate/assets/hoagio.png') no-repeat center center;

    background-size: contain;

    transition: transform 0.2s ease;

}



/* Library Container */

#library-container {

    display: none;

    position: fixed;

    top: 10%;

    left: 10%;

    width: 80%;

    height: 80%;

    background: white;

    z-index: 1000;

    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);

    overflow: auto;

    border-radius: 8px;

}



#close-library {

    position: absolute;

    top: 10px;

    right: 10px;

    background: red;

    color: white;

    border: none;

    border-radius: 50%;

    width: 30px;

    height: 30px;

    cursor: pointer;

}



#library-content {

    padding: 20px;

}



/* Media Queries */

@media (max-width: 768px) {

    .apartment-tooltip {

        width: 80%;

        left: 10%;

        right: auto;

    }

    

    .loading-progress {

        width: 80%;

    }

    

    #resetBtn {

        padding: 10px 16px;

        font-size: 14px;

        top: 15px;

        right: 15px;

    }

}



@media (max-width: 576px) {

    .compass {

        width: 60px;

        height: 60px;

        bottom: 10px;

        right: 10px;

    }

    

    .drag-indicator i {

        font-size: 24px;

    }

    

    #resetBtn {

        font-size: 13px;

        padding: 8px 14px;

        top: 10px;

        right: 10px;

    }

    

    #resetBtn i {

        font-size: 14px;

    }

}

#rotation {

    position: absolute;

    left: 0;

    top: 0;

    right: 0;

    z-index: -99;

    background-color: rgb(0 0 0 / 76%);

}