/**
 * WooCommerce AR Product - Frontend Styles
 */

/* Buttons Wrapper */
.woo-ar-buttons-wrapper {
    display: flex !important;
    gap: 10px;
    margin-top: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 100 !important;
    clear: both;
    width: 100% !important;
}

/* Button Styles */
.woo-ar-view-btn,
.woo-ar-download-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none !important;
    line-height: 1.5;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    min-height: 44px;
    white-space: nowrap;
}

.woo-ar-view-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.woo-ar-view-btn:hover {
    background: linear-gradient(135deg, #5568d3 0%, #63408a 100%);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
    transform: translateY(-2px);
    color: #ffffff;
}

.woo-ar-download-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.4);
}

.woo-ar-download-btn:hover {
    background: linear-gradient(135deg, #e082ea 0%, #e4465b 100%);
    box-shadow: 0 6px 20px rgba(245, 87, 108, 0.6);
    transform: translateY(-2px);
    color: #ffffff;
}

.woo-ar-icon {
    font-size: 20px;
    line-height: 1;
}

/* Modal Styles */
.woo-ar-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.woo-ar-modal.active {
    opacity: 1;
    pointer-events: all;
}

.woo-ar-modal-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    height: 80vh;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.woo-ar-modal.active .woo-ar-modal-content {
    transform: scale(1);
}

.woo-ar-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.6);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.woo-ar-modal-close:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: rotate(90deg);
}

.woo-ar-modal-body {
    width: 100%;
    height: 100%;
    position: relative;
}

/* Model Viewer Styles */
model-viewer {
    width: 100%;
    height: 100%;
    background-color: #f5f5f5;
}

model-viewer::part(default-progress-bar) {
    background-color: #667eea;
}

/* AR Button inside model-viewer */
.woo-ar-activate-ar {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    z-index: 5;
}

.woo-ar-activate-ar:hover {
    background: linear-gradient(135deg, #5568d3 0%, #63408a 100%);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
    transform: translateX(-50%) translateY(-2px);
}

/* Loading Indicator in Modal */
.woo-ar-loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    font-size: 18px;
    color: #666;
}

.woo-ar-loading-indicator::after {
    content: '';
    display: block;
    width: 50px;
    height: 50px;
    margin: 20px auto 0;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: woo-ar-spin 1s linear infinite;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .woo-ar-buttons-wrapper {
        flex-direction: column;
        display: flex !important;
        visibility: visible !important;
    }
    
    .woo-ar-view-btn,
    .woo-ar-download-btn {
        width: 100%;
        display: inline-flex !important;
        visibility: visible !important;
    }
    
    .woo-ar-modal-content {
        width: 95%;
        height: 70vh;
    }
    
    .woo-ar-modal-close {
        width: 35px;
        height: 35px;
        font-size: 24px;
    }
}

/* Loading State */
.woo-ar-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.woo-ar-loading::after {
    content: '';
    display: block;
    width: 50px;
    height: 50px;
    margin: 10px auto;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #667eea;
    border-radius: 50%;
    animation: woo-ar-spin 1s linear infinite;
}

@keyframes woo-ar-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Loading Overlay with Progress */
.woo-ar-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.3s ease;
}

.woo-ar-loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.woo-ar-loading-content {
    text-align: center;
    padding: 30px;
}

.woo-ar-spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #667eea;
    border-radius: 50%;
    animation: woo-ar-spin 1s linear infinite;
}

.woo-ar-loading-text {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
}

.woo-ar-progress-bar {
    width: 300px;
    max-width: 90%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin: 0 auto 15px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.woo-ar-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

.woo-ar-progress-text {
    font-size: 16px;
    font-weight: 700;
    color: #667eea;
    margin: 0;
}
