/* Port 360: rolige markører (POI av typen callout). Produktet bygger markøren i
   hotspot_callout() (viewer/js/index.js rundt 11304-11471) med inline-stil for
   farger, mål og transformasjoner, og blinker ringen i det uendelige
   (index.css 6226-6240). Her overstyres utseendet med !important der produktet
   setter inline-stil, uten å røre transformasjonene som plasserer elementene.

   Ett språk: prikk, hårstrek, etikett. Hierarki via produktets felt «CSS class»
   på POI-en: p360-primary viser etiketten alltid, uten klasse vises den ved
   hover, når markøren er åpen eller når #vt_container har p360-zoomed
   (hfov under 60 grader, settes av port360_poi.js). p360-warn gir gul ring.
   Farger per anlegg med variablene på #vt_container. */
#vt_container {
    --p360-poi-ring: #0f2a44;
    --p360-poi-accent: #0284c7;
    --p360-poi-label-bg: rgba(15,23,42,.72);
    --p360-poi-label-color: #ffffff;
    --p360-poi-halo: 0;
    --p360-poi-line: rgba(255,255,255,.7);
}

/* Prikken */
#vt_container .custom-hotspot-content .callout {
    width: 8px !important;
    height: 8px !important;
    box-sizing: border-box;
    background: #ffffff !important;
    border: 1.5px solid var(--p360-poi-ring) !important;
    border-radius: 50% !important;
    box-shadow: 0 1px 2px rgba(0,0,0,.35);
    transition: box-shadow .15s ease, border-color .15s ease;
}
#vt_container .custom-hotspot-content:hover .callout {
    box-shadow: 0 0 0 3px rgba(255,255,255,.35), 0 1px 2px rgba(0,0,0,.35);
}
#vt_container .custom-hotspot-content .callout.callout_open {
    border-color: var(--p360-poi-accent) !important;
}
#vt_container .custom-hotspot-content.p360-warn .callout {
    border-color: #f59e0b !important;
}

/* Ringen som blinket: av. Slås på som stille ring med --p360-poi-halo: 1 */
#vt_container .custom-hotspot-content .callout_pointer {
    animation: none !important;
    -webkit-animation: none !important;
    width: 18px !important;
    height: 18px !important;
    border: 1px solid rgba(255,255,255,.55) !important;
    opacity: var(--p360-poi-halo) !important;
}

/* Hårstreken */
#vt_container .custom-hotspot-content .callout_line {
    width: 1px !important;
    background: var(--p360-poi-line) !important;
    transition: none !important;
}

/* Etiketten */
#vt_container .custom-hotspot-content .callout_title {
    transition: opacity .15s ease;
}
#vt_container .custom-hotspot-content .callout_title_bg {
    display: inline-block;
    max-width: 220px;
    padding: 4px 12px !important;
    border-radius: 8px !important;
    background: var(--p360-poi-label-bg) !important;
    line-height: normal !important;
    box-shadow: 0 1px 2px rgba(0,0,0,.25);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: background-color .15s ease, opacity .15s ease;
}
#vt_container .custom-hotspot-content .callout_title_text {
    margin: 0 !important;
    color: var(--p360-poi-label-color) !important;
    font: 600 12px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
    letter-spacing: .01em;
    text-align: inherit;
}
@media (min-width: 1200px) {
    #vt_container .custom-hotspot-content .callout_title_text {
        font-size: 13px !important;
    }
}
#vt_container .custom-hotspot-content .callout.callout_open .callout_title_bg {
    background: var(--p360-poi-accent) !important;
}
#vt_container .custom-hotspot-content.p360-warn .callout_title_bg {
    background: rgba(120,53,15,.85) !important;
}

/* Hierarki: uten p360-primary vises etiketten bare ved hover, åpen eller zoom */
#vt_container .custom-hotspot-content:not(.p360-primary) .callout_title {
    opacity: 0;
    pointer-events: none !important;
}
#vt_container.p360-zoomed .custom-hotspot-content:not(.p360-primary) .callout_title,
#vt_container .custom-hotspot-content:not(.p360-primary):hover .callout_title,
#vt_container .custom-hotspot-content:not(.p360-primary) .callout.callout_open .callout_title {
    opacity: 1;
}
/* Opprydding ved overlapp (port360_poi.js): sekundære etiketter viker */
#vt_container .custom-hotspot-content.p360-label-hidden:not(:hover) .callout_title {
    opacity: 0 !important;
}

/* Beskrivelsen erstattes av kortet */
#vt_container .custom-hotspot-content .callout_description {
    display: none !important;
}

/* Svak pust på åpen markør, bare når anlegget ber om det */
@keyframes p360-breath {
    0% { opacity: .85; }
    50% { opacity: 1; }
    100% { opacity: .85; }
}
#vt_container.p360-poi-breath .custom-hotspot-content .callout.callout_open {
    animation: p360-breath 2s ease-in-out infinite;
}

@media (max-width: 768px) {
    #vt_container .custom-hotspot-content .callout {
        width: 10px !important;
        height: 10px !important;
    }
}

/* Kortet */
#p360_poi_card {
    position: absolute;
    left: 12px;
    bottom: 72px;
    z-index: 1055;
    width: 320px;
    max-width: calc(100% - 24px);
    padding: 12px 14px 14px;
    border-radius: 10px;
    background: rgba(255,255,255,.96);
    box-shadow: 0 1px 2px rgba(60,64,67,.15), 0 1px 3px 1px rgba(60,64,67,.07);
    color: #1f2937;
    font: 13px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .15s ease, transform .15s ease;
    pointer-events: none;
}
#p360_poi_card.open {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}
#p360_poi_card .p360-poi-close {
    appearance: none;
    -webkit-appearance: none;
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #6b7280;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}
#p360_poi_card .p360-poi-type {
    margin: 0 0 2px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--p360-poi-accent, #0284c7);
}
#p360_poi_card h3 {
    margin: 0 28px 6px 0;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.25;
}
#p360_poi_card table {
    width: 100%;
    margin: 6px 0;
    border-collapse: collapse;
    font-size: 12px;
}
#p360_poi_card th {
    width: 40%;
    padding: 3px 8px 3px 0;
    text-align: left;
    font-weight: 500;
    color: #6b7280;
    vertical-align: top;
}
#p360_poi_card td {
    padding: 3px 0;
}
#p360_poi_card tr + tr th,
#p360_poi_card tr + tr td {
    border-top: 1px solid rgba(0,0,0,.06);
}
#p360_poi_card p {
    margin: 6px 0 0;
    white-space: pre-line;
}
#p360_poi_card p a {
    color: var(--p360-poi-accent, #0284c7);
}
#p360_poi_card .p360-poi-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 7px 12px;
    border-radius: 8px;
    background: var(--p360-poi-accent, #0284c7);
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}
@media (max-width: 768px) {
    #p360_poi_card {
        left: 0;
        right: 0;
        bottom: 0;
        width: auto;
        max-width: none;
        border-radius: 10px 10px 0 0;
        padding-bottom: calc(14px + env(safe-area-inset-bottom));
    }
}
