/* __V3D_TEMPLATE__ - template-based file; delete this line to prevent this file from being updated */

body {
    margin: 0px;
    overflow: hidden;
}

noscript {
    display: block;
    text-align: center;
    padding-top: 100px;
    font-size: 20px;
}

#v3d-container, .v3d-container {
    position: absolute;
    top: 0px;
    left: 0px;
    width: 100%;
    height: 100%;
    overflow: visible !important; 
}

.fullscreen-button {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 50px;
    height: 50px;
    cursor: pointer;
    background-size: 100% 100%;
    display: none;
    z-index: 2;
}

.fullscreen-open { background-image: url('media/fullscreen_open.svg'); }
.fullscreen-close { background-image: url('media/fullscreen_close.svg'); }

* { -webkit-tap-highlight-color:rgba(0,0,0,0); }

.v3d-simple-preloader-background { background-color: #181818; }
.v3d-simple-preloader-container { filter: drop-shadow(0px 0px 4px #2a69bd); }

/* ============================================================
   SKETCHFAB-STYLE PERFORMANCE ANNOTATIONS
   ============================================================ */

/* THE ANCHOR POINT - Zeroed out for perfect mirroring */
.anno-wrapper {
    position: absolute;
    left: 0;
    top: 0;
    width: 0;   /* CRITICAL: Ensures the origin is a single point */
    height: 0;  /* CRITICAL: Ensures the origin is a single point */
    z-index: 100;
    pointer-events: none;
    will-change: transform;
}

/* THE CONSOLIDATED DIALOG BOX */
.custom-anno-dialog {
    /* THE FIX: 
       1. max(2vmin, 10px) -> This calculates the exact radius of the pin.
          It stops shrinking at 10px (half of the 20px min-width).
       2. + 6px -> This adds a constant "air gap" that never changes.
    */
    --offset: calc(max(2vmin, 10px) + 6px);

    display: none; 
    position: absolute;
    
    /* Apply the synchronized offset */
    left: var(--offset) !important;
    top: var(--offset) !important;
    right: auto !important;
    bottom: auto !important;
    
    transform: none !important;
    transform-origin: left top !important;
    
    /* RESTRAINTS */
    width: 25vmin !important;     
    max-width: 80vw !important;  
    min-width: 50px;
    max-height: 25vh !important; 
    min-height: 25px;

    /* VISUALS */
    background: rgba(21, 32, 54, 0.95) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid #24caa1 !important;
    border-radius: 12px;
    overflow: hidden !important; 
    pointer-events: auto;
    z-index: 1000;
    box-sizing: border-box !important;
}

/* OPEN STATE: This is what makes it visible and sets the layout */
.anno-wrapper.is-open .custom-anno-dialog {
    display: flex !important;
    flex-direction: column !important;
}

.anno-header {
    flex-shrink: 0;
    font-weight: 700;
    /* RESPONSIVE: Scales with vmin, min-size of 14px */
    font-size: clamp(10px, 2vmin, 24px); 
    color: #608BC1;
    text-transform: uppercase;
    letter-spacing: clamp(0px, 0.1vmin, 0.5px);
    border-bottom: 1px solid #24caa1;
    padding: 1.5vmin clamp(6px, 1.5vmin, 15px); /* Proportional padding */
    background: rgba(21, 32, 54, 0.5);
    white-space: normal;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* THE SCROLLABLE BODY */
.anno-body {
    flex: 1 1 auto;
    overflow-y: auto !important;
    padding: 2vmin; /* Proportional padding */
    /* RESPONSIVE: Scales with vmin, min-size of 12px */
    font-size: clamp(10px, 1.8vmin, 20px);
    line-height: 1.5;
    color: white;
    pointer-events: auto !important;
}

/* --- SCROLLBAR STYLING --- */
.anno-body::-webkit-scrollbar {
    width: 6px;
}
.anno-body::-webkit-scrollbar-track {
    background: transparent;
}
.anno-body::-webkit-scrollbar-thumb {
    background: #608BC1;
    border-radius: 10px;
}
.anno-body::-webkit-scrollbar-thumb:hover {
    background: #24caa1;
}

/* PIN STYLING */
.anno-pin {
    /* Use max() to enforce the size floor without needing min-width */
    width: max(4vmin, 20px);
    height: max(4vmin, 20px);
    
    background: #152036;
    border: 2px solid #24caa1;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: auto;
    
    /* CRITICAL FIX: 
       We use the same max() logic for the margins.
       This ensures that when the pin hits its 20px floor, 
       the centering shift stays at -10px exactly.
    */
    margin-left: calc(max(2vmin, 10px) * -1);
    margin-top: calc(max(2vmin, 10px) * -1);
    
    z-index: 10;
    transition: background 0.2s ease, transform 0.2s ease;
}

.anno-pin:hover {
    background: #608BC1;
    transform: scale(1.1);
}

/* EDGE DETECTION FLIPS - Harmonized to match Top/Left */
/* FLIP LEFT (When pin is on the right edge) */
.anno-wrapper.is-right .custom-anno-dialog {
    left: auto !important;
    right: var(--offset) !important;
    transform-origin: right top !important;
}

/* FLIP UP (When pin is on the bottom edge) */
.anno-wrapper.is-bottom .custom-anno-dialog {
    top: auto !important;
    bottom: var(--offset) !important;
    transform-origin: left bottom !important;
}

/* FLIP BOTH (Top-Left quadrant of pin) */
.anno-wrapper.is-right.is-bottom .custom-anno-dialog {
    transform-origin: right bottom !important;
}

/* Ensure the active/open annotation is always in front of all other pins */
.anno-wrapper.is-open {
    z-index: 9999 !important;
}

/* Ensure the dialog itself within that wrapper is also prioritized */
.anno-wrapper.is-open .custom-anno-dialog {
    z-index: 10000 !important;
}

/* This targets the icon inside the pin specifically */
.anno-pin img {
    width: 100% !important;  /* Increase this to 85% or 90% to make them even bigger */
    height: 100% !important;
    object-fit: contain;    /* Keeps the icon from stretching */
    display: block;
    pointer-events: none;   /* Makes sure clicks go through to the pin */
}