/* =========================================================
   BASE & RESET
   ========================================================= */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    width: 100%; height: 100%;
    overflow: hidden;
    background: #0a0a0a;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* =========================================================
   VIEWER 360
   ========================================================= */
#pano {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    z-index: 1;
}

#pano::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,0.5) 100%);
    pointer-events: none;
    z-index: 5;
}

/* =========================================================
   STATUS BADGE
   ========================================================= */
#status {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(10, 10, 10, 0.75);
    backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255,255,255,0.12);
    color: #fff;
    padding: 9px 18px;
    border-radius: 100px;
    z-index: 100;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.02em;
    transition: opacity 0.5s ease;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 4px 24px rgba(0,0,0,0.4);
}

.status-icon { width: 14px; height: 14px; stroke: #4ade80; flex-shrink: 0; }

/* =========================================================
   SIDEBAR DIREITA
   ========================================================= */
.sidebar {
    position: absolute;
    top: 0;
    right: 0;
    width: 190px;
    height: calc(100% - 70px);
    z-index: 50;
    display: flex;
    flex-direction: column;
    pointer-events: auto;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s;
}

.sidebar.hidden { transform: translateX(110%); opacity: 0; pointer-events: none; }

.sidebar::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to left, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.0) 100%);
    pointer-events: none;
    z-index: -1;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 14px 12px;
    color: rgba(255,255,255,0.55);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sidebar-header-left { display: flex; align-items: center; gap: 7px; }
.sidebar-header-icon { width: 13px; height: 13px; }

.sidebar-close-btn {
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 7px;
    width: 26px; height: 26px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    color: rgba(255,255,255,0.4);
    transition: background 0.2s, color 0.2s;
}
.sidebar-close-btn:hover { background: rgba(255,255,255,0.15); color: #fff; }
.sidebar-close-btn svg { width: 13px; height: 13px; }

.thumbnail-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 4px 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.thumbnail-list::-webkit-scrollbar { width: 3px; }
.thumbnail-list::-webkit-scrollbar-track { background: transparent; }
.thumbnail-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 3px; }

.sidebar-footer {
    padding: 8px 14px;
    font-size: 10px;
    color: rgba(255,255,255,0.3);
    font-weight: 500;
    letter-spacing: 0.04em;
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex;
    justify-content: space-between;
}

/* =========================================================
   CARDS DE CENA
   ========================================================= */
.scene-card {
    position: relative;
    flex-shrink: 0;
    border-radius: 9px;
    overflow: hidden;
    cursor: pointer;
    border: 1.5px solid rgba(255,255,255,0.08);
    transition: border-color 0.25s, transform 0.25s cubic-bezier(0.4,0,0.2,1), box-shadow 0.25s;
    background: #111;
    animation: slideInCard 0.4s cubic-bezier(0.4,0,0.2,1) both;
    box-shadow: 0 2px 12px rgba(0,0,0,0.5);
}

@keyframes slideInCard {
    from { transform: translateX(20px); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}

.scene-card:hover { border-color: rgba(255,255,255,0.3); transform: translateX(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.6); z-index: 2; }

.scene-card.active {
    border-color: #3b82f6;
    box-shadow: 0 0 0 1px #3b82f6, 0 6px 20px rgba(59,130,246,0.25);
}

.scene-card.active::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    width: 3px; height: 60%;
    background: #3b82f6;
    border-radius: 0 3px 3px 0;
    z-index: 3;
}

.scene-card img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    display: block;
}

.scene-card-overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.88) 0%, transparent 100%);
    padding: 18px 9px 7px;
    pointer-events: none;
}

.scene-card-name {
    display: block;
    color: #fff;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.scene-card-index {
    display: block;
    color: rgba(255,255,255,0.4);
    font-size: 9.5px;
    margin-top: 1px;
}

/* =========================================================
   VISITED CHECK BADGE (no card da sidebar)
   ========================================================= */
.visited-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px; height: 22px;
    border-radius: 50%;
    background: rgba(10,10,10,0.6);
    backdrop-filter: blur(6px);
    border: 1.5px solid #22c55e;
    display: flex; align-items: center; justify-content: center;
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.3s, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 5;
    pointer-events: none;
}

.visited-badge svg {
    width: 11px; height: 11px;
    stroke: #22c55e;
    stroke-width: 3;
}

.scene-card.visited .visited-badge {
    opacity: 1;
    transform: scale(1);
}

/* =========================================================
   HOTSPOTS
   ========================================================= */
.hotspot-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    margin-left: -32px;
    margin-top: -32px;
    z-index: 10;
}

.hotspot-icon {
    position: relative;
    width: 64px; height: 64px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), background 0.3s, box-shadow 0.3s;
    box-shadow: 0 0 0 6px rgba(255,255,255,0.1), 0 8px 24px rgba(0,0,0,0.4);
    animation: hotspotPulse 2.5s infinite ease-in-out;
}

.hotspot-icon svg {
    width: 22px; height: 22px;
    stroke: #fff;
    stroke-width: 2.5;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5));
}

@keyframes hotspotPulse {
    0%, 100% { box-shadow: 0 0 0 6px rgba(255,255,255,0.1), 0 8px 24px rgba(0,0,0,0.4); }
    50%       { box-shadow: 0 0 0 14px rgba(255,255,255,0.04), 0 8px 24px rgba(0,0,0,0.4); }
}

.hotspot-container:hover .hotspot-icon {
    background: rgba(59, 130, 246, 0.45);
    border-color: #fff;
    transform: scale(1.14);
    animation: none;
    box-shadow: 0 0 0 8px rgba(59,130,246,0.18), 0 12px 32px rgba(0,0,0,0.5);
}

/* Check de destino visitado — aparece no hotspot quando a cena-destino foi visitada */
.hotspot-visited-check {
    position: absolute;
    bottom: -2px; right: -2px;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid rgba(0,0,0,0.6);
    display: flex; align-items: center; justify-content: center;
    opacity: 0;
    transform: scale(0);
    transition: opacity 0.3s, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.hotspot-visited-check svg { width: 10px; height: 10px; stroke: #fff; stroke-width: 3; }
.hotspot-container.dest-visited .hotspot-visited-check {
    opacity: 1;
    transform: scale(1);
}

/* Card preview do hotspot */
.hotspot-card {
    position: absolute;
    bottom: 76px;
    width: 195px;
    background: rgba(10,10,10,0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 14px;
    overflow: hidden;
    opacity: 0;
    transform: translateY(10px) scale(0.95);
    transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
    z-index: 20;
    box-shadow: 0 20px 60px rgba(0,0,0,0.7);
}

.hotspot-container:hover .hotspot-card { opacity: 1; transform: translateY(0) scale(1); }

.hotspot-card img { width: 100%; height: 100px; object-fit: cover; display: block; }

.hotspot-card-body { padding: 9px 12px 11px; }

.hotspot-card-label {
    font-size: 9.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #3b82f6;
    margin-bottom: 3px;
}

.hotspot-title { font-size: 12.5px; font-weight: 600; color: #fff; margin: 0; }

@keyframes hotspotClickAnim {
    0%   { transform: scale(1.1); opacity: 1; }
    40%  { transform: scale(0.85); opacity: 0.7; }
    100% { transform: scale(2); opacity: 0; }
}
.hotspot-clicked .hotspot-icon { animation: hotspotClickAnim 0.6s ease forwards; }
.hotspot-clicked .hotspot-card { opacity: 0 !important; }

/* =========================================================
   ZOOM SLIDER VERTICAL (estilo AirPano)
   ========================================================= */
.zoom-control {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 60;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.zoom-btn {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(12px);
    border: 1.5px solid rgba(255,255,255,0.25);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    flex-shrink: 0;
}
.zoom-btn:hover { background: rgba(255,255,255,0.22); transform: scale(1.1); }
.zoom-btn svg { width: 16px; height: 16px; stroke-width: 2.5; }

/* Track + slider */
.zoom-track {
    position: relative;
    width: 36px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zoom-track-line {
    position: absolute;
    width: 2px;
    height: 100%;
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
    pointer-events: none;
}

/* Slider range girado verticalmente */
.zoom-slider {
    -webkit-appearance: slider-vertical;
    writing-mode: vertical-lr;
    direction: rtl;
    width: 36px;
    height: 120px;
    opacity: 0; /* Slider invisível — serve só para o input; o visual é o thumb-ring */
    cursor: pointer;
    z-index: 2;
    position: relative;
}

/* Bolinha visual sobre o track */
.zoom-thumb-ring {
    position: absolute;
    width: 22px; height: 22px;
    border-radius: 50%;
    background: rgba(255,255,255,0.92);
    border: 2.5px solid rgba(255,255,255,0.6);
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
    pointer-events: none;
    left: 50%;
    transform: translateX(-50%);
    transition: top 0.08s linear;
    top: 50%;
}

/* =========================================================
   MINI-MAPA
   ========================================================= */
.minimap-panel {
    position: absolute;
    bottom: 80px;
    left: 20px;
    width: 310px;
    background: rgba(10,10,10,0.88);
    backdrop-filter: blur(24px) saturate(160%);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 18px;
    overflow: hidden;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transform: translateY(16px);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.4,0,0.2,1);
    box-shadow: 0 20px 60px rgba(0,0,0,0.65);
}

.minimap-panel.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.minimap-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,0.85);
    letter-spacing: 0.04em;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.minimap-close {
    background: rgba(255,255,255,0.06);
    border: none;
    border-radius: 7px;
    width: 26px; height: 26px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    color: rgba(255,255,255,0.4);
    transition: background 0.2s, color 0.2s;
}
.minimap-close:hover { background: rgba(255,255,255,0.15); color: #fff; }
.minimap-close svg { width: 13px; height: 13px; }

.minimap-body {
    position: relative;
    padding: 10px;
}

.minimap-svg {
    width: 100%;
    height: 220px;
    display: block;
}

/* Linhas de conexão SVG */
.map-line {
    stroke: rgba(255,255,255,0.15);
    stroke-width: 1.5;
    fill: none;
    stroke-dasharray: 4 3;
}

/* Pontos das cenas no mapa */
.map-dot-group { cursor: pointer; }

.map-dot-outer {
    fill: none;
    stroke: rgba(255,255,255,0.3);
    stroke-width: 1.5;
    transition: stroke 0.2s;
}

.map-dot-inner {
    fill: rgba(255,255,255,0.35);
    transition: fill 0.2s, r 0.2s;
}

/* Estados dos pontos */
.map-dot-group.state-visited   .map-dot-inner { fill: #22c55e; }
.map-dot-group.state-visited   .map-dot-outer { stroke: #22c55e; stroke-opacity: 0.4; }
.map-dot-group.state-active    .map-dot-inner { fill: #3b82f6; }
.map-dot-group.state-active    .map-dot-outer { stroke: #3b82f6; stroke-opacity: 0.5; }
.map-dot-group.state-unvisited .map-dot-inner { fill: rgba(255,255,255,0.35); }

.map-dot-group:hover .map-dot-outer { stroke: #fff; }
.map-dot-group:hover .map-dot-inner { r: 9; }

/* Check SVG dentro do ponto visitado */
.map-check { display: none; }
.map-dot-group.state-visited .map-check { display: block; }

/* Label do ponto */
.map-label {
    font-size: 8px;
    fill: rgba(255,255,255,0.6);
    font-family: 'Inter', sans-serif;
    text-anchor: middle;
    pointer-events: none;
}
.map-dot-group.state-active .map-label { fill: #fff; font-weight: 700; }

/* Tooltip do mini-mapa */
.map-tooltip {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    width: 160px;
    background: rgba(5,5,5,0.95);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0,0,0,0.6);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 10;
}
.map-tooltip.visible { opacity: 1; }
.map-tooltip img { width: 100%; height: 80px; object-fit: cover; display: block; }
.map-tooltip span { display: block; padding: 7px 10px; font-size: 11px; font-weight: 600; color: #fff; }

/* Legenda */
.minimap-legend {
    display: flex;
    gap: 14px;
    padding: 8px 14px 12px;
    justify-content: center;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    color: rgba(255,255,255,0.45);
    font-weight: 500;
}
.dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.dot--active    { background: #3b82f6; }
.dot--visited   { background: #22c55e; }
.dot--unvisited { background: rgba(255,255,255,0.3); }

/* =========================================================
   BOTTOM TOOLBAR
   ========================================================= */
.bottom-toolbar {
    position: absolute;
    bottom: 0; left: 0;
    width: 100%; height: 70px;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 0 20px;
    background: rgba(10, 10, 10, 0.72);
    backdrop-filter: blur(24px) saturate(180%);
    border-top: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 -4px 30px rgba(0,0,0,0.5);
}

.toolbar-section { display: flex; align-items: center; gap: 2px; }

.toolbar-divider {
    width: 1px; height: 30px;
    background: rgba(255,255,255,0.09);
    margin: 0 14px;
    flex-shrink: 0;
}

.tb-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 54px;
    height: 52px;
    padding: 6px 8px;
    border-radius: 12px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: rgba(255,255,255,0.5);
    transition: background 0.2s, color 0.2s, transform 0.15s;
}
.tb-btn svg { width: 19px; height: 19px; stroke-width: 1.75; flex-shrink: 0; }
.tb-label { font-size: 9px; font-weight: 500; letter-spacing: 0.02em; white-space: nowrap; }

.tb-btn:hover { background: rgba(255,255,255,0.09); color: #fff; transform: translateY(-1px); }
.tb-btn:active { transform: scale(0.96); }

.tb-btn--active { color: #3b82f6; background: rgba(59,130,246,0.12); }
.tb-btn--active:hover { background: rgba(59,130,246,0.2); color: #60a5fa; }

.tb-btn--rotating { color: #4ade80; background: rgba(74,222,128,0.1); }
.tb-btn--rotating svg { animation: spinIcon 2s linear infinite; }
@keyframes spinIcon { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* =========================================================
   INFO PANEL
   ========================================================= */
.info-panel {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    width: 330px;
    background: rgba(10,10,10,0.9);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 18px;
    overflow: hidden;
    z-index: 150;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.4,0,0.2,1);
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.info-panel.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}
.info-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 17px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    font-size: 13.5px;
    font-weight: 600;
    color: #fff;
}
.info-close-btn {
    background: rgba(255,255,255,0.06);
    border: none;
    border-radius: 7px;
    width: 26px; height: 26px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    color: rgba(255,255,255,0.4);
    transition: background 0.2s, color 0.2s;
}
.info-close-btn:hover { background: rgba(255,255,255,0.14); color: #fff; }
.info-close-btn svg { width: 13px; height: 13px; }
.info-desc { padding: 13px 17px 17px; font-size: 13px; line-height: 1.65; color: rgba(255,255,255,0.55); }

/* =========================================================
   RESPONSIVO MOBILE
   ========================================================= */
@media (max-width: 768px) {
    .sidebar { width: 155px; }
    .tb-label { display: none; }
    .tb-btn { min-width: 42px; gap: 0; height: 44px; }
    .bottom-toolbar { height: 58px; padding: 0 8px; }
    .toolbar-divider { margin: 0 8px; }
    #status { font-size: 12px; padding: 7px 14px; }
    .zoom-control { left: 10px; right: auto; }
    .minimap-panel { width: 260px; bottom: 68px; left: 10px; }
}
