/* frontend.css - Styles for the frontend display */
.threed-product-universe {
    position: relative;
    width: 100%;
    overflow: hidden;
    height: 100vh;
}

.threed-product-universe canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    cursor: grab;
}

.threed-product-universe canvas:active {
    cursor: grabbing;
}

/* Loading spinner */
.threed-product-universe .loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    text-align: center;
    color: white;
}

.threed-product-universe .loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid #333;
    border-top: 3px solid #4f46e5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Text overlay */
.threed-product-universe .text-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    pointer-events: none;
    z-index: 10;
}

.threed-product-universe .text-overlay h1 {
    font-size: 2.25rem;
    line-height: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    text-align: center;
}

@media (min-width: 768px) {
    .threed-product-universe .text-overlay h1 {
        font-size: 3.75rem;
        line-height: 1;
    }
}

.threed-product-universe .text-overlay p {
    font-size: 1.125rem;
    line-height: 1.75rem;
    text-align: center;
    margin-bottom: 2rem;
    max-width: 42rem;
}

@media (min-width: 768px) {
    .threed-product-universe .text-overlay p {
        font-size: 1.25rem;
        line-height: 1.75rem;
    }
}

/* Image Modal Styles */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    opacity: 0;
    animation: fadeIn 0.3s ease-out forwards;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
}

.image-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 95%;
    max-width: 1200px;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: modalZoomIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalZoomIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.7);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.modal-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    font-size: 28px;
    color: white;
    cursor: pointer;
    z-index: 1001;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: rotate(90deg);
}

/* Navigation Buttons */
.nav-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 40px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    z-index: 1001;
}

.nav-button:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-50%) scale(1.1);
}

.prev-button {
    left: 20px;
}

.next-button {
    right: 20px;
}

/* Image Container */
.image-container {
    width: 100%;
    max-height: calc(95vh - 120px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.image-container img {
    max-width: 100%;
    max-height: calc(95vh - 200px);
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: imageAppear 0.5s ease-out;
}

@keyframes imageAppear {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Image Info */
.image-info {
    text-align: center;
    color: white;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 300px;
}

.image-info h3 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: white;
}

.image-info p {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    color: #4f46e5;
    text-shadow: 0 0 10px rgba(79, 70, 229, 0.5);
}

.image-info .old-price {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: line-through;
    margin-left: 10px;
}

/* Thumbnail Strip */
.thumbnail-strip {
    display: flex;
    gap: 12px;
    margin-top: 15px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.thumbnail {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s ease;
    opacity: 0.6;
}

.thumbnail:hover {
    opacity: 1;
    transform: scale(1.05);
}

.thumbnail.active {
    border-color: #4f46e5;
    opacity: 1;
    box-shadow: 0 0 20px rgba(79, 70, 229, 0.6);
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .modal-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
    
    .nav-button {
        width: 50px;
        height: 50px;
        font-size: 32px;
    }
    
    .prev-button {
        left: 10px;
    }
    
    .next-button {
        right: 10px;
    }
    
    .image-container img {
        max-height: calc(95vh - 250px);
    }
    
    .image-info {
        min-width: auto;
        width: 90%;
    }
    
    .image-info h3 {
        font-size: 20px;
    }
    
    .image-info p {
        font-size: 18px;
    }
    
    .thumbnail-strip {
        gap: 8px;
        padding: 8px;
        overflow-x: auto;
        max-width: 90vw;
    }
    
    .thumbnail {
        width: 60px;
        height: 60px;
        flex-shrink: 0;
    }
}

/* Smooth scrolling for thumbnails on mobile */
.thumbnail-strip::-webkit-scrollbar {
    height: 6px;
}

.thumbnail-strip::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.thumbnail-strip::-webkit-scrollbar-thumb {
    background: rgba(79, 70, 229, 0.6);
    border-radius: 3px;
}

.thumbnail-strip::-webkit-scrollbar-thumb:hover {
    background: rgba(79, 70, 229, 0.8);
}

/* Loading shimmer effect */
.image-container img {
    background: linear-gradient(90deg, rgba(255,255,255,0.1) 25%, transparent 37%, rgba(255,255,255,0.1) 63%);
    background-size: 400% 100%;
}

/* Keyboard navigation hint (optional) */
.image-modal-content::after {
    content: "Use ← → arrow keys or swipe to navigate";
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .image-modal-content::after {
        content: "Swipe to navigate";
    }
}