/* Visualization Components Styles */

/* Visualization Mode Switch */
.viz-switch {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin: 16px 0 20px 0;
    padding: 8px;
    background: rgba(247, 249, 252, 0.6);
    border-radius: 50px;
    display: inline-flex;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 2px 8px rgba(52, 85, 120, 0.04);
}

.viz-btn {
    border: 1.5px solid rgba(52, 85, 120, 0.12);
    background: white;
    color: #345;
    padding: 8px 24px;
    border-radius: 50px;
    font-size: 0.97rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
    box-shadow: 0 1px 3px rgba(52, 85, 120, 0.04);
}

.viz-btn:hover:not(.active) {
    background: #f0f4f8;
    border-color: rgba(52, 85, 120, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(52, 85, 120, 0.08);
}

.viz-btn.active {
    background: linear-gradient(135deg, #345 0%, #5a8ab8 100%);
    color: #fff;
    border-color: #345;
    box-shadow:
        0 2px 8px rgba(52, 85, 120, 0.2),
        0 4px 12px rgba(52, 85, 120, 0.1);
    transform: translateY(-1px);
}

.viz-btn:active {
    transform: translateY(0) scale(0.98);
}

.viz-content {
    display: none;
}

.viz-content.active {
    display: block;
}

/* Visualization Description */
.viz-description {
    margin-top: 7px;
    margin-bottom: 15px;
    text-align: center;
}

.viz-desc {
    display: none;
    font-size: 0.97rem;
    color: #5a6b7c;
    line-height: 1.5;
}

.viz-desc.active {
    display: block;
}

/* Showcase Bar Container */
.showcase-container {
    position: relative;
    margin: 26px 0 10px 0;
    padding: 0 50px; /* 为箭头留出空间 */
}

/* Showcase Bar */
.showcase-bar {
    display: flex;
    justify-content: space-evenly;
    gap: 8px;
    padding: 18px 12px;
    position: relative;
    background: radial-gradient(
        ellipse at center,
        rgba(100, 168, 240, 0.1) 0%,
        rgba(100, 168, 240, 0.08) 30%,
        rgba(100, 168, 240, 0.045) 55%,
        rgba(100, 168, 240, 0.0) 75%
    );
    overflow: hidden;
}

/* Showcase Navigation Arrows */
.showcase-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: white;
    border: 2px solid rgba(52, 85, 120, 0.15);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    color: #345;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    box-shadow:
        0 2px 8px rgba(52, 85, 120, 0.08),
        0 4px 16px rgba(52, 85, 120, 0.04);
    backdrop-filter: blur(8px);
}

.showcase-arrow:hover {
    background: linear-gradient(135deg, #345 0%, #5a8ab8 100%);
    color: #fff;
    border-color: #345;
    box-shadow:
        0 4px 12px rgba(52, 85, 120, 0.2),
        0 8px 24px rgba(52, 85, 120, 0.15);
    transform: translateY(-50%) scale(1.08);
}

.showcase-arrow:active {
    transform: translateY(-50%) scale(0.95);
}

.showcase-arrow.disabled {
    opacity: 0.2;
    cursor: not-allowed;
    pointer-events: none;
}

.showcase-arrow-left {
    left: 5px;
}

.showcase-arrow-right {
    right: 5px;
}

.showcase-bar::before,
.showcase-bar::after {
    content: '';
    position: absolute;
    left: 2%;
    right: 2%;
    height: 2px;
    background: repeating-linear-gradient(
        to right,
        rgba(52, 85, 120, 0.28),
        rgba(52, 85, 120, 0.28) 8px,
        transparent 8px,
        transparent 16px
    );
    pointer-events: none;
}

.showcase-bar::before {
    top: 0;
}

.showcase-bar::after {
    bottom: 0;
}

.showcase-thumb {
    flex: 1 1 22%;
    max-width: 24%;
    min-width: 150px;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 12px;
    border: 2.5px solid rgba(52, 85, 120, 0.12);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 2px 8px rgba(52, 85, 120, 0.06),
        0 4px 12px rgba(52, 85, 120, 0.03);
    background: #f7f9fb;
    filter: grayscale(0.1) brightness(0.98);
}

/* Loading state for thumbnails - simple spinner */
.showcase-thumb.loading {
    position: relative;
    background: rgba(247, 249, 251, 0.95);
    pointer-events: none;
    min-height: 150px; /* Ensure height even without image */
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent; /* Hide alt text during loading */
    font-size: 0; /* Hide alt text during loading */
    overflow: hidden; /* Prevent any text overflow */
}

/* Spinner container - matches main image spinner exactly */
.showcase-thumb.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 3px solid rgba(52, 85, 120, 0.15);
    border-top-color: #345;
    border-radius: 50%;
    animation: thumbSpin 0.8s ease-in-out infinite;
    z-index: 10;
}

/* Inner spinner ring - matches main image spinner exactly */
.showcase-thumb.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 36px; /* 50px - 2*7px (outer border + spacing) */
    height: 36px;
    border: 3px solid transparent;
    border-top-color: #61b6f2;
    border-bottom-color: #61b6f2;
    border-radius: 50%;
    animation: thumbSpin 1.2s ease-in-out infinite reverse;
    z-index: 11;
}

@keyframes thumbSpin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.showcase-thumb.active {
    border: 3px solid #345;
    box-shadow:
        0 4px 12px rgba(52, 85, 120, 0.15),
        0 8px 24px rgba(52, 85, 120, 0.1);
    transform: translateY(-8px) scale(1.02);
    z-index: 2;
    filter: none;
}

.showcase-thumb:hover {
    filter: none;
    border-color: rgba(97, 182, 242, 0.4);
    transform: translateY(-3px);
    box-shadow:
        0 3px 10px rgba(52, 85, 120, 0.08),
        0 6px 18px rgba(52, 85, 120, 0.05);
}

.showcase-thumb:active {
    border-color: #5a8ab8;
    transform: translateY(-1px) scale(0.98);
}

/* Point Cloud PLY Buttons */
.ply-btn {
    border: 1px solid #cfd6df;
    background: #f7f9fc;
    color: #345;
    padding: 8px 20px;
    border-radius: 999px;
    font-size: 0.93rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0 6px;
}

.ply-btn.active {
    background: #345;
    color: #fff;
    border-color: #345;
}

.ply-btn:hover:not(.active) {
    background: #e3eaf2;
}

/* Overview Stage Bar */
.overview-stage-bar {
    background: linear-gradient(135deg, #f8f9fa 0%, #f5f7fa 100%);
    border-radius: 16px;
    padding: 12px 12px 8px 12px;
    margin: 20px auto 0 auto;
    display: flex;
    justify-content: center;
    gap: 12px;
    box-shadow:
        0 2px 8px rgba(52, 85, 120, 0.04),
        0 4px 16px rgba(52, 85, 120, 0.02);
    max-width: 850px;
    border: 1px solid rgba(52, 85, 120, 0.06);
}

.overview-stage-btn {
    background: white;
    border: 1.5px solid rgba(52, 85, 120, 0.1);
    border-radius: 10px;
    padding: 0.35em 0.85em;
    font-size: 0.94rem;
    font-family: 'Jost', 'Segoe UI', Arial, sans-serif;
    font-weight: 500;
    color: #345;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    outline: none;
    box-shadow: 0 1px 3px rgba(52, 85, 120, 0.04);
}

.overview-stage-btn:hover:not(.active) {
    background: #f0f4f8;
    border-color: rgba(52, 85, 120, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(52, 85, 120, 0.08);
}

.overview-stage-btn.active {
    background: linear-gradient(135deg, #5a8ab8 0%, #345 100%) !important;
    color: #fff !important;
    border-color: #345 !important;
    box-shadow:
        0 2px 8px rgba(52, 85, 120, 0.2),
        0 4px 12px rgba(52, 85, 120, 0.1) !important;
    transform: translateY(-1px);
}

.overview-stage-btn:active {
    transform: translateY(0) scale(0.98);
}

.demo-stage-bar {
    max-width: 100%;
    flex-wrap: wrap;
}

.demo-stage-bar .overview-stage-btn {
    white-space: normal;
}

.demo-video-wrap {
    position: relative;
    display: flex;
    justify-content: center;
    width: 100%;
}

.media-loading-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: 12px;
    background: rgba(16, 24, 32, 0.42);
    color: #fff;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.18s ease, visibility 0.18s ease;
}

.media-loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.media-loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 255, 255, 0.36);
    border-top-color: #fff;
    border-radius: 50%;
    animation: mediaSpin 0.85s linear infinite;
}

.media-loading-text {
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.28);
    font-size: 0.92rem;
    font-weight: 500;
    line-height: 1.2;
}

@keyframes mediaSpin {
    to {
        transform: rotate(360deg);
    }
}

.gs-gallery {
    width: 100%;
}

.gs-filter-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 4px 0 18px 0;
    padding: 8px;
    border-radius: 16px;
    background: rgba(247, 249, 252, 0.72);
    border: 1px solid rgba(52, 85, 120, 0.08);
}

.gs-filter-btn {
    border: 1.5px solid rgba(52, 85, 120, 0.12);
    background: #fff;
    color: #345;
    padding: 7px 18px;
    border-radius: 999px;
    font-size: 0.94rem;
    font-family: 'Jost', 'Segoe UI', Arial, sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 1px 3px rgba(52, 85, 120, 0.04);
}

.gs-filter-btn:hover:not(.active) {
    background: #f0f4f8;
    border-color: rgba(52, 85, 120, 0.2);
    transform: translateY(-1px);
}

.gs-filter-btn.active {
    background: linear-gradient(135deg, #345 0%, #5a8ab8 100%);
    color: #fff;
    border-color: #345;
    box-shadow:
        0 2px 8px rgba(52, 85, 120, 0.2),
        0 4px 12px rgba(52, 85, 120, 0.1);
}

.gs-stage {
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid rgba(52, 85, 120, 0.12);
    background: #fff;
    box-shadow:
        0 2px 8px rgba(52, 85, 120, 0.06),
        0 6px 18px rgba(52, 85, 120, 0.05);
}

.gs-stage-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 13px 16px;
    background: linear-gradient(135deg, #f8f9fa 0%, #f3f6f9 100%);
    border-bottom: 1px solid rgba(52, 85, 120, 0.09);
}

.gs-stage-kicker {
    margin-bottom: 2px;
    color: #5a8ab8;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.gs-stage-header h4 {
    margin: 0;
    color: #345;
    font-size: 1.16rem;
    font-weight: 600;
    line-height: 1.25;
}

.gs-stage-header p {
    margin: 3px 0 0 0;
    color: #68788a;
    font-size: 0.92rem;
    line-height: 1.35;
}

.gs-stage-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.gs-control-hint {
    flex: 0 0 auto;
    border: 1px solid rgba(90, 138, 184, 0.18);
    border-radius: 999px;
    padding: 6px 12px;
    color: #4b6178;
    background: rgba(255, 255, 255, 0.76);
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
}

.gs-frame-wrap {
    position: relative;
    width: 100%;
    min-height: 520px;
    aspect-ratio: 16 / 9;
    background:
        linear-gradient(135deg, rgba(52, 85, 120, 0.08), rgba(90, 138, 184, 0.04)),
        #101820;
}

.gs-frame-wrap iframe {
    width: 100%;
    height: 100%;
    min-height: 520px;
    border: 0;
    display: block;
    background: #101820;
}

.gs-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.gs-card {
    position: relative;
    overflow: hidden;
    min-height: 152px;
    padding: 0;
    border-radius: 12px;
    border: 1.5px solid rgba(52, 85, 120, 0.11);
    background: #f8f9fa;
    color: #345;
    text-align: left;
    cursor: pointer;
    box-shadow:
        0 2px 8px rgba(52, 85, 120, 0.05),
        0 4px 14px rgba(52, 85, 120, 0.03);
    transition: all 0.25s ease;
}

.gs-card:hover {
    border-color: rgba(90, 138, 184, 0.45);
    transform: translateY(-2px);
    box-shadow:
        0 4px 12px rgba(52, 85, 120, 0.09),
        0 8px 20px rgba(52, 85, 120, 0.06);
}

.gs-card.active {
    border-color: #5a8ab8;
    box-shadow:
        0 0 0 2px rgba(90, 138, 184, 0.18),
        0 4px 14px rgba(52, 85, 120, 0.12);
}

.gs-card-category {
    position: absolute;
    left: 10px;
    top: 10px;
    z-index: 2;
    display: inline-flex;
    padding: 4px 9px;
    border-radius: 999px;
    color: #fff;
    background: rgba(52, 85, 120, 0.9);
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.2;
}

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

.gs-card-source {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    padding: 22px 12px 10px 12px;
    color: #fff;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.68) 100%);
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.35;
}

.comparison-viewer {
    width: 100%;
}

.comparison-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    align-items: stretch;
}

.comparison-grid.comparison-grid-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.comparison-card {
    position: relative;
    margin: 0;
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid rgba(52, 85, 120, 0.12);
    background: #f8f9fa;
    box-shadow:
        0 2px 8px rgba(52, 85, 120, 0.06),
        0 4px 14px rgba(52, 85, 120, 0.04);
}

.comparison-card img {
    width: 100%;
    height: 100%;
    min-height: 180px;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    display: block;
}

.comparison-label {
    position: absolute;
    left: 10px;
    top: 10px;
    z-index: 2;
    padding: 4px 10px;
    border-radius: 999px;
    color: #fff;
    background: rgba(52, 85, 120, 0.9);
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
}


.comparison-scene-strip {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 18px;
    padding: 14px;
    border-radius: 14px;
    background: rgba(247, 249, 252, 0.72);
    border: 1px solid rgba(52, 85, 120, 0.08);
}

.comparison-scene-btn {
    flex: 0 1 clamp(180px, 19vw, 240px);
    padding: 0;
    overflow: hidden;
    border-radius: 10px;
    border: 2px solid rgba(52, 85, 120, 0.12);
    background: #fff;
    color: #345;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(52, 85, 120, 0.06);
    transition: all 0.25s ease;
}

.comparison-scene-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(90, 138, 184, 0.45);
    box-shadow: 0 4px 12px rgba(52, 85, 120, 0.1);
}

.comparison-scene-btn.active {
    border-color: #5a8ab8;
    box-shadow:
        0 0 0 2px rgba(90, 138, 184, 0.18),
        0 4px 14px rgba(52, 85, 120, 0.12);
}

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

@media (max-width: 700px) {
    .gs-stage-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .gs-stage-actions {
        justify-content: flex-start;
    }

    .gs-frame-wrap,
    .gs-frame-wrap iframe {
        min-height: 420px;
    }

    .comparison-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .overview-stage-bar {
        flex-direction: column;
        gap: 6px;
        padding: 8px 4px 4px 4px;
    }

    .overview-stage-btn {
        font-size: 0.91rem;
        padding: 0.22em 0.5em;
    }

    .showcase-bar {
        gap: 6px;
        padding: 12px 8px;
    }

    .showcase-thumb {
        flex: 1 1 48%;
        max-width: 48%;
        min-width: 120px;
    }
}

@media (max-width: 480px) {
    .gs-filter-btn {
        flex: 1 1 44%;
        padding: 7px 10px;
    }

    .gs-frame-wrap,
    .gs-frame-wrap iframe {
        min-height: 340px;
    }

    .gs-card-grid {
        grid-template-columns: 1fr;
    }

    .comparison-grid,
    .comparison-grid.comparison-grid-two {
        grid-template-columns: 1fr;
    }

    .comparison-scene-btn {
        flex-basis: min(100%, 260px);
    }

    .showcase-thumb {
        flex: 1 1 100%;
        max-width: 100%;
    }
}

/* Interactive Depth Loading Overlay */
.interactive-depth-wrapper {
    position: relative;
    min-height: 400px; /* Ensure minimum height for loading state */
}

.interactive-depth-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.interactive-depth-loading.active {
    opacity: 1;
    visibility: visible;
}

.interactive-depth-loading .loading-text {
    margin-top: 16px;
    font-size: 1rem;
    color: #345;
    font-weight: 500;
    font-family: 'Jost', sans-serif;
}

.interactive-comparison.loading {
    opacity: 0;
    pointer-events: none;
}
