/* Model Viewer Specific Styles */

/* Point Cloud Gallery */
#point-cloud-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
    padding: 40px 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.gallery-item {
    position: relative;
    background: rgba(14, 15, 15, 0.85);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    min-height: 300px;
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.5);
}

.gallery-item img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    flex: 1;
    min-height: 0;
    margin: auto;
    filter: blur(0px);
    transition: filter 0.3s ease;
}

.gallery-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 60px;
    pointer-events: none;
    background: linear-gradient(to bottom, 
        rgba(14, 15, 15, 0) 0%, 
        rgba(14, 15, 15, 0) 70%, 
        rgba(14, 15, 15, 0.3) 90%, 
        rgba(14, 15, 15, 0.6) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover::before {
    opacity: 1;
}

.gallery-caption {
    padding: 16px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    background: rgba(14, 15, 15, 0.95);
    position: relative;
    z-index: 1;
    margin-top: auto;
}

@media (max-width: 768px) {
    #point-cloud-gallery {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 20px 10px;
    }
}

/* Demo Header */
#demo-notice {
    margin: 0;
    padding: 8px;
    background-color: #b1b2b2;
}

#demo-notice-links {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

@media (max-width: 768px) {
    #demo-notice h1 {
        font-size: 24px;
    }
    #demo-notice-links {
        margin-top: 24px;
        flex-direction: column;
        align-items: center;
    }
}

.demo-notice-link {
    text-decoration: underline;
}

.demo-notice-link-selected {
    color: green !important;
}

/* Header Spacing */
.site-content .content-col1 h1 {
    margin-top: 30px;
}

/* Model Info Panel */
#model-info {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(14, 15, 15, 0.85);
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-sizing: border-box;
    max-width: 350px;
    z-index: 5;
    border-radius: 4px;
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}

#model-info.fade-out {
    opacity: 0;
}

#model-info h2 {
    font-size: 22px;
    color: #ffffff;
    margin-bottom: 10px;
    margin-top: 0;
    font-weight: normal;
    font-family: "apercu-regular", Arial, sans-serif;
}

#model-info p {
    font-size: 14px;
    color: #ffffff;
    line-height: 1.6;
    margin-bottom: 12px;
    font-family: "apercu-light", Arial, sans-serif;
}

#model-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    display: inline-block;
    background-color: rgba(66, 66, 66, 0.9);
    color: white;
    padding: 6px 12px;
    border-radius: 3px;
    font-size: 14px;
    font-family: Arial, sans-serif;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Model Viewer Container */
#viewer-container {
    width: 100%;
    margin-top: 20px;
    margin-bottom: 20px;
    box-sizing: border-box;
}

#model-viewer-box {
    position: relative;
    background: #2f2830;
    border: 1px solid #b1b2b2;
    overflow: hidden;
    min-height: 600px;
    box-sizing: border-box;
}

model-viewer {
    width: 100%;
    height: 100%;
    min-height: 600px;
    display: block;
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}

model-viewer.fade-out {
    opacity: 0;
}

/* Custom Loading Bar */
.custom-progress-bar {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.loading-text {
    color: #ffffff;
    font-size: 20px;
    font-weight: 500;
    font-family: "apercu-regular", Arial, sans-serif;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.progress-bar-container {
    width: 200px;
    height: 8px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #4a90e2, #7ab8ff);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
    transform-origin: left;
}

.custom-progress-bar.hidden {
    display: none;
}

@media (max-width: 768px) {
    .loading-text {
        font-size: 18px;
    }
    
    .progress-bar-container {
        width: 150px;
        height: 6px;
    }
}

@media (max-width: 480px) {
    .loading-text {
        font-size: 16px;
    }
    
    .progress-bar-container {
        width: 120px;
        height: 5px;
    }
}

/* Navigation Buttons */
.nav-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border: none;
    background-color: rgba(14, 15, 15, 0.7);
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.nav-button:hover {
    background-color: rgba(14, 15, 15, 0.9);
    transform: translateY(-50%) scale(1.1);
}

.nav-button span {
    line-height: 1;
}

.prev-button {
    left: 20px;
}

.next-button {
    right: 20px;
}

/* Model Counter */
#model-counter {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background-color: rgba(14, 15, 15, 0.7);
    color: white;
    padding: 10px 15px;
    border-radius: 3px;
    font-size: 14px;
    font-weight: normal;
    font-family: Arial, sans-serif;
}

/* Responsive Design for Model Viewer */
@media (max-width: 768px) {
    #model-viewer-box {
        min-height: 400px;
    }

    #model-viewer {
        min-height: 400px;
        margin-top: 160px;
    }

    .nav-button {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .prev-button {
        left: 10px;
    }

    .next-button {
        right: 10px;
    }

    #model-info {
        top: 10px;
        left: 10px;
        right: 10px;
        max-width: none;
        padding: 12px;
    }

    #model-info h2 {
        font-size: 18px;
        margin-bottom: 8px;
    }

    #model-info p {
        font-size: 13px;
        line-height: 1.5;
        margin-bottom: 10px;
    }

    #model-counter {
        bottom: 10px;
        right: 10px;
        padding: 8px 12px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    #model-viewer-box {
        min-height: 300px;
    }

    #model-viewer {
        min-height: 300px;
        margin-top: 100px;
    }

    .nav-button {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    #model-info {
        top: 8px;
        left: 8px;
        right: 8px;
        padding: 10px;
    }

    #model-info h2 {
        font-size: 16px;
        margin-bottom: 6px;
    }

    #model-info p {
        font-size: 12px;
        line-height: 1.4;
        margin-bottom: 8px;
    }

    #model-tags {
        gap: 4px;
    }

    .tag {
        padding: 4px 8px;
        font-size: 11px;
    }

    #model-counter {
        bottom: 8px;
        right: 8px;
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* Carousel Styles */
#carousel-container {
    max-width: 1200px;
}

#artifact-swiper {
    padding: 0;
}

#artifact-swiper .swiper-button-prev,
#artifact-swiper .swiper-button-next {
    color: #ffffff;
    background-color: rgba(14, 15, 15, 0.7);
    width: 44px;
    height: 44px;
    border-radius: 4px;
    transition: all 0.3s ease;
    padding: 16px;
    margin-left: 8px;
    margin-right: 8px;
}

#artifact-swiper .swiper-button-prev:after,
#artifact-swiper .swiper-button-next:after {
    font-size: 20px;
}

#artifact-swiper .swiper-button-prev:hover,
#artifact-swiper .swiper-button-next:hover {
    background-color: rgba(14, 15, 15, 0.9);
}

#artifact-swiper .swiper-button-prev.swiper-button-disabled,
#artifact-swiper .swiper-button-next.swiper-button-disabled {
    opacity: 0.3;
}

.carousel-item {
    width: 128px;
    cursor: pointer;
    border-radius: 4px;
    border: 3px solid transparent;
    box-sizing: border-box;
}

.carousel-item:hover {
    transform: translateY(-4px);
}

.carousel-item.active {
    border-color: #4a90e2;
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.carousel-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 1) 100%);
    padding: 8px;
    color: white;
    font-size: 12px;
    text-align: center;
    font-family: "apercu-light", Arial, sans-serif;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.carousel-item:hover .carousel-item-overlay {
    opacity: 1;
}

@media (max-width: 480px) {
    #artifact-swiper .swiper-button-prev,
    #artifact-swiper .swiper-button-next {
        display: none;
    }
}