/* 3D Viewer Badge - Modern Design */
.badge-3d-viewer {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    z-index: 100 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.badge-3d-viewer:hover {
    background: rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.badge-3d-viewer:active {
    transform: translateY(0);
}

.badge-3d-viewer svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
}

.badge-3d-viewer span {
    font-size: 14px;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* Modern 3D icon - simple cube outline */
.badge-3d-viewer svg {
    width: 18px;
    height: 18px;
}

/* 3D Viewer Modal */
.modal-3d-viewer {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.modal-3d-viewer.active {
    display: flex;
}

.modal-3d-content {
    position: relative;
    width: 90%;
    height: 90%;
    max-width: 1200px;
    max-height: 800px;
    background: #f5f5f5;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-3d-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: #f5f5f5;
    border-bottom: 1px solid #ddd;
}

.modal-3d-title {
    color: #333;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.modal-3d-close {
    background: transparent;
    border: none;
    color: #333;
    font-size: 28px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.modal-3d-close:hover {
    background: rgba(0, 0, 0, 0.05);
}

.modal-3d-viewer-container {
    width: 100%;
    height: calc(100% - 70px);
    position: relative;
}

#viewer-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.viewer-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.viewer-loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.viewer-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    background: rgba(255, 255, 255, 0.95);
    padding: 12px;
    border-radius: 8px;
}

.viewer-control-btn {
    background: #ffffff;
    border: 1px solid #ddd;
    color: #333;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.viewer-control-btn:hover {
    background: #e8e8e8;
}

.viewer-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ff6b6b;
    font-size: 16px;
    text-align: center;
    max-width: 400px;
}
