/**
 * WooCommerce 3D Animator – Frontend Styles
 *
 * @package WC3D_Animator
 * @since   1.0.0
 */

/* ============================================================
   3D Canvas Container
   ============================================================ */

#woo-3d-canvas-container {
    position: relative;
    width: 100%;
    height: 450px;
    min-height: 320px;
    margin: 0 0 24px;
    border: 2px solid rgba(127, 84, 179, 0.3);
    border-radius: 12px;
    background-color: #1a1a2e;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

#woo-3d-canvas-container:hover {
    border-color: rgba(155, 89, 182, 0.6);
    box-shadow: 0 6px 30px rgba(127, 84, 179, 0.2);
}

/* Canvas element rendered by Three.js */
#woo-3d-canvas-container canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    z-index: 1;
    cursor: grab;
}

#woo-3d-canvas-container canvas:active {
    cursor: grabbing;
}

/* ============================================================
   Loading Overlay
   ============================================================ */

.wc3da-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(26, 26, 46, 0.92);
    z-index: 10;
    gap: 16px;
    transition: opacity 0.4s ease;
}

/* Spinner ring animation */
.wc3da-spinner-ring {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(155, 89, 182, 0.15);
    border-top: 3px solid #9b59b6;
    border-radius: 50%;
    animation: wc3da-spin 0.9s linear infinite;
}

@keyframes wc3da-spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.wc3da-loading-text {
    color: rgba(255, 255, 255, 0.55);
    font-size: 13px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    letter-spacing: 0.3px;
    pointer-events: none;
    text-align: center;
    max-width: 80%;
    line-height: 1.5;
}

/* ============================================================
   Error State
   ============================================================ */

.wc3da-error-icon {
    font-size: 32px;
    line-height: 1;
}

.wc3da-error-text {
    color: #ff6b6b !important;
}

.wc3da-retry-btn {
    display: inline-block;
    padding: 8px 24px;
    background: rgba(155, 89, 182, 0.2);
    border: 1px solid rgba(155, 89, 182, 0.4);
    border-radius: 6px;
    color: #c084fc;
    font-size: 13px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
    pointer-events: auto;
    margin-top: 4px;
}

.wc3da-retry-btn:hover {
    background: rgba(155, 89, 182, 0.35);
    border-color: rgba(155, 89, 182, 0.7);
}

.wc3da-retry-btn:active {
    background: rgba(155, 89, 182, 0.5);
}

/* ============================================================
   Responsive Adjustments
   ============================================================ */

@media (max-width: 768px) {
    #woo-3d-canvas-container {
        height: 320px;
        min-height: 250px;
        border-radius: 8px;
    }

    .wc3da-spinner-ring {
        width: 36px;
        height: 36px;
    }

    .wc3da-loading-text {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    #woo-3d-canvas-container {
        height: 260px;
        min-height: 200px;
        margin: 0 0 16px;
    }

    .wc3da-error-icon {
        font-size: 24px;
    }
}
