/* Frontend Styles for WooCommerce 3D Configurator */
/* Version: 7.1 */

/* 3D Iframe Container */
.woocommerce-product-gallery--3d-config {
    position: relative;
    width: 100%;
}

.wc-3d-config-iframe-container {
    position: relative;
    width: 100%;
    padding-bottom: 100%;
    background: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
}

.wc-3d-config-iframe-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.wc-3d-config-no-iframe {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    background: #f5f5f5;
    border-radius: 8px;
    color: #666;
}

/* Loading Overlay */
.wc-3d-config-iframe-container.loading iframe {
    opacity: 0.3;
    transition: opacity 0.2s;
}

.wc-3d-config-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.wc-3d-config-iframe-container.loading .wc-3d-config-loading {
    display: flex;
}

.wc-3d-config-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: wc-3d-config-spin 0.8s linear infinite;
}

@keyframes wc-3d-config-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Frozen Config Menu (waiting for viewer) */
.wc-3d-config-options.wc-3d-config-frozen {
    position: relative;
    pointer-events: none;
}

.wc-3d-config-options.wc-3d-config-frozen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    z-index: 10;
    border-radius: 8px;
}

.wc-3d-config-options.wc-3d-config-frozen::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #ddd;
    border-top-color: #2271b1;
    border-radius: 50%;
    z-index: 11;
    animation: wc-3d-config-spin 0.8s linear infinite;
}

.wc-3d-config-options.wc-3d-config-frozen select,
.wc-3d-config-options.wc-3d-config-frozen input {
    opacity: 0.5;
}

/* Toolbar */
.wc-3d-config-toolbar {
    position: absolute;
    bottom: 15px;
    right: 15px;
    display: flex;
    gap: 8px;
    z-index: 20;
}

.wc-3d-config-toolbar-btn {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.2s;
}

.wc-3d-config-toolbar-btn:hover {
    background: #fff;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.wc-3d-config-toolbar-btn:active {
    transform: scale(0.95);
}

.wc-3d-config-toolbar-btn svg {
    width: 20px;
    height: 20px;
}

/* Toast Notification */
.wc-3d-config-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #333;
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.wc-3d-config-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.wc-3d-config-toast.success {
    background: #4caf50;
}

.wc-3d-config-toast.error {
    background: #f44336;
}

/* Configuration Options */
.wc-3d-config-options {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.wc-3d-config-options-title {
    margin: 0 0 20px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
    font-size: 18px;
    font-weight: 600;
}

.wc-3d-config-option {
    margin-bottom: 20px;
    transition: all 0.2s ease;
}

.wc-3d-config-option:last-of-type {
    margin-bottom: 25px;
}

/* Conditional Option - Hidden State */
.wc-3d-config-option-hidden {
    opacity: 0;
    pointer-events: none;
}

.wc-3d-config-option-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.wc-3d-config-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s;
}

.wc-3d-config-select:hover {
    border-color: #999;
}

.wc-3d-config-select:focus {
    outline: none;
    border-color: #0073aa;
}

/* Price Summary */
.wc-3d-config-price-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-top: 2px solid #e0e0e0;
    margin-top: 20px;
}

.wc-3d-config-price-label {
    font-weight: 600;
    font-size: 16px;
    color: #333;
}

.wc-3d-config-price-value {
    font-size: 24px;
    font-weight: 700;
    color: #0073aa;
}

/* Responsive */
@media (max-width: 768px) {
    .wc-3d-config-iframe-container {
        padding-bottom: 75%;
    }
    
    .wc-3d-config-options {
        padding: 15px;
    }
    
    .wc-3d-config-price-summary {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .wc-3d-config-toolbar {
        bottom: 10px;
        right: 10px;
    }
    
    .wc-3d-config-toolbar-btn {
        width: 40px;
        height: 40px;
    }
}

/* Fullscreen Button */
.wc-3d-config-fullscreen-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.2s;
    z-index: 20;
}

.wc-3d-config-fullscreen-btn:hover {
    background: #fff;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.wc-3d-config-fullscreen-btn:active {
    transform: scale(0.95);
}

.wc-3d-config-fullscreen-btn svg {
    width: 20px;
    height: 20px;
}

/* Fullscreen Mode */
.wc-3d-config-iframe-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    padding-bottom: 0;
    z-index: 999999;
    border-radius: 0;
    background: #000;
}

.wc-3d-config-iframe-container.fullscreen iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.wc-3d-config-iframe-container.fullscreen .wc-3d-config-fullscreen-btn {
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
}

.wc-3d-config-iframe-container.fullscreen .wc-3d-config-toolbar {
    bottom: 20px;
    right: 20px;
}

.wc-3d-config-iframe-container.fullscreen .fullscreen-icon-expand {
    display: none;
}

.wc-3d-config-iframe-container.fullscreen .fullscreen-icon-close {
    display: block !important;
}

/* Body when fullscreen is active */
body.wc-3d-config-fullscreen-active {
    overflow: hidden;
}
