/**
 * WooCommerce 3D Model Viewer - Frontend Styles
 * Simple, clean styling for product gallery integration
 */

/* Viewer container */
#wc-3d-model-viewer {
    width: 100%;
    height: 400px;
    position: relative;
    background: #f7f7f7;
    overflow: hidden;
    margin-bottom: 1em;
    border: 1px solid #dfdfdf;
    border-radius: 7px;
}

/* Loading indicator */
.wc-3d-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.8);
    z-index: 10;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 14px;
    color: #333;
}

.wc-3d-loading:after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-left: 10px;
    border: 2px solid rgba(0,0,0,0.1);
    border-left-color: #13aff0;
    border-radius: 50%;
    vertical-align: middle;
    animation: wc3dLoading 1s linear infinite;
}

@keyframes wc3dLoading {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error message */
.wc-3d-error {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 235, 235, 0.9);
    color: #d82c0d;
    padding: 1em;
    text-align: center;
    z-index: 10;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 14px;
}

/* Controls */
.wc-3d-controls {
    display: flex;
    justify-content: center;
    margin: 0.5em 0 1em;
    gap: 8px;
}

.wc-3d-button {
    background: #f7f7f7;
    color: #515151;
    border: 1px solid #ccc;
    padding: 0.5em 1em;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.5;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    transition: all 0.2s ease;
}

.wc-3d-button:hover {
    background: #ebebeb;
    border-color: #999;
}


/* Make sure the canvas is responsive */
#wc-3d-model-viewer canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

/* WooCommerce gallery integration */
.woocommerce-product-gallery {
    overflow: visible !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #wc-3d-model-viewer {
        height: 300px !important;
    }
}

@media (max-width: 480px) {
    #wc-3d-model-viewer {
        height: 300px !important;
    }
    
    .wc-3d-controls {
        flex-wrap: wrap;
    }
    
    .wc-3d-button {
        width: 100%;
        text-align: center;
    }
}