:root {
    --btn-bg: rgba(0, 0, 0, 0.12);
    --btn-bg-hover: rgba(255, 255, 255, 0.2);
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #000;
    overflow: hidden;
}

#viewer-container {
    position: relative;
    width: 100vw;
    height: 100vh;
}

/* ── Upload Overlay ── */
#upload-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: #0a0a0a;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
}

#upload-overlay h1 {
    color: #fff;
    font-size: 22px;
    font-weight: 600;
    margin: 0;
    letter-spacing: 0.5px;
}

#drop-zone {
    width: 480px;
    max-width: 90vw;
    height: 220px;
    border: 2px dashed rgba(255, 255, 255, 0.25);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    background: rgba(255, 255, 255, 0.03);
}

#drop-zone.drag-over {
    border-color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.07);
}

#drop-zone .drop-icon {
    font-size: 40px;
    line-height: 1;
}

#drop-zone .drop-text {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    text-align: center;
    line-height: 1.6;
}

#drop-zone .drop-text strong {
    color: #fff;
}

#browse-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 10px 28px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s, transform 0.2s;
}

#browse-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

#file-input {
    display: none;
}

#upload-hint {
    color: rgba(255, 255, 255, 0.3);
    font-size: 12px;
}

/* ── Liquid Glass shared style ── */
.lg {
    background: var(--btn-bg);
    backdrop-filter: blur(6px) saturate(160%);
    -webkit-backdrop-filter: blur(6px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.45),
        0 6px 24px rgba(0, 0, 0, 0.25);
    color: white;
}

.lg:hover {
    /* background: var(--btn-bg-hover); */
}

/* ── Viewer UI (hidden until images loaded) ── */
.controls-panel {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    padding: 10px 16px;
    border-radius: 25px;
    display: flex;
    gap: 8px;
    align-items: center;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    font-weight: 600;
}

.control-button {
    padding: 10px 18px;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    font-size: 16px;
    font-weight: 600;
}

.control-button:hover {
    transform: translateY(-2px);
}

.info-panel {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    padding: 10px 18px 10px 18px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    max-width: 240px;
    overflow: hidden;
}

#current-view {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hide-ui-button {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    padding: 10px 18px;
    border-radius: 25px;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    font-weight: 600;
}

.hide-ui-button:hover {
    transform: translateY(-2px);
}

/* ── Thumbnail Navbar ── */
#thumb-nav {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 80vw;
    z-index: 1000;
    background: none;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#thumb-nav::-webkit-scrollbar { display: none; }

.thumb-item {
    flex-shrink: 0;
    width: 72px;
    height: 48px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s, transform 0.2s, opacity 0.2s;
    position: relative;
    user-select: none;
}

.thumb-item:hover { transform: translateY(3px); }

.thumb-item.active {
    border-color: rgba(255, 255, 255, 0.85);
}

.thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

/* drag states */
.thumb-item.dragging {
    opacity: 0.35;
    transform: scale(0.95);
}

.thumb-item.drag-over {
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(4px) scale(1.05);
}

/* add-more button inside thumb-nav */
#thumb-add-btn {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 6px;
    border: 2px dashed rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.6);
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
}

#thumb-add-btn:hover {
    border-color: rgba(255,255,255,0.7);
    background: rgba(255,255,255,0.12);
    color: #fff;
}

.ui-hidden .controls-panel,
.ui-hidden .info-panel,
.ui-hidden .hide-ui-button,
.ui-hidden #thumb-nav {
    opacity: 0;
    visibility: hidden;
}

a-scene {
    width: 100%;
    height: 100%;
}

a-scene canvas {
    cursor: grab;
}

/* Custom tooltip styles */
.tooltip {
    position: absolute;
    background: rgba(255, 255, 255, 0.9);
    color: rgb(0, 0, 0);
    padding: 4px 6px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    z-index: 1001;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    opacity: 0;
    transform: translateY(5px);
    transition: all 0.2s ease;
}

.tooltip.show {
    opacity: 1;
    transform: translateY(0);
}

.tooltip::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: rgba(255, 255, 255, 0.9);
}
