/**
 * Virtu AR Catalog - Public Styles
 */

/* AR Viewer Container */
.virtu-ar-viewer-container {
    position: relative;
    background: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
    margin: 20px 0;
}

model-viewer {
    width: 100%;
    height: 100%;
    background-color: #f5f5f5;
}

/* AR Progress Bar */
.virtu-ar-progress-bar {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: 300px;
    height: 4px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.virtu-ar-progress-bar-fill {
    height: 100%;
    background: #0073aa;
    width: 0%;
    transition: width 0.3s ease;
}

/* AR Activate Button */
.virtu-ar-activate-button {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    color: #333;
    border: none;
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.virtu-ar-activate-button:hover {
    background: #0073aa;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.4);
}

/* Custom AR Button Image */
.virtu-ar-activate-button.has-custom-image {
    background-color: transparent !important;
    color: transparent;
    box-shadow: none;
    border: none;
    min-width: 80px;
    min-height: 80px;
}

.virtu-ar-activate-button.has-custom-image:hover {
    background-color: transparent !important;
    opacity: 0.8;
    transform: translateX(-50%) scale(1.05);
}

/* AR Info Overlay */
.virtu-ar-info {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    max-width: 300px;
}

.virtu-ar-info h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: #333;
}

/* Info Position Variants */
.virtu-ar-info-top-right .virtu-ar-info {
    left: auto;
    right: 20px;
}

.virtu-ar-info-bottom-left .virtu-ar-info {
    top: auto;
    bottom: 20px;
    left: 20px;
}

.virtu-ar-info-bottom-right .virtu-ar-info {
    top: auto;
    bottom: 20px;
    left: auto;
    right: 20px;
}

.virtu-ar-info-hidden .virtu-ar-info {
    display: none;
}

/* Progress Bar Position Variants */
.virtu-ar-progress-top .virtu-ar-progress-bar {
    top: 20px;
    bottom: auto;
    transform: translateX(-50%);
}

.virtu-ar-progress-bottom .virtu-ar-progress-bar {
    top: auto;
    bottom: 20px;
    transform: translateX(-50%);
}

.virtu-ar-progress-hidden .virtu-ar-progress-bar {
    display: none;
}

/* AR Modal */
.virtu-ar-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
}

.virtu-ar-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
}

.virtu-ar-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 1200px;
    height: 80%;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.virtu-ar-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    line-height: 40px;
    text-align: center;
    cursor: pointer;
    z-index: 10;
    transition: background 0.3s ease;
}

.virtu-ar-modal-close:hover {
    background: rgba(0, 0, 0, 0.8);
}

#virtu-ar-modal-body {
    width: 100%;
    height: 100%;
}

/* AR Button (standalone) */
.virtu-ar-button {
    display: inline-block;
    background: #0073aa;
    color: #fff;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.virtu-ar-button:hover {
    background: #005177;
    color: #fff;
}

/* WooCommerce AR Button */
.virtu-ar-wc-button-wrapper {
    margin-top: 15px;
}

.virtu-ar-wc-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background: #0073aa !important;
    color: #fff !important;
    border-color: #0073aa !important;
}

.virtu-ar-wc-button:hover {
    background: #005177 !important;
    border-color: #005177 !important;
}

.virtu-ar-wc-button .dashicons {
    width: 20px;
    height: 20px;
    font-size: 20px;
}

/* AR Gallery */
.virtu-ar-gallery {
    margin: 30px 0;
}

.virtu-ar-gallery-item {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    transition: box-shadow 0.3s ease;
}

.virtu-ar-gallery-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.virtu-ar-gallery-thumbnail {
    margin-bottom: 15px;
    overflow: hidden;
    border-radius: 4px;
}

.virtu-ar-gallery-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
}

.virtu-ar-gallery-title {
    margin: 0 0 10px 0;
    font-size: 18px;
}

.virtu-ar-gallery-title a {
    color: #333;
    text-decoration: none;
}

.virtu-ar-gallery-title a:hover {
    color: #0073aa;
}

.virtu-ar-gallery-excerpt {
    margin-bottom: 15px;
    color: #666;
    font-size: 14px;
}

.virtu-ar-gallery-button {
    display: block;
    width: 100%;
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.virtu-ar-gallery-button:hover {
    background: #005177;
}

/* WooCommerce Gallery AR Icon */
.virtu-ar-gallery-trigger {
    position: relative;
    display: block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    text-align: center;
}

.virtu-ar-gallery-trigger img {
    max-width: 80px;
    height: auto;
    margin: 0 auto;
    display: block;
}

.virtu-ar-gallery-label {
    display: block;
    margin-top: 10px;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
}

/* Advanced Settings: Hide Dimensions */
.virtu-ar-hide-dimensions model-viewer::part(default-ar-button) {
    display: none;
}

/* Advanced Settings: Disable Fullscreen */
.virtu-ar-disable-fullscreen model-viewer::part(default-control-fullscreen) {
    display: none !important;
}

.virtu-ar-disable-fullscreen model-viewer button[data-name="fullscreen"] {
    display: none !important;
}

/* Hotspot Annotations */
.virtu-ar-hotspot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #0073aa;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.virtu-ar-hotspot:hover {
    width: 24px;
    height: 24px;
    border-color: #005177;
    transform: scale(1.2);
}

.virtu-ar-hotspot-annotation {
    display: none;
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
    min-width: 200px;
    max-width: 300px;
    z-index: 100;
}

.virtu-ar-hotspot-annotation::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: rgba(255, 255, 255, 0.95);
}

.virtu-ar-hotspot:hover .virtu-ar-hotspot-annotation {
    display: block;
    animation: fadeIn 0.3s ease;
}

.virtu-ar-hotspot-annotation h4 {
    margin: 0 0 6px 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    white-space: normal;
}

.virtu-ar-hotspot-annotation p {
    margin: 0;
    font-size: 12px;
    color: #666;
    line-height: 1.4;
    white-space: normal;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* CTA Button */
.virtu-ar-cta {
    position: absolute;
    z-index: 10;
}

.virtu-ar-cta-bottom-center {
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
}

.virtu-ar-cta-bottom-left {
    bottom: 80px;
    left: 20px;
}

.virtu-ar-cta-bottom-right {
    bottom: 80px;
    right: 20px;
}

.virtu-ar-cta-top-center {
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.virtu-ar-cta-top-left {
    top: 20px;
    left: 20px;
}

.virtu-ar-cta-top-right {
    top: 20px;
    right: 20px;
}

.virtu-ar-cta-button {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 14px 28px;
    border-radius: 28px;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    text-align: center;
    white-space: nowrap;
}

.virtu-ar-cta-button:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
    transform: translateY(-2px);
    color: #fff;
}

.virtu-ar-cta-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.4);
}

/* Model Thumbnails Gallery */
.virtu-ar-model-thumbnails {
    display: flex;
    gap: 12px;
    margin-top: 15px;
    padding: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.virtu-ar-model-thumbnail {
    flex: 0 0 auto;
    width: 100px;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: #f5f5f5;
}

.virtu-ar-model-thumbnail:hover {
    border-color: #0073aa;
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.3);
}

.virtu-ar-model-thumbnail.active {
    border-color: #0073aa;
    box-shadow: 0 2px 12px rgba(0, 115, 170, 0.5);
}

.virtu-ar-model-thumbnail-preview {
    width: 100%;
    height: 80px;
    position: relative;
    overflow: hidden;
}

.virtu-ar-model-thumbnail-preview model-viewer {
    pointer-events: none;
}

.virtu-ar-model-thumbnail-label {
    padding: 6px 8px;
    font-size: 11px;
    text-align: center;
    color: #333;
    background: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.virtu-ar-model-thumbnail.active .virtu-ar-model-thumbnail-label {
    background: #0073aa;
    color: #fff;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
    .virtu-ar-modal-content {
        width: 95%;
        height: 90%;
    }

    .virtu-ar-info {
        max-width: calc(100% - 40px);
    }

    .virtu-ar-gallery {
        grid-template-columns: 1fr !important;
    }

    .virtu-ar-model-thumbnails {
        gap: 8px;
        padding: 8px;
    }

    .virtu-ar-model-thumbnail {
        width: 80px;
    }

    .virtu-ar-model-thumbnail-preview {
        height: 60px;
    }
}

@media (max-width: 480px) {
    .virtu-ar-activate-button {
        font-size: 14px;
        padding: 10px 20px;
    }

    .virtu-ar-info {
        padding: 10px 15px;
    }

    .virtu-ar-info h3 {
        font-size: 16px;
    }

    .virtu-ar-cta-button {
        font-size: 14px;
        padding: 12px 24px;
    }

    .virtu-ar-cta-bottom-center,
    .virtu-ar-cta-bottom-left,
    .virtu-ar-cta-bottom-right {
        bottom: 70px;
    }

    .virtu-ar-model-thumbnail {
        width: 70px;
    }

    .virtu-ar-model-thumbnail-preview {
        height: 50px;
    }

    .virtu-ar-model-thumbnail-label {
        font-size: 10px;
        padding: 4px 6px;
    }
}
