body {
    margin: 0;
    font-family: sans-serif;
    overflow: hidden; /* Hide scrollbars */
}

canvas {
    position: fixed;
    top: 0;
    left: 0;
    outline: none;
}

#info {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 10px;
    border-radius: 5px;
    max-width: 300px;
    z-index: 100;
}

#editing-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 10px;
    border-radius: 5px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#toggle-edit-mode-btn, #save-manifest-btn, #load-manifest-btn {
    display: block; /* Always visible */
}

#editing-controls label, #editing-controls select, #editing-controls input, #editing-controls button:not(#toggle-edit-mode-btn):not(#save-manifest-btn):not(#load-manifest-btn) {
    display: none; /* Hidden by default in View Mode */
}

#hotspot-editor {
    display: none; /* Hidden by default */
}

#editing-controls button:hover {
    background: #0056b3;
}

#editing-controls label {
    margin-top: 10px;
    font-size: 12px;
}

#editing-controls select {
    width: 100%;
    padding: 5px;
    border: 1px solid #555;
    background: #333;
    color: white;
    border-radius: 3px;
}

#hotspot-editor input, #hotspot-editor select, #panorama-name-input, #hotspot-target-display, #layer-select, #move-pano-to-layer-select {
    width: 100%;
    padding: 5px;
    border: 1px solid #555;
    background: #333;
    color: white;
    border-radius: 3px;
    display: none; /* Hidden by default */
}

#hotspot-editor button {
    background: #dc3545;
}

#hotspot-editor button:hover {
    background: #c82333;
}

code {
    background: #333;
    padding: 2px 5px;
    border-radius: 3px;
}

#nav {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
}

#nav button {
    background: rgba(0,0,0,0.7);
    color: white;
    border: 1px solid white;
    padding: 10px 20px;
    margin: 0 5px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

#nav button:hover {
    background: rgba(255, 255, 255, 0.2);
}

#zoom-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 100;
    display: flex;
    flex-direction: row;
}

#zoom-controls button {
    background: rgba(0,0,0,0.5);
    color: white;
    border: 1px solid #555;
    margin-top: 8px;
    border-radius: 50%; /* Make it circular */
    cursor: pointer;
    font-size: 22px;
    font-weight: bold;
    line-height: 38px; /* Center the +/- vertically */
    text-align: center;
    width: 40px;
    height: 40px;
    transition: background-color 0.15s ease;
}

#zoom-controls button:hover {
    background: rgba(0,0,0,0.7);
}

#thumbnail-carousel {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px; /* Adjusted height of the carousel */
    background: rgba(0, 0, 0, 0.7);
    z-index: 150;
    display: flex;
    align-items: center;
    overflow-x: auto;
    padding: 0 10px;
    box-sizing: border-box;
}

#thumbnail-carousel img {
    height: 60px; /* Reverted height of thumbnails */
    width: auto;
    border: 2px solid transparent;
    margin: 0;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

#zoom-controls {
    position: absolute;
    bottom: 110px; /* Positioned above the carousel (100px height + 10px padding) */
    right: 20px;
    z-index: 100;
    display: flex;
    flex-direction: row;
}

.thumbnail-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5px;
    margin: 0 5px;
    border-radius: 5px;
    background: rgba(0,0,0,0.5); /* More opaque background */
    border: 1px solid rgba(255, 255, 255, 0.2); /* Add a subtle border */
    transition: background-color 0.2s ease, border-color 0.2s ease;
    min-width: 100px;
}

.thumbnail-item:hover {
    background: rgba(0,0,0,0.7);
    border-color: rgba(255, 255, 255, 0.5);
}

.thumbnail-item.active {
    background: rgba(0, 123, 255, 0.5); /* Highlight active thumbnail */
    border-color: #007bff; /* Highlight active thumbnail */
    box-shadow: 0 0 8px rgba(0, 123, 255, 0.8);
}

.thumbnail-item.active img {
    border-color: #007bff;
}

.thumbnail-item span {
    color: white;
    font-size: 12px; /* Slightly larger font for readability */
    text-align: center;
    margin-top: 5px;
    word-break: break-word; /* Allow long words to break */
    padding: 0 2px; /* Small padding for text */
}

#image-viewer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none; /* Hidden by default */
    justify-content: center;
    align-items: center;
    z-index: 200;
    overflow: hidden; /* Hide overflow for panning */
}

#image-viewer-overlay img {
    max-width: 90%;
    max-height: 90%;
    transform-origin: center center;
    cursor: grab;
}

#image-viewer-overlay img.panning {
    cursor: grabbing;
}

#close-viewer-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: white;
    background: none;
    border: none;
    cursor: pointer;
}
