/* ── Reset & Base ───────────────────────────────────────── */
@import url('https://fonts.cdnfonts.com/css/geist');

:root {
    --font-main: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --color-bg: #ffffff;
    --color-fg: #111111;
    --color-muted: #888888;
    --color-border: rgba(0, 0, 0, 0.08);
    --color-hover: #e8e8e8;
    --color-active: #d4d4d4;
    --color-ripple: rgba(0, 0, 0, 0.22);
    --radius: 12px;
    --transition: 180ms ease;
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
    font-family: var(--font-main);
    font-size: 15px;
    color: var(--color-fg);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Info panel (top-left) ─────────────────────────────── */
.info-panel {
    position: fixed;
    top: 24px;
    left: 24px;
    z-index: 1000;
    background: rgba(255,255,255,0.9);
    padding: 20px 28px;
    border-radius: var(--radius);
    max-width: 320px;
    transition: opacity 350ms ease, transform 350ms ease;
}

.info-panel-title {
    font-family: var(--font-main);
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.2;
    color: var(--color-fg);
    margin-bottom: 8px;
}

.info-panel-desc {
    font-family: var(--font-main);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.55;
    color: var(--color-muted);
}

/* ── Viewer container ──────────────────────────────────── */
#pano-wrap {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

#pano-wrap,
#pano-wrap *,
#pano-wrap div,
#pano-wrap canvas {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 24 24' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cg stroke='%23000' stroke-width='3.5' opacity='0.35'%3E%3Cpath d='M16.466 7.5C15.643 4.237 13.952 2 12 2 9.239 2 7 6.477 7 12s2.239 10 5 10c.342 0 .677-.069 1-.2'/%3E%3Cpath d='m15.194 13.707 3.814 1.86-1.86 3.814'/%3E%3Cpath d='M19 15.57c-1.804.885-4.274 1.43-7 1.43-5.523 0-10-2.239-10-5s4.477-5 10-5c4.838 0 8.873 1.718 9.8 4'/%3E%3C/g%3E%3Cg stroke='white' stroke-width='2'%3E%3Cpath d='M16.466 7.5C15.643 4.237 13.952 2 12 2 9.239 2 7 6.477 7 12s2.239 10 5 10c.342 0 .677-.069 1-.2'/%3E%3Cpath d='m15.194 13.707 3.814 1.86-1.86 3.814'/%3E%3Cpath d='M19 15.57c-1.804.885-4.274 1.43-7 1.43-5.523 0-10-2.239-10-5s4.477-5 10-5c4.838 0 8.873 1.718 9.8 4'/%3E%3C/g%3E%3C/svg%3E") 16 16, move !important;
}

/* ── Zoom controls  ────────────────────────────────────── */
.zoom-controls {
    position: fixed;
    right: 24px;
    bottom: 32px;
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

.zoom-btn {
    position: relative;
    overflow: hidden;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: rgba(255,255,255,0.9);
    color: var(--color-fg);
    font-family: var(--font-main);
    font-size: 18px;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.zoom-btn:first-child {
    border-radius: 50% 50% 0 0;
}

.zoom-btn:last-child {
    border-radius: 0 0 50% 50%;
}

.zoom-btn:hover {
    background: rgba(0,0,0,0.85);
    color: #ffffff;
}

.zoom-btn:active {
    background: rgba(0,0,0,0.95);
    color: #ffffff;
}

.zoom-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    position: relative;
    z-index: 1;
}

/* ── Ripple effect ─────────────────────────────────────── */
.zoom-ripple {
    position: absolute;
    border-radius: 50%;
    background: var(--color-ripple);
    transform: scale(0);
    animation: ripple-expand 600ms ease-out forwards;
    pointer-events: none;
    z-index: 0;
}

@keyframes ripple-expand {
    0%   { transform: scale(0);   opacity: 0.7; }
    50%  { opacity: 0.4; }
    100% { transform: scale(5);   opacity: 0; }
}

/* ── Bottom navigation bar ────────────────────────────── */
.scene-nav {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 14px;
    z-index: 1000;
}

.scene-nav-arrow {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: rgba(255,255,255,0.9);
    color: var(--color-fg);
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.scene-nav-arrow:hover {
    background: rgba(0,0,0,0.85);
    color: #ffffff;
}

.scene-nav-arrow svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2.5;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.scene-pills {
    display: flex;
    align-items: center;
    gap: 0;
}

.scene-pill {
    position: relative;
    width: 20px;
    height: 26px;
    cursor: pointer;
    border: none;
    padding: 0 2.5px;
    background: transparent;
    display: flex;
    align-items: center;
    transition: width var(--transition);
}

.scene-pill::after {
    content: '';
    display: block;
    width: 100%;
    height: 3px;
    border-radius: 2px;
    background: rgba(255,255,255,0.4);
    transition: background var(--transition);
}

.scene-pill.active {
    width: 32px;
}

.scene-pill.active::after {
    background: #ffffff;
}

.scene-pill:hover::after {
    background: rgba(255,255,255,0.8);
}

/* Scene title above nav */
.scene-nav-title {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-main);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #ffffff;
    background: rgba(0,0,0,0.45);
    padding: 4px 12px;
    border-radius: 100px;
    white-space: nowrap;
    pointer-events: none;
    transition: opacity 180ms ease;
}

.scene-nav-title.preview {
    opacity: 0;
}

/* Thumbnail preview on pill hover */
.scene-thumb-preview {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    width: 160px;
    border-radius: 10px;
    overflow: hidden;
    pointer-events: none;
    opacity: 0;
    transition: opacity 200ms ease, transform 200ms ease;
    transform: translateX(-50%) translateY(6px);
    z-index: 1001;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.scene-thumb-preview.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.scene-thumb-preview img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 2 / 1;
    object-fit: cover;
}

.scene-thumb-preview .thumb-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 10px 8px;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    font-family: var(--font-main);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #ffffff;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Fullscreen button ─────────────────────────────────── */
.fullscreen-btn {
    position: fixed;
    top: 24px;
    right: 24px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: rgba(255,255,255,0.9);
    color: var(--color-fg);
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    z-index: 1000;
    overflow: hidden;
}

.fullscreen-btn:hover {
    background: rgba(0,0,0,0.85);
    color: #ffffff;
}

.fullscreen-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    position: relative;
    z-index: 1;
}

/* ── Scene counter (below nav) ──────────────────── */
.scene-counter {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-main);
    font-size: 10px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.06em;
    color: rgba(255,255,255,0.45);
    white-space: nowrap;
    pointer-events: none;
}

/* ── Bottom-left status ─────────────────────────── */
.bottom-status {
    position: fixed;
    bottom: 32px;
    left: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    font-family: var(--font-main);
}

.lang-switcher {
    display: flex;
    gap: 4px;
}

.lang-btn {
    border: none;
    background: rgba(255,255,255,0.85);
    color: var(--color-fg);
    font-family: var(--font-main);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    padding: 4px 9px;
    border-radius: 5px;
    transition: background var(--transition), color var(--transition);
}

.lang-btn:hover {
    background: rgba(0,0,0,0.85);
    color: #ffffff;
}

.lang-btn.active {
    background: rgba(0,0,0,0.85);
    color: #ffffff;
}

.powered-by {
    position: fixed;
    bottom: 5px;
    left: 24px;
    z-index: 1000;
    font-family: var(--font-main);
    font-size: 9px;
    font-weight: 400;
    color: rgba(255,255,255,0.4);
    letter-spacing: 0.03em;
}

.powered-by a {
    color: rgba(255,255,255,0.5);
    text-decoration: underline;
    transition: color var(--transition), text-decoration-color var(--transition);
}

.powered-by a:hover {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
}

/* ── Tablet (≤1024px) ──────────────────────────────────── */
@media (max-width: 1024px) {
    .info-panel {
        max-width: 280px;
        padding: 16px 22px;
    }

    .info-panel-title {
        font-size: 18px;
        margin-bottom: 6px;
    }

    .info-panel-desc {
        font-size: 11px;
    }

    .scene-nav {
        bottom: 24px;
        gap: 12px;
    }

    .scene-pill {
        width: 16px;
    }

    .scene-pill.active {
        width: 26px;
    }
}

/* ── Mobile (≤600px) ───────────────────────────────────── */
@media (max-width: 600px) {
    /* Fullscreen: hide on mobile */
    .fullscreen-btn {
        display: none;
    }

    /* Zoom: hide on mobile */
    .zoom-controls {
        display: none;
    }

    /* Info panel: no need for btn space */
    .info-panel {
        top: 0;
        left: 0;
        right: 0;
        max-width: none;
        border-radius: 0;
        padding: 14px 16px;
        background: rgba(255,255,255,0.92);
    }

    .info-panel-title {
        max-width: calc(100vw - 130px);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Nav: tighter, smaller arrows */
    .scene-nav {
        bottom: 16px;
        gap: 8px;
        left: 50%;
        transform: translateX(-50%);
        max-width: calc(100vw - 24px);
    }

    .scene-nav-arrow {
        width: 32px;
        height: 32px;
    }

    .scene-nav-arrow svg {
        width: 16px;
        height: 16px;
    }

    .scene-pills {
        gap: 0;
    }

    .scene-pill {
        width: 14px;
        height: 32px; /* bigger touch target */
        padding: 0 2px;
    }

    .scene-pill.active {
        width: 22px;
    }

    .scene-nav-title {
        font-size: 10px;
        padding: 3px 10px;
    }

    /* Counter below nav */
    .scene-counter {
        font-size: 9px;
        top: calc(100% + 6px);
    }

    /* Lang switcher: top-right, inside info panel strip */
    .bottom-status {
        position: fixed;
        bottom: auto;
        top: 0;
        left: auto;
        right: 0;
        transform: none;
        flex-direction: row;
        align-items: center;
        padding: 12px 16px;
    }

    .lang-switcher {
        display: flex;
    }

    .lang-btn {
        font-size: 9px;
        padding: 3px 7px;
    }

    /* Powered by: vertical, bottom-left */
    .powered-by {
        font-size: 10px;
        writing-mode: vertical-rl;
        text-orientation: mixed;
        transform: rotate(180deg);
        bottom: 8px;
        left: 6px;
    }
}

/* ── Touch devices: disable hover, improve tap ─────────── */
@media (hover: none) {
    .zoom-btn:hover,
    .scene-nav-arrow:hover,
    .fullscreen-btn:hover,
    .lang-btn:hover {
        background: rgba(255,255,255,0.85);
        color: var(--color-fg);
    }

    .zoom-btn:active,
    .scene-nav-arrow:active,
    .fullscreen-btn:active,
    .lang-btn:active {
        background: rgba(0,0,0,0.85);
        color: #ffffff;
    }

    .scene-pill:hover::after {
        background: rgba(255,255,255,0.4);
    }

    .scene-pill:active::after {
        background: rgba(255,255,255,0.8);
    }

    /* Hide cursor on touch */
    #pano-wrap,
    #pano-wrap *,
    #pano-wrap div,
    #pano-wrap canvas {
        cursor: default !important;
    }

    /* Hide nav title on hover (no hover on touch) */
    .scene-nav-title.preview {
        opacity: 1;
    }
}
