/* ===== BASE ===== */
#object-panel {
    position: fixed;
    right: 20px;
    top: 70px;
    width: 250px;
    background: #111;
    color: #fff;
    border: 1px solid #333;
    border-radius: 10px;
    padding: 15px;
    display: none;
    z-index: 9999;
}
.pnlm-hotspot.hotspot-active {
    transform: scale(2.2);
    filter: drop-shadow(0 0 10px rgba(255,255,255,0.9));
}

.toast-container {
    z-index: 20000 !important;
}
.hotspot-active {
    transform: scale(1.8);
    transition: transform 0.2s ease;
    z-index: 9999;
}

.hotspot-active {
    transform: scale(2);
    filter: drop-shadow(0 0 8px rgba(255,255,255,0.8));
}

.hotspot-active i {
    animation: hotspotPulse 0.8s ease;
}

@keyframes hotspotPulse {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.6); }
    100% { transform: scale(1); }
}
#viewerOverlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 9999;

    display: flex;
    align-items: center;
    justify-content: center;
}

#viewerLayout {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);

    width: 90%;
    max-width: 1200px;

    height: calc(100vh - 160px); /* ← usa viewport, non % */
}
/* viewer */
#panoramaContainer {
    position: relative;
    width: 100%;
    height: 100%;
}

#panorama {
    width: 100%;
    height: 100%;
}

/* sidebar */
#viewerHotspots {
    width: 300px;
    background: #111;
    border-left: 1px solid #333;
    padding: 15px;
    overflow-y: auto;
}

.viewerHotspotsTitle {
    font-weight: 600;
    margin-bottom: 10px;
}

/* lista */
.hotspot-row {
    padding: 10px;
    border-bottom: 1px solid #333;
    display: flex;
    gap: 10px;
    align-items: center;
    cursor: pointer;
}

.hotspot-row:hover {
    background: #222;
}

#startViewer {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
}
.start-thumb {
    width: 100%;
}
.footer {
  padding: 20px 0;
  text-align: center;
  font-size: 14px;
  color: #888;
  border-top: 1px solid #eee;
  margin-top: 40px;
}
/* ===== BACK BUTTON ===== */
#viewerBackBtn {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9000;

    width: 42px;
    height: 42px;

    border-radius: 50%;
    border: none;

    background: rgba(0,0,0,0.4);
    color: #fff;

    display: flex;
    align-items: center;
    justify-content: center;

    backdrop-filter: blur(6px);

    transition: all 0.2s ease;
}
.viewer-back-btn {
    position:absolute;
    left:15px;
    top:50%;
    transform:translateY(-50%);
    z-index:20000;
    width:48px;
    height:48px;

    border-radius:50%;
    border:none;

    color:#fff;

    display:flex;
    align-items:center;
    justify-content:center;

    cursor:pointer;
}

.viewer-back-btn:hover {
    background:rgba(0,0,0,0.8);
}
.footer a {
  color: inherit;
  text-decoration: underline;
}

.footer a:hover {
  color: #fff;
}
/* ===== VIEWER ===== */
.thumb {
    transition: transform 0.2s ease;
    cursor: pointer;
}

#panorama, leaflet-container {
    background: #000 !important;
}

.thumb:hover {
    transform: scale(1.03);
}
.thumb-wrapper {
    width: 220px;
}

.thumb {
    height: 180px;
    background-size: cover;
    background-position: center;
    position: relative; /* fondamentale */
    border-radius: 8px;
    overflow: hidden;
}

/* badge sopra l'immagine */
.pano-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0,0,0,0.6);
    padding: 4px 6px;
    border-radius: 6px;
    font-size: 14px;
    color: #fff;
}
#viewerOverlay {
    position: fixed;
    inset: 0;
    background: #000;
    display: none;
    z-index: 9999;
}
/* QUESTO È IL PUNTO CRITICO */
#panorama {
    width: 100%;
    height: 100%;
}

/* BOTTONI */
.viewer-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10000;
    display: flex;
    gap: 8px;
}

/* CAPTION */
.viewer-caption {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 10000;
    color: #fff;
    background: rgba(0,0,0,0.5);
    padding: 6px 10px;
    border-radius: 6px;
}
.thumb {
    height:180px;
    background-size:cover;
    background-position:center;
}

body {
    background:#111;
    color:#fff;
    font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.app-header {
    padding-bottom:10px;
    border-bottom:1px solid #333;
}

.app-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.app-title {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    line-height: 1.1;
}
/* ===== CARD ===== */

.card {
    background:#1a1a1a;
    border:1px solid #333;
    color:#fff;
}

/* ===== FORM ===== */

.form-control {
    background:#222;
    border:1px solid #444;
    color:#fff;
}

.form-control:focus {
    background:#222;
    color:#fff;
    border-color:#666;
    box-shadow:none;
}

/* ===== TEXT ===== */

label,
.form-label,
small {
    color:#ccc;
}

/* ===== BUTTON ===== */

.btn-outline-light {
    border-color:#555;
}

.btn-outline-light:hover {
    background:#fff;
    color:#000;
}

/* ===== HEADER ===== */

.page-header {
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:20px;
}

/* ===== LOGO PREVIEW ===== */

.logo-preview {
    max-height:60px;
    margin-top:10px;
}

/* ===== HOTSPOT FLOAT PANEL ===== */

/* ===== HOTSPOT PANEL BOTTOM (DESKTOP + MOBILE) ===== */

#viewerHotspotPanel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;

    height: 35%;
    max-height: 300px;

    background: rgba(20,20,20,0.95);
    border-top: 1px solid #333;
    border-radius: 12px 12px 0 0;

    padding: 12px;
    overflow-y: auto;

    z-index: 15000;

    transform: translateY(100%);
    transition: transform 0.25s ease;
}

/* aperto */
#viewerHotspotPanel.open {
    transform: translateY(0);
}

/* chiuso */
#viewerHotspotPanel.collapsed {
    transform: translateY(100%);
}

/* titolo centrato */
.viewerHotspotsTitle {
    text-align: center;
    margin-bottom: 10px;
}
#viewerHotspotPanel::before {
    content: "";
    display: block;
    width: 40px;
    height: 5px;
    background: #666;
    border-radius: 3px;
    margin: 0 auto 10px auto;
}
.hotspot-row {
    border-radius: 6px;
}

.hotspot-row:hover {
    background: #2a2a2a;
}
@media (max-width: 768px) {

    #viewerHotspotPanel {
        top: auto;
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        max-height: 50%;
        border-radius: 12px 12px 0 0;
        transform: translateY(100%);
    }

    #viewerHotspotPanel.open {
        transform: translateY(0);
    }

}

#panorama .hotspot.hotspot-active {
    transform: scale(2.2);
    filter: drop-shadow(0 0 10px rgba(255,255,255,0.9));
    transition: transform 0.2s ease;
}
